Skip to content

Commit cf4213c

Browse files
authored
Don't set Gtk theme (#448)
1 parent e0142bd commit cf4213c

1 file changed

Lines changed: 46 additions & 63 deletions

File tree

src/Views/Appearance.vala

Lines changed: 46 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
*/
2020

2121
public class PantheonShell.Appearance : Switchboard.SettingsPage {
22-
private const string INTERFACE_SCHEMA = "org.gnome.desktop.interface";
23-
private const string STYLESHEET_KEY = "gtk-theme";
24-
private const string STYLESHEET_PREFIX = "io.elementary.stylesheet.";
25-
2622
private enum AccentColor {
2723
NO_PREFERENCE,
2824
RED,
@@ -58,9 +54,9 @@ public class PantheonShell.Appearance : Switchboard.SettingsPage {
5854
return "cocoa";
5955
case GRAY:
6056
return "slate";
57+
default:
58+
return "auto";
6159
}
62-
63-
return "auto";
6460
}
6561
}
6662

@@ -220,68 +216,61 @@ public class PantheonShell.Appearance : Switchboard.SettingsPage {
220216

221217
schedule_manual_radio.bind_property ("active", schedule_manual_box, "sensitive", BindingFlags.SYNC_CREATE);
222218

223-
var interface_settings = new GLib.Settings (INTERFACE_SCHEMA);
224-
var current_stylesheet = interface_settings.get_string (STYLESHEET_KEY);
225-
226-
debug ("Current stylesheet: %s", current_stylesheet);
219+
var blueberry_button = new PrefersAccentColorButton (AccentColor.BLUE);
220+
blueberry_button.tooltip_text = _("Blueberry");
227221

228-
if (current_stylesheet.has_prefix (STYLESHEET_PREFIX)) {
229-
var blueberry_button = new PrefersAccentColorButton (AccentColor.BLUE);
230-
blueberry_button.tooltip_text = _("Blueberry");
222+
var mint_button = new PrefersAccentColorButton (AccentColor.MINT, blueberry_button);
223+
mint_button.tooltip_text = _("Mint");
231224

232-
var mint_button = new PrefersAccentColorButton (AccentColor.MINT, blueberry_button);
233-
mint_button.tooltip_text = _("Mint");
225+
var lime_button = new PrefersAccentColorButton (AccentColor.GREEN, blueberry_button);
226+
lime_button.tooltip_text = _("Lime");
234227

235-
var lime_button = new PrefersAccentColorButton (AccentColor.GREEN, blueberry_button);
236-
lime_button.tooltip_text = _("Lime");
228+
var banana_button = new PrefersAccentColorButton (AccentColor.YELLOW, blueberry_button);
229+
banana_button.tooltip_text = _("Banana");
237230

238-
var banana_button = new PrefersAccentColorButton (AccentColor.YELLOW, blueberry_button);
239-
banana_button.tooltip_text = _("Banana");
231+
var orange_button = new PrefersAccentColorButton (AccentColor.ORANGE, blueberry_button);
232+
orange_button.tooltip_text = _("Orange");
240233

241-
var orange_button = new PrefersAccentColorButton (AccentColor.ORANGE, blueberry_button);
242-
orange_button.tooltip_text = _("Orange");
234+
var strawberry_button = new PrefersAccentColorButton (AccentColor.RED, blueberry_button);
235+
strawberry_button.tooltip_text = _("Strawberry");
243236

244-
var strawberry_button = new PrefersAccentColorButton (AccentColor.RED, blueberry_button);
245-
strawberry_button.tooltip_text = _("Strawberry");
237+
var bubblegum_button = new PrefersAccentColorButton (AccentColor.PINK, blueberry_button);
238+
bubblegum_button.tooltip_text = _("Bubblegum");
246239

247-
var bubblegum_button = new PrefersAccentColorButton (AccentColor.PINK, blueberry_button);
248-
bubblegum_button.tooltip_text = _("Bubblegum");
240+
var grape_button = new PrefersAccentColorButton (AccentColor.PURPLE, blueberry_button);
241+
grape_button.tooltip_text = _("Grape");
249242

250-
var grape_button = new PrefersAccentColorButton (AccentColor.PURPLE, blueberry_button);
251-
grape_button.tooltip_text = _("Grape");
243+
var cocoa_button = new PrefersAccentColorButton (AccentColor.BROWN, blueberry_button);
244+
cocoa_button.tooltip_text = _("Cocoa");
252245

253-
var cocoa_button = new PrefersAccentColorButton (AccentColor.BROWN, blueberry_button);
254-
cocoa_button.tooltip_text = _("Cocoa");
246+
var slate_button = new PrefersAccentColorButton (AccentColor.GRAY, blueberry_button);
247+
slate_button.tooltip_text = _("Slate");
255248

256-
var slate_button = new PrefersAccentColorButton (AccentColor.GRAY, blueberry_button);
257-
slate_button.tooltip_text = _("Slate");
249+
var auto_button = new PrefersAccentColorButton (AccentColor.NO_PREFERENCE, blueberry_button);
250+
auto_button.tooltip_text = _("Automatic based on wallpaper");
258251

259-
var auto_button = new PrefersAccentColorButton (AccentColor.NO_PREFERENCE, blueberry_button);
260-
auto_button.tooltip_text = _("Automatic based on wallpaper");
261-
262-
var accent_box = new Gtk.Box (HORIZONTAL, 6) {
263-
accessible_role = Gtk.AccessibleRole.LIST
264-
};
265-
accent_box.append (blueberry_button);
266-
accent_box.append (mint_button);
267-
accent_box.append (lime_button);
268-
accent_box.append (banana_button);
269-
accent_box.append (orange_button);
270-
accent_box.append (strawberry_button);
271-
accent_box.append (bubblegum_button);
272-
accent_box.append (grape_button);
273-
accent_box.append (cocoa_button);
274-
accent_box.append (slate_button);
275-
accent_box.append (auto_button);
276-
277-
var accent_label = new Granite.HeaderLabel (_("Accent Color")) {
278-
margin_top = 18,
279-
mnemonic_widget = accent_box
280-
};
252+
var accent_box = new Gtk.Box (HORIZONTAL, 6) {
253+
accessible_role = Gtk.AccessibleRole.LIST
254+
};
255+
accent_box.append (blueberry_button);
256+
accent_box.append (mint_button);
257+
accent_box.append (lime_button);
258+
accent_box.append (banana_button);
259+
accent_box.append (orange_button);
260+
accent_box.append (strawberry_button);
261+
accent_box.append (bubblegum_button);
262+
accent_box.append (grape_button);
263+
accent_box.append (cocoa_button);
264+
accent_box.append (slate_button);
265+
accent_box.append (auto_button);
266+
267+
var accent_label = new Granite.HeaderLabel (_("Accent Color")) {
268+
margin_top = 18,
269+
mnemonic_widget = accent_box
270+
};
281271

282-
grid.attach (accent_label, 0, 8, 2);
283-
grid.attach (accent_box, 0, 9, 2);
284-
}
272+
grid.attach (accent_label, 0, 8, 2);
273+
grid.attach (accent_box, 0, 9, 2);
285274

286275
var animations_switch = new Gtk.Switch () {
287276
halign = Gtk.Align.END,
@@ -328,6 +317,7 @@ public class PantheonShell.Appearance : Switchboard.SettingsPage {
328317
animations_settings.set_boolean ("enable-animations", !animations_switch.active);
329318
});
330319

320+
var interface_settings = new GLib.Settings ("org.gnome.desktop.interface");
331321
interface_settings.bind ("overlay-scrolling", scrollbar_switch, "active", INVERT_BOOLEAN);
332322
interface_settings.bind ("enable-animations", animations_switch, "active", INVERT_BOOLEAN);
333323

@@ -360,13 +350,6 @@ public class PantheonShell.Appearance : Switchboard.SettingsPage {
360350
if (!accent_color_action.get_state ().equal (value)) {
361351
accent_color_action.set_state (value);
362352
pantheon_act.prefers_accent_color = value.get_int32 ();
363-
364-
if (value != AccentColor.NO_PREFERENCE) {
365-
interface_settings.set_string (
366-
STYLESHEET_KEY,
367-
STYLESHEET_PREFIX + ((AccentColor) value).to_string ()
368-
);
369-
}
370353
}
371354
});
372355
}

0 commit comments

Comments
 (0)