[epiphany] Add preference to enable/disable smooth scrolling



commit cdc7544fa1e77b57ec8e6058c228d6944b5b1d13
Author: sharazali <s ali tutamail com>
Date:   Fri Dec 28 10:31:12 2018 +0400

    Add preference to enable/disable smooth scrolling
    
    Add checkbox in the general tab of preferences that can enable and disable smooth scrolling. Fixes: 
https://gitlab.gnome.org/GNOME/epiphany/issues/577

 src/prefs-dialog.c                | 13 +++++++++++++
 src/resources/gtk/prefs-dialog.ui | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
---
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 62e463a27..648c5f7f9 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -88,11 +88,13 @@ struct _PrefsDialog {
   GtkWidget *download_box;
   GtkWidget *search_box;
   GtkWidget *session_box;
+  GtkWidget *browsing_box;
   GtkWidget *restore_session_checkbutton;
   GtkWidget *popups_allow_checkbutton;
   GtkWidget *adblock_allow_checkbutton;
   GtkWidget *enable_plugins_checkbutton;
   GtkWidget *enable_safe_browsing_checkbutton;
+  GtkWidget *enable_smooth_scrolling_checkbutton;
 
   /* fonts & style */
   GtkWidget *use_gnome_fonts_checkbutton;
@@ -950,10 +952,12 @@ prefs_dialog_class_init (PrefsDialogClass *klass)
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, webapp_title);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, search_box);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, session_box);
+  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, browsing_box);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, restore_session_checkbutton);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, popups_allow_checkbutton);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, adblock_allow_checkbutton);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, enable_safe_browsing_checkbutton);
+  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, enable_smooth_scrolling_checkbutton);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, download_button_hbox);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, download_button_label);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, download_box);
@@ -1981,6 +1985,11 @@ setup_general_page (PrefsDialog *dialog)
                     "clicked",
                     G_CALLBACK (do_not_track_button_clicked_cb),
                     dialog);
+  g_settings_bind (web_settings,
+                   EPHY_PREFS_WEB_ENABLE_SMOOTH_SCROLLING,
+                   dialog->enable_smooth_scrolling_checkbutton,
+                   "active",
+                   G_SETTINGS_BIND_DEFAULT);
 
   if (ephy_is_running_inside_flatpak ())
     gtk_widget_hide (dialog->download_box);
@@ -2345,8 +2354,12 @@ prefs_dialog_init (PrefsDialog *dialog)
                           mode != EPHY_EMBED_SHELL_MODE_APPLICATION);
   gtk_widget_set_visible (dialog->session_box,
                           mode != EPHY_EMBED_SHELL_MODE_APPLICATION);
+  gtk_widget_set_visible (dialog->browsing_box,
+                          mode != EPHY_EMBED_SHELL_MODE_APPLICATION);
   gtk_widget_set_visible (dialog->do_not_track_checkbutton,
                           mode != EPHY_EMBED_SHELL_MODE_APPLICATION);
+  gtk_widget_set_visible (dialog->enable_smooth_scrolling_checkbutton,
+                          mode != EPHY_EMBED_SHELL_MODE_APPLICATION);
   gtk_widget_set_visible (dialog->reader_mode_box,
                           mode != EPHY_EMBED_SHELL_MODE_APPLICATION);
 
diff --git a/src/resources/gtk/prefs-dialog.ui b/src/resources/gtk/prefs-dialog.ui
index 5bdd8a9ee..a080e16dc 100644
--- a/src/resources/gtk/prefs-dialog.ui
+++ b/src/resources/gtk/prefs-dialog.ui
@@ -30,6 +30,38 @@
                 <property name="border-width">12</property>
                 <property name="orientation">vertical</property>
                 <property name="spacing">18</property>
+                <child>
+                  <object class="GtkBox" id="browsing_box">
+                    <property name="visible">False</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="visible">True</property>
+                        <property name="halign">start</property>
+                        <property name="label" translatable="yes">Browsing</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkBox">
+                        <property name="visible">True</property>
+                        <property name="orientation">vertical</property>
+                        <property name="spacing">6</property>
+                        <property name="margin-start">12</property>
+                        <child>
+                          <object class="GtkCheckButton" id="enable_smooth_scrolling_checkbutton">
+                            <property name="label" translatable="yes">Enable sm_ooth scrolling</property>
+                            <property name="visible">True</property>
+                            <property name="use-underline">True</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
                 <child>
                   <object class="GtkBox" id="homepage_box">
                     <property name="visible">False</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]