From: Adrien Plazas Date: Wed, 11 Dec 2019 16:24:31 +0100 Subject: toolbar: Allow to toggle the sidebar button This will allow updating the button's state when gestures will allow closing the sidebar in the next commit. --- shell/ev-toolbar.c | 14 ++++++++++++++ shell/ev-toolbar.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/shell/ev-toolbar.c b/shell/ev-toolbar.c index bb20887..6c5521f 100644 --- a/shell/ev-toolbar.c +++ b/shell/ev-toolbar.c @@ -264,3 +264,17 @@ ev_toolbar_get_mode (EvToolbar *ev_toolbar) return priv->toolbar_mode; } + +void +ev_toolbar_set_sidebar_visible (EvToolbar *ev_toolbar, + gboolean visible) +{ + EvToolbarPrivate *priv; + + g_return_if_fail (EV_IS_TOOLBAR (ev_toolbar)); + + priv = GET_PRIVATE (ev_toolbar); + visible = !!visible; + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->sidebar_button), visible); +} diff --git a/shell/ev-toolbar.h b/shell/ev-toolbar.h index 6cb8ae4..1b15e80 100644 --- a/shell/ev-toolbar.h +++ b/shell/ev-toolbar.h @@ -58,4 +58,7 @@ void ev_toolbar_set_mode (EvToolbar *ev_toolbar, EvToolbarMode mode); EvToolbarMode ev_toolbar_get_mode (EvToolbar *ev_toolbar); +void ev_toolbar_set_sidebar_visible (EvToolbar *ev_toolbar, + gboolean visible); + G_END_DECLS