[goffice] GOComboCox: Add class stack/text/pixmaps to toolitem.



commit f9441c02268387bbd00ba7ce64e0bac803fe685c
Author: Morten Welinder <terra gnome org>
Date:   Sat Jan 22 18:12:13 2022 -0500

    GOComboCox: Add class stack/text/pixmaps to toolitem.
    
    That allows finer styling control.

 goffice/gtk/go-action-combo-pixmaps.c | 4 ++++
 goffice/gtk/go-action-combo-stack.c   | 7 ++++++-
 goffice/gtk/go-action-combo-text.c    | 4 ++++
 3 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/goffice/gtk/go-action-combo-pixmaps.c b/goffice/gtk/go-action-combo-pixmaps.c
index 775f1f82..6fdc9967 100644
--- a/goffice/gtk/go-action-combo-pixmaps.c
+++ b/goffice/gtk/go-action-combo-pixmaps.c
@@ -168,6 +168,10 @@ go_action_combo_pixmaps_create_tool_item (GtkAction *a)
 {
        GOActionComboPixmaps *paction = (GOActionComboPixmaps *)a;
        GOToolComboPixmaps *tool = g_object_new (GO_TYPE_TOOL_COMBO_PIXMAPS, NULL);
+       GtkStyleContext *context;
+
+       context = gtk_widget_get_style_context (GTK_WIDGET (tool));
+        gtk_style_context_add_class (context, "pixmaps");
 
        tool->combo = go_combo_pixmaps_new (paction->ncols);
 
diff --git a/goffice/gtk/go-action-combo-stack.c b/goffice/gtk/go-action-combo-stack.c
index 956864d1..f6e59810 100644
--- a/goffice/gtk/go-action-combo-stack.c
+++ b/goffice/gtk/go-action-combo-stack.c
@@ -126,10 +126,15 @@ go_action_combo_stack_create_tool_item (GtkAction *a)
        GOToolComboStack *tool = g_object_new (GO_TYPE_TOOL_COMBO_STACK, NULL);
        gboolean is_sensitive = goacs_count (saction) > 0;
        GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
+       GtkStyleContext *context;
+
+       context = gtk_widget_get_style_context (GTK_WIDGET (tool));
+        gtk_style_context_add_class (context, "stack");
 
        tool->combo = gtk_combo_box_new_with_model (saction->model);
        gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (tool->combo), renderer, FALSE);
-       gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (tool->combo), renderer, "text", 0);
+       gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (tool->combo),
+                                      renderer, "text", LABEL_COL);
 
        g_signal_connect (tool, "toolbar-reconfigured",
                          G_CALLBACK (cb_reconfig), a);
diff --git a/goffice/gtk/go-action-combo-text.c b/goffice/gtk/go-action-combo-text.c
index 5a87217e..b589b3b2 100644
--- a/goffice/gtk/go-action-combo-text.c
+++ b/goffice/gtk/go-action-combo-text.c
@@ -98,6 +98,10 @@ go_action_combo_text_create_tool_item (GtkAction *act)
        GtkEntry *entry;
        GSList *ptr;
        int w = -1;
+       GtkStyleContext *context;
+
+       context = gtk_widget_get_style_context (GTK_WIDGET (tool));
+        gtk_style_context_add_class (context, "text");
 
        if (taction->largest_elem != NULL)
                w = g_utf8_strlen (taction->largest_elem, -1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]