diff options
| author | Eduard Beutel <[email protected]> | 2014-08-30 22:05:30 +0200 |
|---|---|---|
| committer | Victor Kareh <[email protected]> | 2026-06-25 10:20:54 -0400 |
| commit | 1a5c28010afd483f7d30261744e80b15e29481ba (patch) | |
| tree | 35f18c9deb264aad67b5e9c826f57272d1e62b38 /shell | |
| parent | e531227809082a3799340e4718b041e458492f98 (diff) | |
| download | atril-1a5c28010afd483f7d30261744e80b15e29481ba.tar.bz2 atril-1a5c28010afd483f7d30261744e80b15e29481ba.tar.xz | |
Add allow-links-change-zoom setting
When enabled links are not allowed to change the current zoom mode and
level.
Fixes #712
Backported from https://gitlab.gnome.org/GNOME/evince/-/commit/5d8ef0fa
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/ev-window.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c index cc45f883..749d9f26 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -265,6 +265,7 @@ struct _EvWindowPrivate { #define GS_OVERRIDE_RESTRICTIONS "override-restrictions" #define GS_PAGE_CACHE_SIZE "page-cache-size" #define GS_AUTO_RELOAD "auto-reload" +#define GS_ALLOW_LINKS_CHANGE_ZOOM "allow-links-change-zoom" #define GS_LAST_DOCUMENT_DIRECTORY "document-directory" #define GS_LAST_PICTURES_DIRECTORY "pictures-directory" @@ -1532,6 +1533,16 @@ page_cache_size_changed (GSettings *settings, } static void +allow_links_change_zoom_changed (GSettings *settings, + gchar *key, + EvWindow *ev_window) +{ + gboolean allow_links_change_zoom = g_settings_get_boolean (settings, GS_ALLOW_LINKS_CHANGE_ZOOM); + + ev_view_set_allow_links_change_zoom (EV_VIEW (ev_window->priv->view), allow_links_change_zoom); +} + +static void ev_window_setup_default (EvWindow *ev_window) { EvDocumentModel *model = ev_window->priv->model; @@ -1673,6 +1684,10 @@ ev_window_ensure_settings (EvWindow *ev_window) "changed::"GS_PAGE_CACHE_SIZE, G_CALLBACK (page_cache_size_changed), ev_window); + g_signal_connect (priv->settings, + "changed::"GS_ALLOW_LINKS_CHANGE_ZOOM, + G_CALLBACK (allow_links_change_zoom_changed), + ev_window); return priv->settings; } @@ -7925,6 +7940,7 @@ ev_window_init (EvWindow *ev_window) GtkWidget *overlay; GObject *mpkeys; guint page_cache_mb; + gboolean allow_links_change_zoom; #ifdef ENABLE_DBUS GDBusConnection *connection; static gint window_id = 0; @@ -8225,6 +8241,10 @@ ev_window_init (EvWindow *ev_window) GS_PAGE_CACHE_SIZE); ev_view_set_page_cache_size (EV_VIEW (ev_window->priv->view), page_cache_mb * 1024 * 1024); + allow_links_change_zoom = g_settings_get_boolean (ev_window_ensure_settings (ev_window), + GS_ALLOW_LINKS_CHANGE_ZOOM); + ev_view_set_allow_links_change_zoom (EV_VIEW (ev_window->priv->view), + allow_links_change_zoom); ev_view_set_model (EV_VIEW (ev_window->priv->view), ev_window->priv->model); ev_window->priv->password_view = ev_password_view_new (GTK_WINDOW (ev_window)); |
