diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-01-17 09:08:28 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-01-17 09:08:28 +0000 |
commit | 82f2b2c8d01340ed478e05313e52f1324faaf272 (patch) | |
tree | 447185c98d300f2f1831da07927a2031d0c76b62 /src/mainwindow.c | |
parent | 186fb3f95f60797959a3b35bebbca5dfb08d855c (diff) |
enabled toggle of the searchbar.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@901 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r-- | src/mainwindow.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c index f8a41f1d..e42f6f89 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -254,6 +254,9 @@ static void toggle_message_cb (MainWindow *mainwin, static void toggle_toolbar_cb (MainWindow *mainwin, guint action, GtkWidget *widget); +static void toggle_searchbar_cb (MainWindow *mainwin, + guint action, + GtkWidget *widget); static void toggle_statusbar_cb (MainWindow *mainwin, guint action, GtkWidget *widget); @@ -528,6 +531,8 @@ static GtkItemFactoryEntry mainwin_entries[] = NULL, toggle_toolbar_cb, TOOLBAR_TEXT, "/View/Show or hide/Toolbar/Icon and text"}, {N_("/_View/Show or hi_de/_Toolbar/_None"), NULL, toggle_toolbar_cb, TOOLBAR_NONE, "/View/Show or hide/Toolbar/Icon and text"}, + {N_("/_View/Show or hi_de/_Search bar"), + NULL, toggle_searchbar_cb, 0, "<ToggleItem>"}, {N_("/_View/Show or hi_de/Status _bar"), NULL, toggle_statusbar_cb, 0, "<ToggleItem>"}, {N_("/_View/---"), NULL, NULL, 0, "<Separator>"}, @@ -1042,6 +1047,12 @@ MainWindow *main_window_create(SeparateType type) } gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE); + gtk_widget_hide(summaryview->search_hbox); + menuitem = gtk_item_factory_get_item + (ifactory, "/View/Show or hide/Search bar"); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), + prefs_common.show_searchbar); + gtk_widget_hide(mainwin->statusbar); menuitem = gtk_item_factory_get_item (ifactory, "/View/Show or hide/Status bar"); @@ -2973,6 +2984,19 @@ static void toggle_toolbar_cb(MainWindow *mainwin, guint action, prefs_common.toolbar_style = (ToolbarStyle)action; } +static void toggle_searchbar_cb(MainWindow *mainwin, guint action, + GtkWidget *widget) +{ + if (GTK_CHECK_MENU_ITEM(widget)->active) { + gtk_widget_show(mainwin->summaryview->search_hbox); + prefs_common.show_searchbar = TRUE; + } else { + gtk_widget_hide(mainwin->summaryview->search_hbox); + summary_qsearch_reset(mainwin->summaryview); + prefs_common.show_searchbar = FALSE; + } +} + static void toggle_statusbar_cb(MainWindow *mainwin, guint action, GtkWidget *widget) { |