Implement "Small icons" toolbar style and preference

This commit is contained in:
Christian Dywan 2009-11-17 18:49:14 +01:00
parent f9f433433e
commit d154158d0c
3 changed files with 8 additions and 0 deletions

View file

@ -5936,9 +5936,12 @@ _midori_browser_set_toolbar_style (MidoriBrowser* browser,
{ {
#if HAVE_HILDON #if HAVE_HILDON
GtkToolbarStyle gtk_toolbar_style = GTK_TOOLBAR_ICONS; GtkToolbarStyle gtk_toolbar_style = GTK_TOOLBAR_ICONS;
GtkIconSize icon_size = GTK_ICON_SIZE_LARGE_TOOLBAR;
#else #else
GtkToolbarStyle gtk_toolbar_style; GtkToolbarStyle gtk_toolbar_style;
GtkIconSize icon_size;
GtkSettings* gtk_settings = gtk_widget_get_settings (GTK_WIDGET (browser)); 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) if (toolbar_style == MIDORI_TOOLBAR_DEFAULT && gtk_settings)
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
gtk_toolbar_style = GTK_TOOLBAR_ICONS; gtk_toolbar_style = GTK_TOOLBAR_ICONS;
@ -5949,6 +5952,8 @@ _midori_browser_set_toolbar_style (MidoriBrowser* browser,
{ {
switch (toolbar_style) switch (toolbar_style)
{ {
case MIDORI_TOOLBAR_SMALL_ICONS:
icon_size = GTK_ICON_SIZE_SMALL_TOOLBAR;
case MIDORI_TOOLBAR_ICONS: case MIDORI_TOOLBAR_ICONS:
gtk_toolbar_style = GTK_TOOLBAR_ICONS; gtk_toolbar_style = GTK_TOOLBAR_ICONS;
break; break;
@ -5966,6 +5971,7 @@ _midori_browser_set_toolbar_style (MidoriBrowser* browser,
#endif #endif
gtk_toolbar_set_style (GTK_TOOLBAR (browser->navigationbar), gtk_toolbar_set_style (GTK_TOOLBAR (browser->navigationbar),
gtk_toolbar_style); gtk_toolbar_style);
gtk_toolbar_set_icon_size (GTK_TOOLBAR (browser->navigationbar), icon_size);
} }
static gboolean static gboolean

View file

@ -252,6 +252,7 @@ midori_toolbar_style_get_type (void)
static const GEnumValue values[] = { static const GEnumValue values[] = {
{ MIDORI_TOOLBAR_DEFAULT, "MIDORI_TOOLBAR_DEFAULT", N_("Default") }, { MIDORI_TOOLBAR_DEFAULT, "MIDORI_TOOLBAR_DEFAULT", N_("Default") },
{ MIDORI_TOOLBAR_ICONS, "MIDORI_TOOLBAR_ICONS", N_("Icons") }, { 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_TEXT, "MIDORI_TOOLBAR_TEXT", N_("Text") },
{ MIDORI_TOOLBAR_BOTH, "MIDORI_TOOLBAR_BOTH", N_("Icons and text") }, { MIDORI_TOOLBAR_BOTH, "MIDORI_TOOLBAR_BOTH", N_("Icons and text") },
{ MIDORI_TOOLBAR_BOTH_HORIZ, "MIDORI_TOOLBAR_BOTH_HORIZ", N_("Text beside icons") }, { MIDORI_TOOLBAR_BOTH_HORIZ, "MIDORI_TOOLBAR_BOTH_HORIZ", N_("Text beside icons") },

View file

@ -106,6 +106,7 @@ typedef enum
{ {
MIDORI_TOOLBAR_DEFAULT, MIDORI_TOOLBAR_DEFAULT,
MIDORI_TOOLBAR_ICONS, MIDORI_TOOLBAR_ICONS,
MIDORI_TOOLBAR_SMALL_ICONS,
MIDORI_TOOLBAR_TEXT, MIDORI_TOOLBAR_TEXT,
MIDORI_TOOLBAR_BOTH, MIDORI_TOOLBAR_BOTH,
MIDORI_TOOLBAR_BOTH_HORIZ MIDORI_TOOLBAR_BOTH_HORIZ