Some kind of documentation of option_button_type. Ideally, we'll be using an enum here in future.

svn path=/trunk/netsurf/; revision=7148
This commit is contained in:
John Mark Bell 2009-04-21 10:47:24 +00:00
parent b648e36dc1
commit e7df2e1fb8

View File

@ -1256,7 +1256,8 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
} else {
gtk_window_set_default_size(g->window, 600, 600);
}
/* Default toolbar button type uses system defaults */
if (option_button_type == 0) {
GtkSettings *settings = gtk_settings_get_default();
GtkIconSize tooliconsize;
@ -1274,32 +1275,35 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
break;
case GTK_TOOLBAR_BOTH:
case GTK_TOOLBAR_BOTH_HORIZ:
default:
option_button_type = 3;
break;
break;
default:
/* No system default, so use large icons */
option_button_type = 2;
break;
}
}
switch (option_button_type) {
case 1:
case 1: /* Small icons */
gtk_toolbar_set_style(GTK_TOOLBAR(g->tool_bar),
GTK_TOOLBAR_ICONS);
gtk_toolbar_set_icon_size(GTK_TOOLBAR(g->tool_bar),
GTK_ICON_SIZE_SMALL_TOOLBAR);
break;
case 2:
case 2: /* Large icons */
gtk_toolbar_set_style(GTK_TOOLBAR(g->tool_bar),
GTK_TOOLBAR_ICONS);
gtk_toolbar_set_icon_size(GTK_TOOLBAR(g->tool_bar),
GTK_ICON_SIZE_LARGE_TOOLBAR);
break;
case 3:
case 3: /* Large icons with text */
gtk_toolbar_set_style(GTK_TOOLBAR(g->tool_bar),
GTK_TOOLBAR_BOTH);
gtk_toolbar_set_icon_size(GTK_TOOLBAR(g->tool_bar),
GTK_ICON_SIZE_LARGE_TOOLBAR);
break;
case 4:
case 4: /* Text icons only */
gtk_toolbar_set_style(GTK_TOOLBAR(g->tool_bar),
GTK_TOOLBAR_TEXT);
default: