From 463c27c39549a3fbcc6a59e56822e47d0a4303e0 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 13 May 2016 19:43:29 +0200 Subject: [PATCH 1/2] schemas: screen: Add a setting to configure the scroll speed https://bugzilla.redhat.com/show_bug.cgi?id=1103380 --- src/org.gnome.Terminal.gschema.xml | 11 +++++++++++ src/terminal-schemas.h | 2 ++ src/terminal-screen.c | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml index 04be15324d3d..c5ae00a82064 100644 --- a/src/org.gnome.Terminal.gschema.xml +++ b/src/org.gnome.Terminal.gschema.xml @@ -427,6 +427,17 @@ Adjust the amount of transparency A value between 0 and 100, where 0 is opaque and 100 is fully transparent. + + true + Whether to use a dynamic scrolling speed + If true, the speed will be a function of the number of visible rows. Otherwise, the buffer will scroll by a fixed number of lines regardless of the number of visible rows. + + + 1 + + Adjust the scrolling speed + The number of lines by which the buffer is moved when scrolling with a mouse wheel on top of the terminal. + diff --git a/src/terminal-schemas.h b/src/terminal-schemas.h index 240213fead43..7e9fc96cad9f 100644 --- a/src/terminal-schemas.h +++ b/src/terminal-schemas.h @@ -77,6 +77,8 @@ G_BEGIN_DECLS #define TERMINAL_PROFILE_USE_TRANSPARENT_BACKGROUND "use-transparent-background" #define TERMINAL_PROFILE_BACKGROUND_TRANSPARENCY_PERCENT "background-transparency-percent" +#define TERMINAL_PROFILE_SCROLL_SPEED_KEY "scroll-speed" +#define TERMINAL_PROFILE_SCROLL_SPEED_AUTO_KEY "scroll-speed-auto" #define TERMINAL_SETTING_CONFIRM_CLOSE_KEY "confirm-close" #define TERMINAL_SETTING_DEFAULT_SHOW_MENUBAR_KEY "default-show-menubar" diff --git a/src/terminal-screen.c b/src/terminal-screen.c index faf906c763e7..18cb3318308d 100644 --- a/src/terminal-screen.c +++ b/src/terminal-screen.c @@ -1016,6 +1016,15 @@ terminal_screen_profile_changed_cb (GSettings *profile, if (!prop_name || prop_name == I_(TERMINAL_PROFILE_SCROLL_ON_OUTPUT_KEY)) vte_terminal_set_scroll_on_output (vte_terminal, g_settings_get_boolean (profile, TERMINAL_PROFILE_SCROLL_ON_OUTPUT_KEY)); + if (!prop_name || + prop_name == I_(TERMINAL_PROFILE_SCROLL_SPEED_KEY) || + prop_name == I_(TERMINAL_PROFILE_SCROLL_SPEED_AUTO_KEY)) + { + guint scroll_speed = g_settings_get_boolean (profile, TERMINAL_PROFILE_SCROLL_SPEED_AUTO_KEY) ? + 0 : g_settings_get_uint (profile, TERMINAL_PROFILE_SCROLL_SPEED_KEY); + vte_terminal_set_scroll_speed (vte_terminal, scroll_speed); + } + if (!prop_name || prop_name == I_(TERMINAL_PROFILE_SCROLLBACK_LINES_KEY) || prop_name == I_(TERMINAL_PROFILE_SCROLLBACK_UNLIMITED_KEY)) -- 2.14.4 From bc6e7ef2477ace9e81e48c001bd3e65bec618282 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 8 Jun 2018 17:08:01 +0200 Subject: [PATCH 2/2] profile: Expose the scroll speed setting in the UI https://bugzilla.redhat.com/show_bug.cgi?id=1103380 --- src/preferences.ui | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/profile-editor.c | 17 +++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/src/preferences.ui b/src/preferences.ui index 0dddd9bf32ba..6932f845e33a 100644 --- a/src/preferences.ui +++ b/src/preferences.ui @@ -82,6 +82,12 @@ 1 10 + + 1 + 10 + 1 + 5 + @@ -1841,6 +1847,60 @@ 1 + + + _Fix scroll speed to: + True + True + False + True + + + 4 + 0 + + + + + True + False + 6 + True + + + True + True + scroll-speed-adjustment + 1 + True + + + False + True + 0 + + + + + True + False + 0 + lines + center + scroll-speed-spinbutton + + + False + False + 1 + + + + + 4 + 1 + + 2 diff --git a/src/profile-editor.c b/src/profile-editor.c index 0b8f2b6951a7..889372adb35b 100644 --- a/src/profile-editor.c +++ b/src/profile-editor.c @@ -1355,6 +1355,23 @@ profile_prefs_load (const char *uuid, GSettings *profile) gtk_builder_get_object (builder, "background-transparent-adjustment"), "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET); + + profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLL_SPEED_AUTO_KEY, + gtk_builder_get_object (builder, + "scrollspeed-static-checkbutton"), + "active", + G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET | + G_SETTINGS_BIND_INVERT_BOOLEAN); + profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLL_SPEED_AUTO_KEY, + gtk_builder_get_object (builder, + "scrollspeed-box"), + "sensitive", + G_SETTINGS_BIND_GET | + G_SETTINGS_BIND_INVERT_BOOLEAN | + G_SETTINGS_BIND_NO_SENSITIVITY); + profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLL_SPEED_KEY, + gtk_builder_get_object (builder, "scroll-speed-adjustment"), + "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET); } /* Called once per Preferences window, to destroy stuff that doesn't depend on the profile being edited */ -- 2.14.4