-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opaque tooltip on Linux #220
Comments
The popup for the tooltip is configured here:
It would be very insightful what
The laf shouldn't change how tooltips are activated. Do you experience the same issue when using the system look and feel? |
type == HEAVY_WEIGHT
On the demo it seems to be working ok. Probably something I'm doing wrong so don't worry about this part. |
Actually I take back that last part. It seems that sometimes the tooltip is triggered as my |
Could you print out the component hierarchy of the tooltip together with the corresponding background colours? |
Which variables are those stored in? |
You have to loop over the parents of the tooltip i.e. Component p = content;
while(p != null) {
System.out.println(p);
System.out.println(p.getBackground());
System.out.println(p.isOpaque());
System.out.println("");
p = p.getParent()
} |
This part when I hover over the button (no tooltip is shown) javax.swing.JFrame[frame0,601,1242,337x296,invalid,layout=java.awt.BorderLayout,title=ToolTip Demo,resizable,normal,defaultCloseOperation=EXIT_ON_CLOSE,rootPane=javax.swing.JRootPane[,6,43,325x247,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=com.github.weisj.darklaf.ui.rootpane.DarkRootPaneBorder@1145ecf,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
java.awt.SystemColor[i=7]
true
--
javax.swing.JToolTip[,0,0,1x1,invalid,alignmentX=0.0,alignmentY=0.0,border=com.github.weisj.darklaf.ui.tooltip.DarkTooltipBorder@54442b74,flags=16777224,maximumSize=,minimumSize=,preferredSize=,tipText=<html><p style="color:red;">This is the ToolTip demo text!<br><p style="color:blue;">This is the ToolTip demo text!<br><p style="color:green;">This is the ToolTip demo text!<br></html>]
UIColor[r=247, g=247,b=247]
true
--
javax.swing.JPanel[null.contentPane,0,0,0x0,invalid,layout=javax.swing.JRootPane$1,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
UIColor[r=242, g=242,b=242,a=000]
false
--
javax.swing.JLayeredPane[null.layeredPane,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,optimizedDrawingPossible=true]
UIColor[r=242, g=242,b=242]
false
--
javax.swing.JRootPane[,0,0,0x0,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=]
UIColor[r=242, g=242,b=242]
true
--
javax.swing.Popup$HeavyWeightWindow[win1,809,1358,1x1,invalid,hidden,layout=java.awt.BorderLayout,rootPaneCheckingEnabled=true]
java.awt.SystemColor[i=7]
true
--
javax.swing.JFrame[frame0,601,1242,337x296,invalid,layout=java.awt.BorderLayout,title=ToolTip Demo,resizable,normal,defaultCloseOperation=EXIT_ON_CLOSE,rootPane=javax.swing.JRootPane[,6,43,325x247,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=com.github.weisj.darklaf.ui.rootpane.DarkRootPaneBorder@1145ecf,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
java.awt.SystemColor[i=7]
true This part when I press control+f1 (tooltip is shown) --
javax.swing.JToolTip[,0,0,1x1,invalid,alignmentX=0.0,alignmentY=0.0,border=com.github.weisj.darklaf.ui.tooltip.DarkTooltipBorder@73db22ba,flags=16777224,maximumSize=,minimumSize=,preferredSize=,tipText=<html><p style="color:red;">This is the ToolTip demo text!<br><p style="color:blue;">This is the ToolTip demo text!<br><p style="color:green;">This is the ToolTip demo text!<br></html>]
UIColor[r=247, g=247,b=247]
true
--
javax.swing.JPanel[null.contentPane,0,0,0x0,invalid,layout=javax.swing.JRootPane$1,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
UIColor[r=242, g=242,b=242,a=000]
false
--
javax.swing.JLayeredPane[null.layeredPane,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,optimizedDrawingPossible=true]
UIColor[r=242, g=242,b=242]
false
--
javax.swing.JRootPane[,0,0,0x0,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=]
UIColor[r=242, g=242,b=242]
true
--
javax.swing.Popup$HeavyWeightWindow[win3,716,1356,1x1,invalid,hidden,layout=java.awt.BorderLayout,rootPaneCheckingEnabled=true]
java.awt.SystemColor[i=7]
true
--
javax.swing.JFrame[frame0,601,1242,337x296,invalid,layout=java.awt.BorderLayout,title=ToolTip Demo,resizable,normal,defaultCloseOperation=EXIT_ON_CLOSE,rootPane=javax.swing.JRootPane[,6,43,325x247,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=com.github.weisj.darklaf.ui.rootpane.DarkRootPaneBorder@1145ecf,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
java.awt.SystemColor[i=7]
true |
@x4e For the opacity issue please try to check out the linux/tooltip branch. As for the tooltip not being displayed sometimes you might want to try to set |
@x4e I have published the linux/tooltip branch. It can be tested using |
Thank You! That works a lot better. |
I just released another snapshot version for the GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
AffineTransform transform = gc.getDefaultTransform();
System.out.println(gc);
System.out.println(gc.getDefaultScreenDevice());
System.out.println(transform); Also which java version are you using? |
OpenJDK 15.0.1 To make your code run I had to change it to the following (I believe it has the intended functionality): var gs = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
var gc = gs.getDefaultConfiguration();
System.out.println(gc);
System.out.println(gs);
System.out.println(gc.getDefaultTransform()); And the output is:
Video of tooltips in latest update: https://youtu.be/qcaXepwhWRY |
Does TooltipTest fail for you with the |
@x4e the new snapshot version |
Positioning also shouldn't be an issue anymore. |
Thank you so much! It works perfectly now. It's great to be able to maintain a project like this on so many different operating systems. |
@weisJ This bug seems to still be appearing on Linux.
![image](https://user-images.githubusercontent.com/53862811/100724186-8304de00-33ba-11eb-83c8-705199ba6514.png)
I'm on Arch Linux x86_64 (5.9.8-arch1-1).
It also seems to be incredibly hard to activate tooltips. They don't appear after hovering, but can in some circumstances be triggered with control + f1, however this is very hard to trigger.
Originally posted by @x4e in #180 (comment)
The text was updated successfully, but these errors were encountered: