Skip to content

Commit bf00d99

Browse files
oliviaschclefebvre
authored andcommitted
fullscreen: Add support for Ctrl+L page selector (#729)
Fixes: #668
1 parent f7c1120 commit bf00d99

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

shell/ev-window.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,9 @@ update_chrome_visibility (EvWindow *window)
615615
fullscreen_mode = fullscreen || presentation;
616616

617617
menubar = (priv->chrome & EV_CHROME_MENUBAR) != 0 && !fullscreen_mode;
618-
toolbar = ((priv->chrome & EV_CHROME_TOOLBAR) != 0 ||
619-
(priv->chrome & EV_CHROME_RAISE_TOOLBAR) != 0) && !presentation && !fullscreen;
618+
toolbar = !presentation && (fullscreen
619+
? (priv->chrome & (EV_CHROME_RAISE_TOOLBAR | EV_CHROME_FULLSCREEN_TOOLBAR)) != 0
620+
: (priv->chrome & (EV_CHROME_TOOLBAR | EV_CHROME_RAISE_TOOLBAR)) != 0);
620621
fullscreen_toolbar = ((priv->chrome & EV_CHROME_FULLSCREEN_TOOLBAR) != 0 ||
621622
(priv->chrome & EV_CHROME_RAISE_TOOLBAR) != 0) && fullscreen;
622623
findbar = (priv->chrome & EV_CHROME_FINDBAR) != 0;
@@ -3785,6 +3786,25 @@ ev_window_cmd_file_close_all_windows (GtkAction *action,
37853786
}
37863787
}
37873788

3789+
static void
3790+
focus_page_selector_revealed_cb (GtkRevealer *revealer,
3791+
GParamSpec *pspec,
3792+
EvWindow *window)
3793+
{
3794+
GtkAction *action;
3795+
3796+
if (!gtk_revealer_get_child_revealed (revealer))
3797+
return;
3798+
3799+
action = gtk_action_group_get_action (window->priv->action_group,
3800+
PAGE_SELECTOR_ACTION);
3801+
ev_page_action_grab_focus (EV_PAGE_ACTION (action));
3802+
3803+
g_signal_handlers_disconnect_by_func (revealer,
3804+
focus_page_selector_revealed_cb,
3805+
window);
3806+
}
3807+
37883808
static void
37893809
ev_window_cmd_focus_page_selector (GtkAction *act,
37903810
EvWindow *window)
@@ -3797,7 +3817,11 @@ ev_window_cmd_focus_page_selector (GtkAction *act,
37973817

37983818
action = gtk_action_group_get_action (window->priv->action_group,
37993819
PAGE_SELECTOR_ACTION);
3800-
ev_page_action_grab_focus (EV_PAGE_ACTION (action));
3820+
if (gtk_revealer_get_child_revealed (GTK_REVEALER (window->priv->toolbar_revealer)))
3821+
ev_page_action_grab_focus (EV_PAGE_ACTION (action));
3822+
else
3823+
g_signal_connect (window->priv->toolbar_revealer, "notify::child-revealed",
3824+
G_CALLBACK (focus_page_selector_revealed_cb), window);
38013825
}
38023826

38033827
static void

0 commit comments

Comments
 (0)