Make the Preferences more compact

This commit is contained in:
Christian Dywan 2008-09-11 01:49:01 +02:00
parent 2c1cdb0573
commit 04ad087d98

View file

@ -234,17 +234,19 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
preferences->notebook = gtk_notebook_new (); preferences->notebook = gtk_notebook_new ();
gtk_container_set_border_width (GTK_CONTAINER (preferences->notebook), 6); gtk_container_set_border_width (GTK_CONTAINER (preferences->notebook), 6);
sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); sizegroup = NULL;
#define PAGE_NEW(__label) page = gtk_vbox_new (FALSE, 0); \ #define PAGE_NEW(__label) page = gtk_vbox_new (FALSE, 0); \
gtk_container_set_border_width (GTK_CONTAINER (page), 5); \ if (sizegroup) g_object_unref (sizegroup); \
sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); \
gtk_container_set_border_width (GTK_CONTAINER (page), 4); \
gtk_notebook_append_page (GTK_NOTEBOOK (preferences->notebook), page, \ gtk_notebook_append_page (GTK_NOTEBOOK (preferences->notebook), page, \
gtk_label_new (__label)) gtk_label_new (__label))
#define FRAME_NEW(__label) frame = sokoke_hig_frame_new (__label); \ #define FRAME_NEW(__label) frame = sokoke_hig_frame_new (__label); \
gtk_container_set_border_width (GTK_CONTAINER (frame), 5); \ gtk_container_set_border_width (GTK_CONTAINER (frame), 4); \
gtk_box_pack_start (GTK_BOX (page), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (page), frame, FALSE, FALSE, 0);
#define TABLE_NEW(__rows, __cols) table = gtk_table_new ( \ #define TABLE_NEW(__rows, __cols) table = gtk_table_new ( \
__rows, __cols, FALSE); \ __rows, __cols, FALSE); \
gtk_container_set_border_width (GTK_CONTAINER (table), 5); \ gtk_container_set_border_width (GTK_CONTAINER (table), 4); \
gtk_container_add (GTK_CONTAINER (frame), table); gtk_container_add (GTK_CONTAINER (frame), table);
#define WIDGET_ADD(__widget, __left, __right, __top, __bottom) \ #define WIDGET_ADD(__widget, __left, __right, __top, __bottom) \
gtk_table_attach (GTK_TABLE (table), __widget \ gtk_table_attach (GTK_TABLE (table), __widget \
@ -333,7 +335,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
button = katze_property_proxy (settings, "enable-scripts", NULL); button = katze_property_proxy (settings, "enable-scripts", NULL);
INDENTED_ADD (button, 0, 1, 2, 3); INDENTED_ADD (button, 0, 1, 2, 3);
button = katze_property_proxy (settings, "enable-plugins", NULL); button = katze_property_proxy (settings, "enable-plugins", NULL);
SPANNED_ADD(button, 1, 2, 2, 3); SPANNED_ADD (button, 1, 2, 2, 3);
label = katze_property_label (settings, "user-stylesheet-uri"); label = katze_property_label (settings, "user-stylesheet-uri");
INDENTED_ADD (label, 0, 1, 3, 4); INDENTED_ADD (label, 0, 1, 3, 4);
hbox = gtk_hbox_new (FALSE, 4); hbox = gtk_hbox_new (FALSE, 4);
@ -375,7 +377,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
TABLE_NEW (3, 2); TABLE_NEW (3, 2);
INDENTED_ADD (katze_property_label (settings, "toolbar-style"), 0, 1, 0, 1); INDENTED_ADD (katze_property_label (settings, "toolbar-style"), 0, 1, 0, 1);
button = katze_property_proxy (settings, "toolbar-style", NULL); button = katze_property_proxy (settings, "toolbar-style", NULL);
FILLED_ADD(button, 1, 2, 0, 1); FILLED_ADD (button, 1, 2, 0, 1);
button = katze_property_proxy (settings, "show-new-tab", NULL); button = katze_property_proxy (settings, "show-new-tab", NULL);
INDENTED_ADD (button, 0, 1, 1, 2); INDENTED_ADD (button, 0, 1, 1, 2);
button = katze_property_proxy (settings, "show-web-search", NULL); button = katze_property_proxy (settings, "show-web-search", NULL);
@ -384,7 +386,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
INDENTED_ADD (button, 0, 1, 2, 3); INDENTED_ADD (button, 0, 1, 2, 3);
button = katze_property_proxy (settings, "show-trash", NULL); button = katze_property_proxy (settings, "show-trash", NULL);
SPANNED_ADD (button, 1, 2, 2, 3); SPANNED_ADD (button, 1, 2, 2, 3);
FRAME_NEW(_("Browsing")); FRAME_NEW (_("Browsing"));
TABLE_NEW (3, 2); TABLE_NEW (3, 2);
/* label = katze_property_label (settings, "open-new-pages-in"); /* label = katze_property_label (settings, "open-new-pages-in");
INDENTED_ADD (label, 0, 1, 0, 1); INDENTED_ADD (label, 0, 1, 0, 1);
@ -393,13 +395,13 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
button = katze_property_proxy (settings, "middle-click-opens-selection", NULL); button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
INDENTED_ADD (button, 0, 1, 1, 2); INDENTED_ADD (button, 0, 1, 1, 2);
button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL); button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL);
SPANNED_ADD (button, 1, 2, 1, 2); WIDGET_ADD (button, 1, 2, 1, 2);
/* button = katze_property_proxy (settings, "open-popups-in-tabs", NULL); /* button = katze_property_proxy (settings, "open-popups-in-tabs", NULL);
SPANNED_ADD (button, 0, 1, 2, 3);*/ SPANNED_ADD (button, 0, 1, 2, 3);*/
button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL); button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL);
SPANNED_ADD (button, 0, 1, 2, 3); WIDGET_ADD (button, 0, 1, 2, 3);
button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL); button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL);
SPANNED_ADD (button, 1, 2, 2, 3); WIDGET_ADD (button, 1, 2, 2, 3);
/* Page "Network" */ /* Page "Network" */
PAGE_NEW (_("Network")); PAGE_NEW (_("Network"));
@ -451,6 +453,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
button = katze_property_proxy (settings, "remember-last-downloaded-files", NULL); button = katze_property_proxy (settings, "remember-last-downloaded-files", NULL);
SPANNED_ADD (button, 0, 2, 2, 3); */ SPANNED_ADD (button, 0, 2, 2, 3); */
g_object_unref (sizegroup);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (preferences)->vbox), gtk_box_pack_start (GTK_BOX (GTK_DIALOG (preferences)->vbox),
preferences->notebook, FALSE, FALSE, 4); preferences->notebook, FALSE, FALSE, 4);
gtk_widget_show_all (GTK_DIALOG (preferences)->vbox); gtk_widget_show_all (GTK_DIALOG (preferences)->vbox);