I spent few hours searching on google and I gave up now...
I need to change background for popup menu in my app. It set to whatever system default theme is... and I need this to be set to Radiance for all the time.
any ideas how to achieve this?
I spent few hours searching on google and I gave up now...
I need to change background for popup menu in my app. It set to whatever system default theme is... and I need this to be set to Radiance for all the time.
any ideas how to achieve this?
I theme my popup windows like so:
#Use Css themes
css = Gtk.CssProvider()
css.load_from_data("""
.popup {background-color: rgba(0,0,0,0); border: 0px rgba(255,255,255,0); border-radius: 14px; border-width: 0; }
"""
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), css,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
#Get popup parent and set rgba visual so I can do transparency
pwindow=self.popup.get_parent()
screen=pwindow.get_screen()
pwindow.set_visual(screen.get_rgba_visual())
#Give popups the popup CSS class
self.popup.get_style_context().add_class('popup')
I also use cairo to draw the popup window and give it a nice texture. To do that I just connect its 'draw' signal to a call back.
I would look at the Radiance Gtk theme to find out what the background color is and use that for the background-color css setting. You can find it in /usr/share/themes/Radiance/Gtk-3.0/gtk.css
. If you don't need transparency, then skip the pwindow stuff above and just add the style_context to your popup.