combobox: add a "combobox-entry" style class for comboboxes with entries

This way themes can use GtkComboBox.combobox-entry to match that
specific case, and GtkComboBox.combobox-entry .button to match the
button/arrow side of the widget.
This commit is contained in:
Cosimo Cecchi 2011-08-09 15:32:21 +02:00
parent d324a99454
commit 7e22b46c1f
4 changed files with 15 additions and 0 deletions

View File

@ -5530,6 +5530,7 @@ GTK_STYLE_CLASS_BACKGROUND
GTK_STYLE_CLASS_BUTTON
GTK_STYLE_CLASS_CALENDAR
GTK_STYLE_CLASS_CELL
GTK_STYLE_CLASS_COMBOBOX_ENTRY
GTK_STYLE_CLASS_CHECK
GTK_STYLE_CLASS_DEFAULT
GTK_STYLE_CLASS_ENTRY

View File

@ -4591,11 +4591,15 @@ gtk_combo_box_constructor (GType type,
if (priv->has_entry)
{
GtkWidget *entry;
GtkStyleContext *context;
entry = gtk_entry_new ();
gtk_widget_show (entry);
gtk_container_add (GTK_CONTAINER (combo_box), entry);
context = gtk_widget_get_style_context (GTK_WIDGET (combo_box));
gtk_style_context_add_class (context, GTK_STYLE_CLASS_COMBOBOX_ENTRY);
priv->text_renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box),
priv->text_renderer, TRUE);

View File

@ -181,6 +181,7 @@
* #GTK_STYLE_CLASS_CELL,
* #GTK_STYLE_CLASS_ENTRY,
* #GTK_STYLE_CLASS_BUTTON,
* #GTK_STYLE_CLASS_COMBOBOX_ENTRY,
* #GTK_STYLE_CLASS_CALENDAR,
* #GTK_STYLE_CLASS_SLIDER,
* #GTK_STYLE_CLASS_BACKGROUND,

View File

@ -170,6 +170,15 @@ struct _GtkStyleContextClass
*/
#define GTK_STYLE_CLASS_ENTRY "entry"
/**
* GTK_STYLE_CLASS_COMBOBOX_ENTRY:
*
* A CSS class to match combobox entries.
*
* This is used by #GtkComboBox.
*/
#define GTK_STYLE_CLASS_COMBOBOX_ENTRY "combobox-entry"
/**
* GTK_STYLE_CLASS_BUTTON:
*