Add a gtk-overlay-scrolling setting

This is in preparation for letting user opt out of
overlay scrolling in the control-center.
This commit is contained in:
Matthias Clasen 2019-05-22 19:24:24 +00:00
parent 8145872e27
commit 2ae6f1a741
3 changed files with 21 additions and 2 deletions

View File

@ -1627,6 +1627,7 @@ static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.interface", "gtk-im-module", "gtk-im-module", G_TYPE_STRING, { .s = "simple" } },
{ FALSE, "org.gnome.desktop.interface", "enable-animations", "gtk-enable-animations", G_TYPE_BOOLEAN, { .b = TRUE } },
{ FALSE, "org.gnome.desktop.interface", "gtk-enable-primary-paste", "gtk-enable-primary-paste", G_TYPE_BOOLEAN, { .b = TRUE } },
{ FALSE, "org.gnome.desktop.interface", "overlay-scrolling", "gtk-overlay-scrolling", G_TYPE_BOOLEAN, { .b = TRUE } },
{ FALSE, "org.gnome.settings-daemon.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i = 400 } },
{ FALSE, "org.gnome.settings-daemon.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, {.i = 8 } },
{ FALSE, "org.gnome.desktop.sound", "theme-name", "gtk-sound-theme-name", G_TYPE_STRING, { .s = "freedesktop" } },
@ -1644,7 +1645,7 @@ static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.wm.preferences", "action-middle-click-titlebar", "gtk-titlebar-middle-click", G_TYPE_STRING, { .s = "none" } },
{ FALSE, "org.gnome.desktop.wm.preferences", "action-right-click-titlebar", "gtk-titlebar-right-click", G_TYPE_STRING, { .s = "menu" } },
{ FALSE, "org.gnome.desktop.a11y", "always-show-text-caret", "gtk-keynav-use-caret", G_TYPE_BOOLEAN, { .b = FALSE } },
{ FALSE, "org.gnome.fontconfig", "serial", "gtk-fontconfig-timestamp", G_TYPE_NONE, { .i = 0 } }
{ FALSE, "org.gnome.fontconfig", "serial", "gtk-fontconfig-timestamp", G_TYPE_NONE, { .i = 0 } },
};

View File

@ -66,6 +66,7 @@ static const struct {
{"Gtk/RecentFilesMaxAge", "gtk-recent-files-max-age"},
{"Gtk/RecentFilesEnabled", "gtk-recent-files-enabled"},
{"Gtk/KeynavUseCaret", "gtk-keynav-use-caret"},
{"Gtk/OverlayScrolling", "gtk-overlay-scrolling"},
/* These are here in order to be recognized, but are not sent to
gtk as they are handled internally by gdk: */

View File

@ -191,7 +191,8 @@ enum {
PROP_ENABLE_PRIMARY_PASTE,
PROP_RECENT_FILES_ENABLED,
PROP_LONG_PRESS_TIME,
PROP_KEYNAV_USE_CARET
PROP_KEYNAV_USE_CARET,
PROP_OVERLAY_SCROLLING
};
/* --- prototypes --- */
@ -1002,6 +1003,22 @@ gtk_settings_class_init (GtkSettingsClass *class)
GTK_PARAM_READWRITE),
NULL);
g_assert (result == PROP_KEYNAV_USE_CARET);
/**
* GtkSettings:gtk-overlay-scrolling:
*
* Whether scrolled windows may use overlayed scrolling indicators.
* If this is set to %FALSE, scrolled windows will have permanent
* scrollbars.
*/
result = settings_install_property_parser (class,
g_param_spec_boolean ("gtk-overlay-scrolling",
P_("Whether to use overlay scrollbars"),
P_("Whether to use overlay scrollbars"),
TRUE,
GTK_PARAM_READWRITE),
NULL);
g_assert (result == PROP_OVERLAY_SCROLLING);
}
static GtkSettings *