Commit 89fee3f5 authored by Alexander Shabalin's avatar Alexander Shabalin

Smooth scrolling is now an option "smooth-scroll".

parent 32350a8c
......@@ -203,6 +203,7 @@ girara_config_load_default(girara_session_t* session)
int n_completion_items = 15;
bool show_scrollbars = false;
girara_mode_t normal_mode = session->modes.normal;
bool use_smooth_scroll = false;
/* other values */
session->global.autohide_inputbar = true;
......@@ -243,6 +244,7 @@ girara_config_load_default(girara_session_t* session)
girara_setting_add(session, "window-icon", "", STRING, FALSE, _("Window icon"), cb_window_icon, NULL);
girara_setting_add(session, "exec-command", "", STRING, FALSE, _("Command to execute in :exec"), NULL, NULL);
girara_setting_add(session, "guioptions", "s", STRING, FALSE, _("Show or hide certain GUI elements"), cb_guioptions, NULL);
girara_setting_add(session, "smooth-scroll", &use_smooth_scroll, BOOLEAN, TRUE, _("Enable smooth scrolling and zooming"), NULL, NULL);
/* shortcuts */
girara_shortcut_add(session, 0, GDK_KEY_Escape, NULL, girara_sc_abort, normal_mode, 0, NULL);
......
......@@ -283,7 +283,7 @@ girara_session_create()
session->gtk.view = gtk_scrolled_window_new(NULL, NULL);
session->gtk.viewport = gtk_viewport_new(NULL, NULL);
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION >= 4
gtk_widget_add_events(session->gtk.viewport, GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK);
gtk_widget_add_events(session->gtk.viewport, GDK_SCROLL_MASK);
#endif
session->gtk.statusbar = gtk_event_box_new();
session->gtk.notification_area = gtk_event_box_new();
......@@ -309,6 +309,14 @@ girara_session_init(girara_session_t* session, const char* sessionname)
return false;
}
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION >= 4
bool smooth_scroll = false;
girara_setting_get(session, "smooth-scroll", &smooth_scroll);
if (smooth_scroll) {
gtk_widget_add_events(session->gtk.viewport, GDK_SMOOTH_SCROLL_MASK);
}
#endif
session->private_data->session_name = g_strdup(
(sessionname == NULL) ? "girara" : sessionname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment