Merge lp:~larsu/unity-control-center/add-overlay-scrollbar-key into lp:unity-control-center

Proposed by Lars Karlitski
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~larsu/unity-control-center/add-overlay-scrollbar-key
Merge into: lp:unity-control-center
Diff against target: 71 lines (+11/-12)
1 file modified
panels/appearance/cc-appearance-panel.c (+11/-12)
To merge this branch: bzr merge lp:~larsu/unity-control-center/add-overlay-scrollbar-key
Reviewer Review Type Date Requested Status
Lars Karlitski (community) Disapprove
Robert Ancell Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+227758@code.launchpad.net

Commit message

appearance: introduce X-Ubuntu-UseOverlayScrollbars

So that theme authors can opt in to using overlay scrollbars.

Description of the change

appearance: introduce X-Ubuntu-UseOverlayScrollbars

So that theme authors can opt in to using overlay scrollbars.

This should land at the same time as lp:~larsu/ubuntu-themes/use-overlay-scrollbars. Otherwise, overlay-scrollbars will be turned off for Ambiance and Radiance as well.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Looks good, but why did you remove the g_settings_delay / g_settings_apply?

review: Needs Information
Revision history for this message
Lars Karlitski (larsu) wrote :

> Looks good, but why did you remove the g_settings_delay / g_settings_apply?

Because canonical_interface_settings has only ever one key set (the overlay-scrollbar one). delay/apply only makes sense when you set multiple keys at once (to only trigger one write of the dconf db) or when you have a dialog that is not instant-apply.

Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve
Revision history for this message
Lars Karlitski (larsu) wrote :

This is actually not the right place for deciding whether to show overlay-scrollbars. Instead, the overlay scrollbar module should look at the key and only enable itself when the theme supports this. The gsettings key can then be used as a manual override for users.

I've done this at https://code.launchpad.net/~larsu/overlay-scrollbar/only-enable-for-supported-themes

Thanks to Ryan for bringing this to my attention.

review: Disapprove

Unmerged revisions

12786. By Lars Karlitski

appearance: introduce X-Ubuntu-UseOverlayScrollbars

So that theme authors can opt in to using overlay scrollbars.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'panels/appearance/cc-appearance-panel.c'
--- panels/appearance/cc-appearance-panel.c 2014-07-02 09:42:52 +0000
+++ panels/appearance/cc-appearance-panel.c 2014-07-22 14:48:59 +0000
@@ -1261,7 +1261,8 @@
1261 gchar **gtk_theme,1261 gchar **gtk_theme,
1262 gchar **icon_theme,1262 gchar **icon_theme,
1263 gchar **window_theme,1263 gchar **window_theme,
1264 gchar **cursor_theme)1264 gchar **cursor_theme,
1265 gboolean *use_overlay_scrollbars)
1265{1266{
1266 gchar *path;1267 gchar *path;
1267 GKeyFile *theme_file;1268 GKeyFile *theme_file;
@@ -1279,6 +1280,9 @@
1279 *window_theme = g_key_file_get_string (theme_file, "X-GNOME-Metatheme", "MetacityTheme", NULL);1280 *window_theme = g_key_file_get_string (theme_file, "X-GNOME-Metatheme", "MetacityTheme", NULL);
1280 *cursor_theme = g_key_file_get_string (theme_file, "X-GNOME-Metatheme", "CursorTheme", NULL);1281 *cursor_theme = g_key_file_get_string (theme_file, "X-GNOME-Metatheme", "CursorTheme", NULL);
12811282
1283 if (use_overlay_scrollbars)
1284 *use_overlay_scrollbars = g_key_file_get_boolean (theme_file, "X-GNOME-Metatheme", "X-Ubuntu-UseOverlayScrollbars", NULL);
1285
1282 result = TRUE;1286 result = TRUE;
1283 }1287 }
1284 else1288 else
@@ -1298,33 +1302,28 @@
1298{1302{
1299 gint active;1303 gint active;
1300 gchar *gtk_theme, *icon_theme, *window_theme, *cursor_theme;1304 gchar *gtk_theme, *icon_theme, *window_theme, *cursor_theme;
1305 gboolean use_overlay_scrollbars;
13011306
1302 active = gtk_combo_box_get_active (combo);1307 active = gtk_combo_box_get_active (combo);
1303 g_return_if_fail (active >= 0 && active < G_N_ELEMENTS (themes_id));1308 g_return_if_fail (active >= 0 && active < G_N_ELEMENTS (themes_id));
13041309
1305 if (!get_theme_data (gtk_combo_box_get_active_id (combo),1310 if (!get_theme_data (gtk_combo_box_get_active_id (combo),
1306 &gtk_theme, &icon_theme, &window_theme, &cursor_theme))1311 &gtk_theme, &icon_theme, &window_theme, &cursor_theme, &use_overlay_scrollbars))
1307 return;1312 return;
13081313
1309 g_settings_delay (self->priv->interface_settings);1314 g_settings_delay (self->priv->interface_settings);
13101315
1311 if (self->priv->canonical_interface_settings != NULL)
1312 g_settings_delay (self->priv->canonical_interface_settings);
1313
1314 g_settings_set_string (self->priv->interface_settings, "gtk-theme", gtk_theme);1316 g_settings_set_string (self->priv->interface_settings, "gtk-theme", gtk_theme);
1315 g_settings_set_string (self->priv->interface_settings, "icon-theme", icon_theme);1317 g_settings_set_string (self->priv->interface_settings, "icon-theme", icon_theme);
1316 g_settings_set_string (self->priv->interface_settings, "cursor-theme", cursor_theme);1318 g_settings_set_string (self->priv->interface_settings, "cursor-theme", cursor_theme);
1317 g_settings_set_string (self->priv->wm_theme_settings, "theme", window_theme);1319 g_settings_set_string (self->priv->wm_theme_settings, "theme", window_theme);
13181320
1319
1320 /* disable overlay scrollbars for a11y if installed*/
1321 if (self->priv->canonical_interface_settings)1321 if (self->priv->canonical_interface_settings)
1322 {1322 {
1323 if (g_strcmp0 (gtk_theme, "HighContrast") == 0 )1323 if (use_overlay_scrollbars)
1324 g_settings_reset (self->priv->canonical_interface_settings, "scrollbar-mode");
1325 else
1324 g_settings_set_string (self->priv->canonical_interface_settings, "scrollbar-mode", "normal");1326 g_settings_set_string (self->priv->canonical_interface_settings, "scrollbar-mode", "normal");
1325 else
1326 g_settings_reset (self->priv->canonical_interface_settings, "scrollbar-mode");
1327 g_settings_apply (self->priv->canonical_interface_settings);
1328 }1327 }
13291328
1330 g_settings_apply (self->priv->interface_settings);1329 g_settings_apply (self->priv->interface_settings);
@@ -1370,7 +1369,7 @@
1370 gchar *gtk_theme, *icon_theme, *window_theme, *cursor_theme, *new_theme_name;1369 gchar *gtk_theme, *icon_theme, *window_theme, *cursor_theme, *new_theme_name;
1371 GtkTreeIter iter;1370 GtkTreeIter iter;
13721371
1373 if (!get_theme_data (themes_id[i], &gtk_theme, &icon_theme, &window_theme, &cursor_theme))1372 if (!get_theme_data (themes_id[i], &gtk_theme, &icon_theme, &window_theme, &cursor_theme, NULL))
1374 {1373 {
1375 current_theme_index--;1374 current_theme_index--;
1376 continue;1375 continue;

Subscribers

People subscribed via source and target branches