[goffice] GOComboBox: improve css styling ability a bit
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] GOComboBox: improve css styling ability a bit
- Date: Fri, 21 Jan 2022 01:46:28 +0000 (UTC)
commit 86dcb277297d26e5a215f280198f73e0c81a1824
Author: Morten Welinder <terra gnome org>
Date: Thu Jan 20 20:45:50 2022 -0500
GOComboBox: improve css styling ability a bit
Also, make the arrow match that of GtkComboBox.
goffice/gtk/go-combo-box.c | 8 +++++++-
goffice/gtk/go-combo-pixmaps.c | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/goffice/gtk/go-combo-box.c b/goffice/gtk/go-combo-box.c
index e37b6538..fcc5ce61 100644
--- a/goffice/gtk/go-combo-box.c
+++ b/goffice/gtk/go-combo-box.c
@@ -336,6 +336,10 @@ go_combo_box_class_init (GObjectClass *object_class)
G_PARAM_READABLE));
widget_class->style_set = go_combo_box_style_set;
+#ifdef HAVE_GTK_WIDGET_CLASS_SET_CSS_NAME
+ gtk_widget_class_set_css_name (widget_class, "gocombobox");
+#endif
+
go_combo_box_signals [POP_DOWN_DONE] = g_signal_new (
"pop_down_done",
G_OBJECT_CLASS_TYPE (object_class),
@@ -611,10 +615,12 @@ go_combo_box_init (GOComboBox *combo_box)
combo_box->priv->show_arrow = TRUE;
combo_box->priv->arrow_button = gtk_toggle_button_new ();
+ gtk_widget_set_name (combo_box->priv->arrow_button, "arrow");
gtk_button_set_relief (GTK_BUTTON (combo_box->priv->arrow_button), GTK_RELIEF_NONE);
gtk_widget_set_can_focus (combo_box->priv->arrow_button, FALSE);
- arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
+ arrow = gtk_image_new_from_icon_name ("pan-down", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gtk_widget_set_name (arrow, "arrow");
gtk_container_add (GTK_CONTAINER (combo_box->priv->arrow_button), arrow);
gtk_box_pack_end (GTK_BOX (combo_box), combo_box->priv->arrow_button, FALSE, FALSE, 0);
g_signal_connect_swapped (combo_box->priv->arrow_button,
diff --git a/goffice/gtk/go-combo-pixmaps.c b/goffice/gtk/go-combo-pixmaps.c
index 60ee78e5..7aa6ed73 100644
--- a/goffice/gtk/go-combo-pixmaps.c
+++ b/goffice/gtk/go-combo-pixmaps.c
@@ -122,6 +122,7 @@ go_combo_pixmaps_init (GOComboPixmaps *combo)
combo->grid = g_object_ref (gtk_grid_new ());
combo->preview_button = gtk_toggle_button_new ();
+ gtk_widget_set_name (combo->preview_button, "preview");
combo->preview_image = gtk_image_new ();
gtk_container_add (GTK_CONTAINER (combo->preview_button),
GTK_WIDGET (combo->preview_image));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]