[Xfce4-commits] <midori:master> Implement "Small icons" toolbar style and preference

Christian Dywan noreply at xfce.org
Tue Nov 17 19:22:03 CET 2009


Updating branch refs/heads/master
         to d154158d0c8afb2f8237251e314b2903cff911a5 (commit)
       from f9f433433e305d3c5f2128803049d2b5731445c2 (commit)

commit d154158d0c8afb2f8237251e314b2903cff911a5
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Nov 17 18:49:14 2009 +0100

    Implement "Small icons" toolbar style and preference

 midori/midori-browser.c     |    6 ++++++
 midori/midori-websettings.c |    1 +
 midori/midori-websettings.h |    1 +
 3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 8b4f143..6c9552f 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -5936,9 +5936,12 @@ _midori_browser_set_toolbar_style (MidoriBrowser*     browser,
 {
     #if HAVE_HILDON
     GtkToolbarStyle gtk_toolbar_style = GTK_TOOLBAR_ICONS;
+    GtkIconSize icon_size = GTK_ICON_SIZE_LARGE_TOOLBAR;
     #else
     GtkToolbarStyle gtk_toolbar_style;
+    GtkIconSize icon_size;
     GtkSettings* gtk_settings = gtk_widget_get_settings (GTK_WIDGET (browser));
+    g_object_get (gtk_settings, "gtk-toolbar-icon-size", &icon_size, NULL);
     if (toolbar_style == MIDORI_TOOLBAR_DEFAULT && gtk_settings)
     #ifdef G_OS_WIN32
         gtk_toolbar_style = GTK_TOOLBAR_ICONS;
@@ -5949,6 +5952,8 @@ _midori_browser_set_toolbar_style (MidoriBrowser*     browser,
     {
         switch (toolbar_style)
         {
+        case MIDORI_TOOLBAR_SMALL_ICONS:
+            icon_size = GTK_ICON_SIZE_SMALL_TOOLBAR;
         case MIDORI_TOOLBAR_ICONS:
             gtk_toolbar_style = GTK_TOOLBAR_ICONS;
             break;
@@ -5966,6 +5971,7 @@ _midori_browser_set_toolbar_style (MidoriBrowser*     browser,
     #endif
     gtk_toolbar_set_style (GTK_TOOLBAR (browser->navigationbar),
                            gtk_toolbar_style);
+    gtk_toolbar_set_icon_size (GTK_TOOLBAR (browser->navigationbar), icon_size);
 }
 
 static gboolean
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index eeefba4..807a0ee 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -252,6 +252,7 @@ midori_toolbar_style_get_type (void)
         static const GEnumValue values[] = {
          { MIDORI_TOOLBAR_DEFAULT, "MIDORI_TOOLBAR_DEFAULT", N_("Default") },
          { MIDORI_TOOLBAR_ICONS, "MIDORI_TOOLBAR_ICONS", N_("Icons") },
+         { MIDORI_TOOLBAR_SMALL_ICONS, "MIDORI_TOOLBAR_SMALL_ICONS", N_("Small icons") },
          { MIDORI_TOOLBAR_TEXT, "MIDORI_TOOLBAR_TEXT", N_("Text") },
          { MIDORI_TOOLBAR_BOTH, "MIDORI_TOOLBAR_BOTH", N_("Icons and text") },
          { MIDORI_TOOLBAR_BOTH_HORIZ, "MIDORI_TOOLBAR_BOTH_HORIZ", N_("Text beside icons") },
diff --git a/midori/midori-websettings.h b/midori/midori-websettings.h
index b219c5f..b52a782 100644
--- a/midori/midori-websettings.h
+++ b/midori/midori-websettings.h
@@ -106,6 +106,7 @@ typedef enum
 {
     MIDORI_TOOLBAR_DEFAULT,
     MIDORI_TOOLBAR_ICONS,
+    MIDORI_TOOLBAR_SMALL_ICONS,
     MIDORI_TOOLBAR_TEXT,
     MIDORI_TOOLBAR_BOTH,
     MIDORI_TOOLBAR_BOTH_HORIZ



More information about the Xfce4-commits mailing list