File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2695,14 +2695,25 @@ void updateCss() {
26952695 // Deal with background
26962696 if (background != null ) {
26972697 final String colorString = display .gtk_rgba_to_css_string (background );
2698+ GdkRGBA menuBackground = new GdkRGBA ();
2699+ menuBackground .red = background .red ;
2700+ menuBackground .green = background .green ;
2701+ menuBackground .blue = background .blue ;
2702+ menuBackground .alpha = 1.0 ;
2703+ /* Ensures that the popup menu is not transparent and as a result unreadable
2704+ * This way effects like "light" transparency (alpha > 0.85) can not be achieved.
2705+ * Having any transparency of the popup is generally unwanted as it hurts visibility so
2706+ * if such a feature is usable to anyone it would need new dedicated API.
2707+ */
2708+ final String menuColorString = display .gtk_rgba_to_css_string (menuBackground );
26982709
26992710 /*
27002711 * Use 'background:' instead of 'background-color:' to also override
27012712 * any 'background-image:'. For example, Ubuntu's Yaru theme has
27022713 * 'background-image:' for 'GtkToggleButton' used in READ_ONLY combo.
27032714 */
27042715 css .append ("* {background: " + colorString + ";}\n " );
2705- css .append ("menu {background: " + colorString + ";}\n " );
2716+ css .append ("menu {background: " + menuColorString + ";}\n " );
27062717
27072718 /*
27082719 * Setting background color for '*' also affects selection background,
You can’t perform that action at this time.
0 commit comments