Community
Participate
Working Groups
Currently, the ToolItem widget does not support setting its background. AFAICS, "normal" items have a transparent background so they inherit the background of the containing ToolBar. But when it comes to selection (either because of hovering or a radio-button-like selected state), the background changes without having the possibility to specify how. This leads to varying behavior for different OSes. For example, GTK highlights the button (which leads to unreadable text in the Dark Theme), while Cocoa adds a black semi-transparent layer on top of the item. We should add API to be able to style at least the selected state, better even: add possibilities to style also the regular background, text color, and selection border color.
Good point there. As a code-note: For Gtk, I'd recommend to set 'background' as oppose to 'background-image' as background-image doesn't seem to be well supported by all widgets with all themes. e.g (not tested.. gtk3...) setBackgroundColor(... GdkRGB rgba) { String css ="* {\n"; if (rgba != null) { String color = gtk_rgba_to_css_string (rgba); css += "background: " + color + ";\n"; } css += "}\n"; gtk_css_provider_load_from_css (context, css);
It's technically possible on Gtk3. (Not sure about gtk2). Can this be done on Win32/Cocoa?
We are past API freeze for 4.6, moving bug to the 4.7 list.
We are past API freeze for 4.7, moving out of 4.7.
(In reply to Leo Ufimtsev from comment #1) > Good point there. > > As a code-note: > For Gtk, I'd recommend to set 'background' as oppose to 'background-image' > as background-image doesn't seem to be well supported by all widgets with > all themes. > > e.g (not tested.. gtk3...) > setBackgroundColor(... GdkRGB rgba) { > String css ="* {\n"; > if (rgba != null) { > String color = gtk_rgba_to_css_string (rgba); > css += "background: " + color + ";\n"; > } > css += "}\n"; > gtk_css_provider_load_from_css (context, css); Hey Leo, is your suggestion a viable patch? Perhaps you can post and I can test it to see if its a feasible addition for 4.8
(In reply to Ian Pun from comment #5) > Hey Leo, > > is your suggestion a viable patch? Perhaps you can post and I can test it to > see if its a feasible addition for 4.8 Maybe. My todo list at the moment is kinda long. Wouldn't get to this any time soon if at all.
(In reply to Leo Ufimtsev from comment #6) > (In reply to Ian Pun from comment #5) > > Hey Leo, > > > > is your suggestion a viable patch? Perhaps you can post and I can test it to > > see if its a feasible addition for 4.8 > > Maybe. My todo list at the moment is kinda long. Wouldn't get to this any > time soon if at all. I would be willing to work on this once I return to work full time.
(In reply to Eric Williams from comment #7) > I would be willing to work on this once I return to work full time. Any news on this one? Would be a great addition to the API in general, not just for the dark theme. :)