Support changing style of toolbars.
authorHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Fri, 28 Mar 2008 23:38:06 +0000 (23:38 +0000)
committerHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Fri, 28 Mar 2008 23:38:06 +0000 (23:38 +0000)
Update translation.

demo.glade
lxappearance.glade
po/zh_TW.po
src/demo-ui.c
src/demo-ui.patch
src/demo.c
src/main-dlg-ui.c
src/main-dlg.c
src/main-dlg.h
src/main.c

index 5d7c34a..d0f0022 100644 (file)
          <property name="snap_edge">GTK_POS_TOP</property>
 
          <child>
-           <widget class="GtkToolbar" id="toolbar1">
+           <widget class="GtkToolbar" id="toolbar">
              <property name="visible">True</property>
              <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
              <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
                  <property name="stock_id">gtk-go-back</property>
                  <property name="visible_horizontal">True</property>
                  <property name="visible_vertical">True</property>
-                 <property name="is_important">False</property>
+                 <property name="is_important">True</property>
                </widget>
                <packing>
                  <property name="expand">False</property>
                  <property name="stock_id">gtk-stop</property>
                  <property name="visible_horizontal">True</property>
                  <property name="visible_vertical">True</property>
-                 <property name="is_important">False</property>
+                 <property name="is_important">True</property>
                </widget>
                <packing>
                  <property name="expand">False</property>
index 71091ed..bf13223 100644 (file)
              </child>
 
              <child>
-               <placeholder/>
+               <widget class="GtkVBox" id="vbox5">
+                 <property name="visible">True</property>
+                 <property name="homogeneous">False</property>
+                 <property name="spacing">4</property>
+
+                 <child>
+                   <widget class="GtkVBox" id="vbox6">
+                     <property name="border_width">4</property>
+                     <property name="visible">True</property>
+                     <property name="homogeneous">False</property>
+                     <property name="spacing">0</property>
+
+                     <child>
+                       <widget class="GtkLabel" id="label19">
+                         <property name="visible">True</property>
+                         <property name="label" translatable="yes">Toolbar Style: </property>
+                         <property name="use_underline">False</property>
+                         <property name="use_markup">False</property>
+                         <property name="justify">GTK_JUSTIFY_LEFT</property>
+                         <property name="wrap">False</property>
+                         <property name="selectable">False</property>
+                         <property name="xalign">0</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                         <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                         <property name="width_chars">-1</property>
+                         <property name="single_line_mode">False</property>
+                         <property name="angle">0</property>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">False</property>
+                         <property name="fill">False</property>
+                       </packing>
+                     </child>
+
+                     <child>
+                       <widget class="GtkComboBox" id="tb_style">
+                         <property name="visible">True</property>
+                         <property name="items" translatable="yes">Icons only
+Text only
+Text below icons
+Text beside icons</property>
+                         <property name="add_tearoffs">False</property>
+                         <property name="focus_on_click">True</property>
+                         <signal name="changed" handler="on_tb_style_changed" last_modification_time="Fri, 28 Mar 2008 16:33:18 GMT"/>
+                       </widget>
+                       <packing>
+                         <property name="padding">0</property>
+                         <property name="expand">True</property>
+                         <property name="fill">True</property>
+                       </packing>
+                     </child>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">False</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <placeholder/>
+                 </child>
+               </widget>
+               <packing>
+                 <property name="tab_expand">False</property>
+                 <property name="tab_fill">True</property>
+               </packing>
              </child>
 
              <child>
index 7a81a28..bd60e6f 100644 (file)
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 0.1\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-03-27 23:59+0800\n"
-"PO-Revision-Date: 2008-03-28 00:00+0800\n"
+"POT-Creation-Date: 2008-03-28 23:41+0800\n"
+"PO-Revision-Date: 2008-03-28 23:43+0800\n"
 "Last-Translator: 洪任諭 <pcman.tw@gmail.com>\n"
 "Language-Team: zh_TW <LL@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -18,38 +18,70 @@ msgstr ""
 "X-Poedit-Country: TAIWAN\n"
 "X-Poedit-SourceCharset: iso-8859-1\n"
 
-#: src/main-dlg-ui.c:60
+#: src/main-dlg-ui.c:70
 msgid "Appearance Settings"
 msgstr "外觀設定"
 
-#: src/main-dlg-ui.c:78
+#: src/main-dlg-ui.c:88
 msgid "Available Window Themes"
 msgstr "可用的視窗佈景主題"
 
-#: src/main-dlg-ui.c:96
+#: src/main-dlg-ui.c:106
 msgid "_Font:"
 msgstr "字型"
 
-#: src/main-dlg-ui.c:108
+#: src/main-dlg-ui.c:118
 msgid "Window"
 msgstr "視窗"
 
-#: src/main-dlg-ui.c:116
+#: src/main-dlg-ui.c:126
 msgid "Available Icon Themes"
 msgstr "可用的圖示佈景主題"
 
-#: src/main-dlg-ui.c:131
+#: src/main-dlg-ui.c:162
+msgid "_Install"
+msgstr "安裝(_I)"
+
+#: src/main-dlg-ui.c:169
 msgid "Icon"
 msgstr "圖示"
 
-#: src/main-dlg-ui.c:139
+#: src/main-dlg-ui.c:182
+msgid "Toolbar Style: "
+msgstr "工具列樣式:"
+
+#: src/main-dlg-ui.c:190
+msgid "Icons only"
+msgstr "只顯示圖示"
+
+#: src/main-dlg-ui.c:191
+msgid "Text only"
+msgstr "只顯示文字"
+
+#: src/main-dlg-ui.c:192
+msgid "Text below icons"
+msgstr "文字在圖示下方"
+
+#: src/main-dlg-ui.c:193
+msgid "Text beside icons"
+msgstr "文字在圖示旁"
+
+#: src/main-dlg-ui.c:195
 msgid "Other"
 msgstr "其他"
 
-#: src/main-dlg-ui.c:147
+#: src/main-dlg-ui.c:203
 msgid "<b>Preview</b>"
 msgstr "<b>預覽</b>"
 
+#: src/main-dlg.c:324
+msgid "Select an icon theme"
+msgstr "選擇一個圖示佈景主題"
+
+#: src/main-dlg.c:331
+msgid "*.tar.gz, *.tar.bz2 (Icon Theme)"
+msgstr "*.tar.gz, *.tar.bz2 (圖示佈景主題)"
+
 #: src/demo-ui.c:116
 msgid "_File"
 msgstr "檔案(_F)"
index 428c70b..3c6de11 100644 (file)
@@ -50,7 +50,7 @@ create_demo_window (void)
   GtkWidget *menuitem4_menu;
   GtkWidget *about1;
   GtkWidget *handlebox1;
-  GtkWidget *toolbar1;
+  GtkWidget *toolbar;
   GtkIconSize tmp_toolbar_icon_size;
   GtkWidget *toolbutton1;
   GtkWidget *toolbutton2;
@@ -183,27 +183,29 @@ create_demo_window (void)
   gtk_widget_show (handlebox1);
   gtk_box_pack_start (GTK_BOX (top_vbox), handlebox1, FALSE, FALSE, 0);
 
-  toolbar1 = gtk_toolbar_new ();
-  gtk_widget_show (toolbar1);
-  gtk_container_add (GTK_CONTAINER (handlebox1), toolbar1);
-  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_BOTH);
-  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar1), FALSE);
-  tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));
+  toolbar = gtk_toolbar_new ();
+  gtk_widget_show (toolbar);
+  gtk_container_add (GTK_CONTAINER (handlebox1), toolbar);
+  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH);
+  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
+  tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar));
 
   toolbutton1 = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-go-back");
   gtk_widget_show (toolbutton1);
-  gtk_container_add (GTK_CONTAINER (toolbar1), toolbutton1);
+  gtk_container_add (GTK_CONTAINER (toolbar), toolbutton1);
   gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbutton1), tooltips, _("Back"), NULL);
+  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbutton1), TRUE);
 
   toolbutton2 = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-go-forward");
   gtk_widget_show (toolbutton2);
-  gtk_container_add (GTK_CONTAINER (toolbar1), toolbutton2);
+  gtk_container_add (GTK_CONTAINER (toolbar), toolbutton2);
   gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbutton2), tooltips, _("Forward"), NULL);
 
   toolbutton3 = (GtkWidget*) gtk_tool_button_new_from_stock ("gtk-stop");
   gtk_widget_show (toolbutton3);
-  gtk_container_add (GTK_CONTAINER (toolbar1), toolbutton3);
+  gtk_container_add (GTK_CONTAINER (toolbar), toolbutton3);
   gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolbutton3), tooltips, _("Stop"), NULL);
+  gtk_tool_item_set_is_important (GTK_TOOL_ITEM (toolbutton3), TRUE);
 
   notebook2 = gtk_notebook_new ();
   gtk_widget_show (notebook2);
@@ -388,7 +390,9 @@ create_demo_window (void)
   GLADE_HOOKUP_OBJECT (demo_window, menuitem4_menu, "menuitem4_menu");
   GLADE_HOOKUP_OBJECT (demo_window, about1, "about1");
   GLADE_HOOKUP_OBJECT (demo_window, handlebox1, "handlebox1");
-  GLADE_HOOKUP_OBJECT (demo_window, toolbar1, "toolbar1");
+*/
+  GLADE_HOOKUP_OBJECT (demo_window, toolbar, "toolbar");
+/*
   GLADE_HOOKUP_OBJECT (demo_window, toolbutton1, "toolbutton1");
   GLADE_HOOKUP_OBJECT (demo_window, toolbutton2, "toolbutton2");
   GLADE_HOOKUP_OBJECT (demo_window, toolbutton3, "toolbutton3");
index cd47a14..3f872f7 100644 (file)
@@ -1,6 +1,6 @@
---- demo-ui.c.orig     2008-03-27 23:13:31.000000000 +0800
-+++ demo-ui.c  2008-03-27 23:14:23.000000000 +0800
-@@ -92,14 +92,18 @@
+--- demo-ui.c.orig     2008-03-27 23:59:03.000000000 +0800
++++ demo-ui.c  2008-03-29 07:30:57.000000000 +0800
+@@ -96,14 +96,18 @@
    tooltips = gtk_tooltips_new ();
  
    accel_group = gtk_accel_group_new ();
@@ -21,7 +21,7 @@
  
    menubar1 = gtk_menu_bar_new ();
    gtk_widget_show (menubar1);
-@@ -340,6 +344,8 @@
+@@ -361,6 +365,8 @@
                      NULL);
  
    /* Store pointers to all widgets, for use by lookup_widget(). */
    GLADE_HOOKUP_OBJECT_NO_REF (demo_window, demo_window, "demo_window");
    GLADE_HOOKUP_OBJECT (demo_window, top_vbox, "top_vbox");
    GLADE_HOOKUP_OBJECT (demo_window, menubar1, "menubar1");
-@@ -367,7 +373,9 @@
+@@ -382,13 +388,17 @@
+   GLADE_HOOKUP_OBJECT (demo_window, menuitem4_menu, "menuitem4_menu");
+   GLADE_HOOKUP_OBJECT (demo_window, about1, "about1");
+   GLADE_HOOKUP_OBJECT (demo_window, handlebox1, "handlebox1");
++*/
+   GLADE_HOOKUP_OBJECT (demo_window, toolbar, "toolbar");
++/*
+   GLADE_HOOKUP_OBJECT (demo_window, toolbutton1, "toolbutton1");
+   GLADE_HOOKUP_OBJECT (demo_window, toolbutton2, "toolbutton2");
    GLADE_HOOKUP_OBJECT (demo_window, toolbutton3, "toolbutton3");
    GLADE_HOOKUP_OBJECT (demo_window, notebook2, "notebook2");
    GLADE_HOOKUP_OBJECT (demo_window, scrolledwindow4, "scrolledwindow4");
@@ -40,7 +48,7 @@
    GLADE_HOOKUP_OBJECT (demo_window, label12, "label12");
    GLADE_HOOKUP_OBJECT (demo_window, hbox2, "hbox2");
    GLADE_HOOKUP_OBJECT (demo_window, frame2, "frame2");
-@@ -391,13 +399,15 @@
+@@ -416,13 +426,15 @@
    GLADE_HOOKUP_OBJECT (demo_window, text_view, "text_view");
    GLADE_HOOKUP_OBJECT (demo_window, label14, "label14");
    GLADE_HOOKUP_OBJECT (demo_window, scrolledwindow6, "scrolledwindow6");
index 6ad28e3..35df6af 100644 (file)
@@ -47,6 +47,10 @@ void show_demo( GdkNativeWindow wid )
     GtkWidget* demo = create_demo_window();
     GtkWidget* plug = gtk_plug_new( wid );
     GtkWidget* top_vbox;
+    GtkToolbarStyle tb_style;
+
+    g_object_get( gtk_settings_get_default(), "gtk-toolbar-style", &tb_style, NULL );
+    gtk_toolbar_set_style (GTK_TOOLBAR (lookup_widget(demo, "toolbar")), tb_style );
 
     icon_view = lookup_widget( demo, "icon_view" );
     gtk_widget_show_all( demo );
index 2f408bc..a30167c 100644 (file)
@@ -53,7 +53,10 @@ create_dlg (void)
   GtkWidget *label18;
   GtkWidget *remove_theme;
   GtkWidget *label3;
-  GtkWidget *empty_notebook_page;
+  GtkWidget *vbox5;
+  GtkWidget *vbox6;
+  GtkWidget *label19;
+  GtkWidget *tb_style;
   GtkWidget *label5;
   GtkWidget *vbox1;
   GtkWidget *label15;
@@ -167,9 +170,27 @@ create_dlg (void)
   gtk_widget_show (label3);
   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label3);
 
-  empty_notebook_page = gtk_vbox_new (FALSE, 0);
-  gtk_widget_show (empty_notebook_page);
-  gtk_container_add (GTK_CONTAINER (notebook1), empty_notebook_page);
+  vbox5 = gtk_vbox_new (FALSE, 4);
+  gtk_widget_show (vbox5);
+  gtk_container_add (GTK_CONTAINER (notebook1), vbox5);
+
+  vbox6 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox6);
+  gtk_box_pack_start (GTK_BOX (vbox5), vbox6, FALSE, TRUE, 0);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox6), 4);
+
+  label19 = gtk_label_new (_("Toolbar Style: "));
+  gtk_widget_show (label19);
+  gtk_box_pack_start (GTK_BOX (vbox6), label19, FALSE, FALSE, 0);
+  gtk_misc_set_alignment (GTK_MISC (label19), 0, 0.5);
+
+  tb_style = gtk_combo_box_new_text ();
+  gtk_widget_show (tb_style);
+  gtk_box_pack_start (GTK_BOX (vbox6), tb_style, TRUE, TRUE, 0);
+  gtk_combo_box_append_text (GTK_COMBO_BOX (tb_style), _("Icons only"));
+  gtk_combo_box_append_text (GTK_COMBO_BOX (tb_style), _("Text only"));
+  gtk_combo_box_append_text (GTK_COMBO_BOX (tb_style), _("Text below icons"));
+  gtk_combo_box_append_text (GTK_COMBO_BOX (tb_style), _("Text beside icons"));
 
   label5 = gtk_label_new (_("Other"));
   gtk_widget_show (label5);
@@ -220,6 +241,9 @@ create_dlg (void)
   g_signal_connect ((gpointer) remove_theme, "clicked",
                     G_CALLBACK (on_remove_theme_clicked),
                     NULL);
+  g_signal_connect ((gpointer) tb_style, "changed",
+                    G_CALLBACK (on_tb_style_changed),
+                    NULL);
   g_signal_connect ((gpointer) apply, "clicked",
                     G_CALLBACK (on_apply_clicked),
                     NULL);
@@ -254,6 +278,10 @@ create_dlg (void)
   GLADE_HOOKUP_OBJECT (dlg, label18, "label18");
   GLADE_HOOKUP_OBJECT (dlg, remove_theme, "remove_theme");
   GLADE_HOOKUP_OBJECT (dlg, label3, "label3");
+  GLADE_HOOKUP_OBJECT (dlg, vbox5, "vbox5");
+  GLADE_HOOKUP_OBJECT (dlg, vbox6, "vbox6");
+  GLADE_HOOKUP_OBJECT (dlg, label19, "label19");
+  GLADE_HOOKUP_OBJECT (dlg, tb_style, "tb_style");
   GLADE_HOOKUP_OBJECT (dlg, label5, "label5");
   GLADE_HOOKUP_OBJECT (dlg, vbox1, "vbox1");
   GLADE_HOOKUP_OBJECT (dlg, label15, "label15");
index 6815256..8687c02 100644 (file)
@@ -33,6 +33,7 @@ static GtkListStore* icon_theme_list = NULL;
 static char* gtk_theme_name = NULL;
 static char* icon_theme_name = NULL;
 static char* font_name = NULL;
+static GtkToolbarStyle tb_style = GTK_TOOLBAR_BOTH_HORIZ;
 
 static char tmp_rc_file[] = "/tmp/gtkrc-2.0-XXXXXX";
 static char* rc_file = NULL;
@@ -71,6 +72,13 @@ static void reload_demo_process()
 static void write_rc_file( const char* path )
 {
     FILE* f;
+    static char* tb_styles[] = {
+        "GTK_TOOLBAR_ICONS",
+        "GTK_TOOLBAR_TEXT",
+        "GTK_TOOLBAR_BOTH",
+        "GTK_TOOLBAR_BOTH_HORIZ"
+    };
+
     if( f = fopen( path, "w" ) )
     {
         fputs( "# DO NOT EDIT!  This file will be overwritten by LXAppearance.\n"
@@ -79,6 +87,8 @@ static void write_rc_file( const char* path )
         fprintf( f, "gtk-theme-name=\"%s\"\n", gtk_theme_name );
         fprintf( f, "gtk-icon-theme-name=\"%s\"\n", icon_theme_name );
         fprintf( f, "gtk-font-name=\"%s\"\n", font_name );
+        fprintf( f, "gtk-toolbar-style=%d\n", tb_style );
+
         fprintf( f, "include \"%s/.gtkrc-2.0.mine\"\n", g_get_home_dir() );
 
         fclose( f );
@@ -196,8 +206,12 @@ static void load_from_data_dirs( GtkListStore* list,
 
 static void load_gtk_themes( GtkListStore* list )
 {
+    char* path;
     GtkTreeSelection* sel = gtk_tree_view_get_selection( gtk_theme_view );
     load_from_data_dirs( list, "themes", "gtk-2.0", sel, gtk_theme_name );
+    path = g_build_filename( g_get_home_dir(), ".themes", NULL );
+    load_themes_from_dir( list, path, "gtk-2.0", sel, icon_theme_name );
+    g_free( path );
 }
 
 static void load_icon_themes( GtkListStore* list )
@@ -239,15 +253,20 @@ void main_dlg_init( GtkWidget* dlg )
         rc_file = g_strdup( rc_file );
     else
         rc_file = g_build_filename( g_get_home_dir(), ".gtkrc-2.0", NULL );
+
     mkstemp( tmp_rc_file );
 
-    g_object_get( gtk_settings_get_default(), "gtk-theme-name", &gtk_theme_name, NULL );
+    g_object_get( gtk_settings_get_default(),
+                        "gtk-theme-name", &gtk_theme_name,
+                        "gtk-icon-theme-name", &icon_theme_name,
+                        "gtk-font-name", &font_name,
+                        "gtk-toolbar-style", &tb_style,
+                        NULL );
+
     if(  ! gtk_theme_name )
         gtk_theme_name = g_strdup( "Raleigh" );
-    g_object_get( gtk_settings_get_default(), "gtk-icon-theme-name", &icon_theme_name, NULL );
     if(  ! icon_theme_name )
         gtk_theme_name = g_strdup( "hicolor" );
-    g_object_get( gtk_settings_get_default(), "gtk-font-name", &font_name, NULL );
     if( ! font_name )
         font_name = g_strdup( "Sans 10" );
 
@@ -257,7 +276,7 @@ void main_dlg_init( GtkWidget* dlg )
     INIT_LIST( icon_theme, "gtk-icon-theme-name" )
     gtk_font_button_set_font_name( (GtkFontButton*)lookup_widget(dlg, "font"), font_name );
 
-    /* INIT_LIST( font, "gtk-font-name" ) */
+    gtk_combo_box_set_active( (GtkComboBox*)lookup_widget(dlg, "tb_style"), tb_style < 4 ? tb_style : 3 );
 
     GET_WIDGET( demo_box );
     gtk_widget_show( demo_box );
@@ -315,7 +334,25 @@ void
 on_install_theme_clicked               (GtkButton       *button,
                                         gpointer         user_data)
 {
+    GtkFileFilter* filter = gtk_file_filter_new();
+    GtkWidget* fc = gtk_file_chooser_dialog_new( _("Select an icon theme"), NULL,
+                                        GTK_FILE_CHOOSER_ACTION_OPEN,
+                                        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                                        GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL );
 
+    gtk_file_filter_add_pattern( filter, "*.tar.gz" );
+    gtk_file_filter_add_pattern( filter, "*.tar.bz2" );
+    gtk_file_filter_set_name( filter, _("*.tar.gz, *.tar.bz2 (Icon Theme)") );
+
+    gtk_file_chooser_add_filter( fc, filter );
+    gtk_file_chooser_set_filter( (GtkFileChooser*)fc, filter );
+
+    if( gtk_dialog_run( (GtkDialog*)fc ) == GTK_RESPONSE_OK )
+    {
+
+    }
+
+    gtk_widget_destroy( fc );
 }
 
 
@@ -326,3 +363,16 @@ on_remove_theme_clicked                (GtkButton       *button,
 
 }
 
+
+void
+on_tb_style_changed                    (GtkComboBox     *combobox,
+                                        gpointer         user_data)
+{
+    int sel = gtk_combo_box_get_active( combobox );
+    if( sel == tb_style || sel < 0 )
+        return;
+    tb_style = sel;
+    write_rc_file( tmp_rc_file );
+    reload_demo_process();
+}
+
index fb8ad6f..b19768c 100644 (file)
@@ -17,3 +17,7 @@ on_install_theme_clicked               (GtkButton       *button,
 void
 on_remove_theme_clicked                (GtkButton       *button,
                                         gpointer         user_data);
+
+void
+on_tb_style_changed                    (GtkComboBox     *combobox,
+                                        gpointer         user_data);
index 6d031e1..feceb13 100644 (file)
@@ -39,6 +39,9 @@ int main (int argc, char *argv[])
     gtk_set_locale ();
     gtk_init (&argc, &argv);
 
+    /* Dirty hack: "gtk-toolbar-style" is installed in class_init of GtkToolbar */
+    gtk_widget_destroy( gtk_toolbar_new() );
+
     dlg = create_dlg ();
     main_dlg_init( dlg );