diff --git a/data/ui/gummi.glade b/data/ui/gummi.glade index 0eb988a9..20ca1e29 100644 --- a/data/ui/gummi.glade +++ b/data/ui/gummi.glade @@ -1080,6 +1080,16 @@ + + + True + False + _Right pane + True + + + + True @@ -1745,6 +1755,7 @@ active document to be saved. True False + True True diff --git a/src/configfile.c b/src/configfile.c index a93a5fa8..a6a338f4 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -49,6 +49,7 @@ const gchar default_config[] = "mainwindow_max = false\n" "toolbar = true\n" "statusbar = true\n" +"rightpane = true\n" "snippets = true\n" "[Editor]\n" "font_str = Monospace 14\n" diff --git a/src/gui/gui-main.c b/src/gui/gui-main.c index ebf8295a..a3d0da28 100644 --- a/src/gui/gui-main.c +++ b/src/gui/gui-main.c @@ -107,7 +107,9 @@ GummiGui* gui_init (GtkBuilder* builder) { g->menu_toolbar = GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menu_toolbar")); g->menu_statusbar = - GTK_CHECK_MENU_ITEM(gtk_builder_get_object (builder, "menu_statusbar")); + GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menu_statusbar")); + g->menu_rightpane = + GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menu_rightpane")); g->statusid = gtk_statusbar_get_context_id (GTK_STATUSBAR (g->statusbar), "Gummi"); g->recent[0] = @@ -226,6 +228,14 @@ GummiGui* gui_init (GtkBuilder* builder) { gtk_widget_hide (GTK_WIDGET (g->statusbar)); } + if (config_get_boolean ("Interface", "rightpane")) { + gtk_check_menu_item_set_active (g->menu_rightpane, TRUE); + gtk_widget_show (GTK_WIDGET (g->rightpane)); + } else { + gtk_check_menu_item_set_active (g->menu_rightpane, FALSE); + gtk_widget_hide (GTK_WIDGET (g->rightpane)); + } + g->menu_autosync = GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menu_autosync")); diff --git a/src/gui/gui-main.h b/src/gui/gui-main.h index d492c559..6adec434 100644 --- a/src/gui/gui-main.h +++ b/src/gui/gui-main.h @@ -83,6 +83,7 @@ struct _GummiGui { GtkCheckMenuItem* menu_snippets; GtkCheckMenuItem* menu_toolbar; GtkCheckMenuItem* menu_statusbar; + GtkCheckMenuItem* menu_rightpane; GtkCheckMenuItem* menu_autosync; GtkMenuItem* recent[5]; gint insens_widget_size; diff --git a/src/gui/gui-menu.c b/src/gui/gui-menu.c index 312a9185..6ff46c9f 100644 --- a/src/gui/gui-menu.c +++ b/src/gui/gui-menu.c @@ -322,6 +322,19 @@ void on_menu_toolbar_toggled (GtkWidget *widget, void *user) { } } +G_MODULE_EXPORT +void on_menu_rightpane_toggled (GtkWidget *widget, void *user) { + if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget))) { + gtk_widget_show (GTK_WIDGET (gui->rightpane)); + config_set_boolean ("Interface", "rightpane", TRUE); + gtk_toggle_tool_button_set_active (gui->previewgui->preview_pause, FALSE); + } else { + gtk_widget_hide (GTK_WIDGET (gui->rightpane)); + config_set_boolean ("Interface", "rightpane", FALSE); + gtk_toggle_tool_button_set_active (gui->previewgui->preview_pause, TRUE); + } +} + G_MODULE_EXPORT void on_menu_fullscreen_toggled (GtkWidget *widget, void *user) { if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)))