Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2695,14 +2695,25 @@ void updateCss() {
// Deal with background
if (background != null) {
final String colorString = display.gtk_rgba_to_css_string(background);
GdkRGBA menuBackground = new GdkRGBA();
menuBackground.red = background.red;
menuBackground.green = background.green;
menuBackground.blue = background.blue;
menuBackground.alpha = 1.0;
/* Ensures that the popup menu is not transparent and as a result unreadable
* This way effects like "light" transparency (alpha > 0.85) can not be achieved.
* Having any transparency of the popup is generally unwanted as it hurts visibility so
* if such a feature is usable to anyone it would need new dedicated API.
*/
final String menuColorString = display.gtk_rgba_to_css_string(menuBackground);

/*
* Use 'background:' instead of 'background-color:' to also override
* any 'background-image:'. For example, Ubuntu's Yaru theme has
* 'background-image:' for 'GtkToggleButton' used in READ_ONLY combo.
*/
css.append("* {background: " + colorString + ";}\n");
css.append("menu {background: " + colorString + ";}\n");
css.append("menu {background: " + menuColorString + ";}\n");

/*
* Setting background color for '*' also affects selection background,
Expand Down
Loading