Styling dropdown menu of cellrenderercombo

Hi I am trying to style the dropdown menu of a cellrenderercombo
I have worked out that I need to use css for menuitem, and I can change the background color and color, but this wipes out highlight (no change when the mouse is over an entry in the list)
two questions

  1. what properties do I need to access to alter the “highlighted” node of the dropdown list
    ie: the entry that the mouse is over
  2. Is it possible to apply the style to only certain widgets? I have tried menuitem#, but it doesnn’t seem to work



So is it a bug that prelight is ignored? ie:

menuitem.prelight {padding:0px;background:white;color:black} (ignored totally)

this works

menuitem {padding:0px;background:rgba(0,0,0,0.2);color:black;}

in the same array passed to

foreach my $pd (@css){
	my $p = Gtk3::CssProvider->new; 
	$p->load_from_data ($pd);
	Gtk3::StyleContext::add_provider_for_screen ($s, $p, Gtk3::STYLE_PROVIDER_PRIORITY_USER); 

But obviously isn’t what I want

I’m not sure what made you think that the .prelight class is applied to a menu item with the pointer hovering over it. I think you’re confusing GTK2 theming with GTK3 CSS. When hovering the :hover pseudoclass is applied to a widget, just like on the web. At most, GTK3 supports the :prelight pseudoclass, but the CSS selector for that would be menuitem:prelight, not menuitem.prelight. In any case, :prelight is deprecated, and has been removed in GTK4.

You should read the CSS documentation for GTK3 to know which selectors are applied to a widget; additionally, every widget class in the API reference should have its classes and elements documented in its description.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.