[goffice] GOActionColorCombo: don't show arrow in vertical mode.



commit 2567bda5426f1bebc1d2fd91c5ace16b20f99f64
Author: Morten Welinder <terra gnome org>
Date:   Fri Apr 19 10:39:11 2013 -0400

    GOActionColorCombo: don't show arrow in vertical mode.

 ChangeLog                           |  4 ++++
 NEWS                                |  1 +
 goffice/gtk/go-action-combo-color.c | 18 +++++++++++++++++-
 3 files changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/ChangeLog b/ChangeLog
index e259233..a511a5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2013-04-19  Morten Welinder  <terra gnome org>
 
+       * goffice/gtk/go-action-combo-color.c
+       (go_action_combo_color_create_tool_item): Show arrow only in
+       horizontal mode.
+
        * goffice/gtk/go-combo-pixmaps.c (cb_preview_clicked): If arrow
        isn't shown, just pop up the choices.
 
diff --git a/NEWS b/NEWS
index 8354272..8489e0c 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Morten:
        * Plug leaks.
        * Enhance canvas with possibility of css.
        * Improve printing of grey patterns.
+       * Make narrow versions of combos for vertical toolbars.
 
 --------------------------------------------------------------------------
 goffice 0.10.1:
diff --git a/goffice/gtk/go-action-combo-color.c b/goffice/gtk/go-action-combo-color.c
index 390ef39..da21ef7 100644
--- a/goffice/gtk/go-action-combo-color.c
+++ b/goffice/gtk/go-action-combo-color.c
@@ -147,6 +147,18 @@ cb_proxy_custom_dialog (G_GNUC_UNUSED GObject *ignored,
                       dialog);
 }
 
+static void
+cb_toolbar_reconfigured (GOToolComboColor *tool)
+{
+       GtkOrientation o = gtk_tool_item_get_orientation (GTK_TOOL_ITEM (tool));
+       gboolean horiz = (o == GTK_ORIENTATION_HORIZONTAL);
+
+       g_object_set (G_OBJECT (tool->combo),
+                     "show-arrow", horiz,
+                     NULL);
+       go_combo_color_set_instant_apply (GO_COMBO_COLOR (tool->combo), horiz);
+}
+
 static GtkWidget *
 go_action_combo_color_create_tool_item (GtkAction *a)
 {
@@ -163,13 +175,17 @@ go_action_combo_color_create_tool_item (GtkAction *a)
                caction->color_group);
        if (icon) g_object_unref (icon);
 
-       go_combo_color_set_instant_apply (GO_COMBO_COLOR (tool->combo), TRUE);
        go_combo_color_set_allow_alpha (GO_COMBO_COLOR (tool->combo), caction->allow_alpha);
        go_combo_box_set_relief (GO_COMBO_BOX (tool->combo), GTK_RELIEF_NONE);
        title = get_title (a);
        go_combo_box_set_title (GO_COMBO_BOX (tool->combo), title);
        g_free (title);
 
+       g_signal_connect (tool, "toolbar-reconfigured",
+                         G_CALLBACK (cb_toolbar_reconfigured),
+                         NULL);
+       cb_toolbar_reconfigured (tool);
+
        go_gtk_widget_disable_focus (GTK_WIDGET (tool->combo));
        gtk_container_add (GTK_CONTAINER (tool), GTK_WIDGET (tool->combo));
        gtk_widget_show (GTK_WIDGET (tool->combo));


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