[gnumeric] GUI: Save some vertical space for toolbars.



commit f87372fc920b739aff4e6e18487de866aa731905
Author: Morten Welinder <terra gnome org>
Date:   Wed Jan 29 19:01:18 2014 -0500

    GUI: Save some vertical space for toolbars.

 ChangeLog        |    2 ++
 NEWS             |    1 +
 src/gnumeric.css |    7 +++++++
 src/wbc-gtk.c    |   14 +++++++++++++-
 4 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9d90f10..9755a35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2014-01-29  Morten Welinder  <terra gnome org>
 
+       * src/wbc-gtk.c (wbc_gtk_init): Add style classes for toolbar zones.
+
        * src/item-cursor.c (cb_item_cursor_animation): Do a run-time
        check for bad clipping somewhere in gtk+ or theme land.
 
diff --git a/NEWS b/NEWS
index cce12cf..02089aa 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,7 @@ Morten:
        * Improve accuracy of R.DHYPER, R.DBINOM, R.DNBINOM, R.DPOIS,
          RAYLEIGH.
        * Minor theming improvement.  [#722074]
+       * Save some vertical space between toolbars.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.9
diff --git a/src/gnumeric.css b/src/gnumeric.css
index 9395757..713e364 100644
--- a/src/gnumeric.css
+++ b/src/gnumeric.css
@@ -228,3 +228,10 @@ GtkDialog#stf-import fixed-format-ruler {
 }
 
 /* ------------------------------------------------------------------------- */
+/* Extra space around multiple toolbars adds up quickly so avoid it. */
+
+GtkBox.toolbarzone GtkToolbar {
+  padding: 0;
+}
+
+/* ------------------------------------------------------------------------- */
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 6c23a18..2761dcf 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -4350,7 +4350,6 @@ cb_add_menus_toolbars (G_GNUC_UNUSED GtkUIManager *ui,
                int n = g_hash_table_size (wbcg->visibility_widgets);
                GtkWidget *vw;
                const struct ToolbarInfo *ti;
-
                GtkWidget *box;
                GtkPositionType pos = gnm_conf_get_toolbar_position (name);
 
@@ -5661,6 +5660,7 @@ wbc_gtk_init (GObject *obj)
        GError          *error = NULL;
        char            *uifile;
        unsigned         i;
+       GEnumClass      *posclass;
 
        wbcg->gui = gnm_gtk_builder_load ("wbcg.ui", NULL, NULL);
        wbcg->cancel_button = GET_GUI_ITEM ("cancel_button");
@@ -5681,6 +5681,18 @@ wbc_gtk_init (GObject *obj)
        wbcg->toolbar_zones[GTK_POS_RIGHT] = GET_GUI_ITEM ("toolbar_zone_right");
        wbcg->updating_ui = FALSE;
 
+       posclass = G_ENUM_CLASS (g_type_class_peek (gtk_position_type_get_type ()));
+       for (i = 0; i < posclass->n_values; i++) {
+               GEnumValue const *ev = posclass->values + i;
+               GtkWidget *zone = wbcg->toolbar_zones[ev->value];
+               GtkStyleContext *ctxt;
+               if (!zone)
+                       continue;
+               ctxt = gtk_widget_get_style_context (zone);
+               gtk_style_context_add_class (ctxt, "toolbarzone");
+               gtk_style_context_add_class (ctxt, ev->value_nick);
+       }
+
        wbcg->visibility_widgets = g_hash_table_new_full (g_str_hash,
                g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)g_object_unref);
        wbcg->undo_for_fullscreen = NULL;


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