Commit 7e22b46c authored by Cosimo Cecchi's avatar Cosimo Cecchi

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.
parent d324a994
......@@ -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
......
......@@ -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);
......
......@@ -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,
......
......@@ -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:
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment