X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Flayout_util.c;h=fc431c899a42335a60afbe03c442fa0a672ceead;hp=2f340b5f464f5ed80af26cb9e12ff4d124bc6caf;hb=f6a87c016ecead37f8232bea58de4f0b0d3e3680;hpb=68c4796e434bae49815d667264a780c8b63fc551 diff --git a/src/layout_util.c b/src/layout_util.c index 2f340b5f..fc431c89 100644 --- a/src/layout_util.c +++ b/src/layout_util.c @@ -64,6 +64,7 @@ static gboolean layout_bar_enabled(LayoutWindow *lw); static gboolean layout_bar_sort_enabled(LayoutWindow *lw); +static void layout_bars_hide_toggle(LayoutWindow *lw); static void layout_util_sync_views(LayoutWindow *lw); /* @@ -996,6 +997,13 @@ static void layout_menu_bar_sort_cb(GtkToggleAction *action, gpointer data) layout_bar_sort_toggle(lw); } +static void layout_menu_hide_bars_cb(GtkToggleAction *action, gpointer data) +{ + LayoutWindow *lw = data; + + layout_bars_hide_toggle(lw); +} + static void layout_menu_slideshow_cb(GtkToggleAction *action, gpointer data) { LayoutWindow *lw = data; @@ -1236,7 +1244,7 @@ static void layout_menu_log_window_cb(GtkAction *action, gpointer data) LayoutWindow *lw = data; layout_exit_fullscreen(lw); - log_window_new(); + log_window_new(lw); } @@ -1413,6 +1421,24 @@ static void layout_menu_split_pane_prev_cb(GtkAction *action, gpointer data) layout_image_activate(lw, active_frame, FALSE); } +static void layout_menu_split_pane_updown_cb(GtkAction *action, gpointer data) +{ + LayoutWindow *lw = data; + gint active_frame; + + active_frame = lw->active_split_image; + + if (lw->split_images[MAX_SPLIT_IMAGES-1] ) + { + active_frame = active_frame ^ 2; + } + else + { + active_frame = active_frame ^ 1; + } + layout_image_activate(lw, active_frame, FALSE); +} + static void layout_menu_image_last_cb(GtkAction *action, gpointer data) { LayoutWindow *lw = data; @@ -1791,6 +1817,8 @@ static GtkActionEntry menu_entries[] = { { "StereoCycle", NULL, N_("_Cycle through stereo modes"), NULL, N_("Cycle through stereo modes"), CB(layout_menu_stereo_mode_next_cb) }, { "SplitNextPane", NULL, N_("_Next Pane"), "Right", N_("Next Pane"), CB(layout_menu_split_pane_next_cb) }, { "SplitPreviousPane", NULL, N_("_Previous Pane"), "Left", N_("Previous Pane"), CB(layout_menu_split_pane_prev_cb) }, + { "SplitUpPane", NULL, N_("_Up Pane"), "Up", N_("Up Pane"), CB(layout_menu_split_pane_updown_cb) }, + { "SplitDownPane", NULL, N_("_Down Pane"), "Down", N_("Down Pane"), CB(layout_menu_split_pane_updown_cb) }, { "WriteRotation", NULL, N_("_Write orientation to file"), NULL, N_("Write orientation to file"), CB(layout_menu_write_rotate_cb) }, { "WriteRotationKeepDate", NULL, N_("_Write orientation to file (preserve timestamp)"), NULL, N_("Write orientation to file (preserve timestamp)"), CB(layout_menu_write_rotate_keep_date_cb) }, @@ -1804,6 +1832,7 @@ static GtkToggleActionEntry menu_toggle_entries[] = { { "HideToolbar", NULL, N_("Hide tool_bar"), NULL, N_("Hide toolbar"), CB(layout_menu_toolbar_cb), FALSE }, { "SBar", NULL, N_("_Info sidebar"), "K", N_("Info sidebar"), CB(layout_menu_bar_cb), FALSE }, { "SBarSort", NULL, N_("Sort _manager"), "S", N_("Sort manager"), CB(layout_menu_bar_sort_cb), FALSE }, + { "HideBars", NULL, N_("Hide Bars"), "grave", N_("Hide Bars"), CB(layout_menu_hide_bars_cb), FALSE }, { "SlideShow", GTK_STOCK_MEDIA_PLAY, N_("Toggle _slideshow"), "S", N_("Toggle slideshow"), CB(layout_menu_slideshow_cb), FALSE }, { "UseColorProfiles", GTK_STOCK_SELECT_COLOR, N_("Use _color profiles"), NULL, N_("Use color profiles"), CB(layout_color_menu_enable_cb), FALSE}, { "UseImageProfile", NULL, N_("Use profile from _image"), NULL, N_("Use profile from image"), CB(layout_color_menu_use_image_cb), FALSE}, @@ -2019,6 +2048,8 @@ static const gchar *menu_ui_description = " " " " " " +" " +" " " " " " " " @@ -2061,6 +2092,7 @@ static const gchar *menu_ui_description = " " " " " " +" " " " " " " " @@ -2684,6 +2716,10 @@ static void layout_util_sync_views(LayoutWindow *lw) gtk_action_set_sensitive(action, !(lw->split_mode == SPLIT_NONE)); action = gtk_action_group_get_action(lw->action_group, "SplitPreviousPane"); gtk_action_set_sensitive(action, !(lw->split_mode == SPLIT_NONE)); + action = gtk_action_group_get_action(lw->action_group, "SplitUpPane"); + gtk_action_set_sensitive(action, !(lw->split_mode == SPLIT_NONE)); + action = gtk_action_group_get_action(lw->action_group, "SplitDownPane"); + gtk_action_set_sensitive(action, !(lw->split_mode == SPLIT_NONE)); action = gtk_action_group_get_action(lw->action_group, "ViewIcons"); gtk_radio_action_set_current_value(GTK_RADIO_ACTION(action), lw->options.file_view_type); @@ -2940,6 +2976,39 @@ void layout_bar_sort_toggle(LayoutWindow *lw) layout_util_sync_views(lw); } +static void layout_bars_hide_toggle(LayoutWindow *lw) +{ + if (lw->options.bars_state.hidden) + { + lw->options.bars_state.hidden = FALSE; + if (lw->options.bars_state.sort) + { + gtk_widget_show(lw->bar_sort); + } + if (lw->options.bars_state.info) + { + gtk_widget_show(lw->bar); + } + layout_tools_float_set(lw, lw->options.tools_float, + lw->options.bars_state.tools_hidden); + } + else + { + lw->options.bars_state.hidden = TRUE; + lw->options.bars_state.sort = layout_bar_sort_enabled(lw); + lw->options.bars_state.info = layout_bar_enabled(lw); + lw->options.bars_state.tools_float = lw->options.tools_float; + lw->options.bars_state.tools_hidden = lw->options.tools_hidden; + + gtk_widget_hide(lw->bar); + if (lw->bar_sort) + gtk_widget_hide(lw->bar_sort); + layout_tools_float_set(lw, lw->options.tools_float, TRUE); + } + + layout_util_sync_views(lw); +} + void layout_bars_new_image(LayoutWindow *lw) { layout_bar_new_image(lw);