Use GLib.Settings for appearance (#843)

This commit is contained in:
Daniel Foré 2020-06-20 02:43:16 -07:00 committed by GitHub
parent de379d7875
commit 6aff576247
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 22 deletions

View File

@ -46,7 +46,8 @@ namespace Gala {
construct {
var background_file = GLib.File.new_for_uri ("resource:///io/elementary/desktop/gala/texture.png");
unowned string custom_path = AppearanceSettings.get_default ().workspace_switcher_background;
var appearance_settings = new GLib.Settings (Config.SCHEMA + ".appearance");
var custom_path = appearance_settings.get_string ("workspace-switcher-background");
if (custom_path != "" && FileUtils.test (custom_path, FileTest.IS_REGULAR)) {
background_file = GLib.File.new_for_path (custom_path);
}

View File

@ -33,26 +33,6 @@ namespace Gala {
}
}
public class AppearanceSettings : Granite.Services.Settings {
public string button_layout { get; set; }
public bool attach_modal_dialogs { get; set; }
public bool dim_parents { get; set; }
public string workspace_switcher_background { get; set; }
static AppearanceSettings? instance = null;
private AppearanceSettings () {
base (Config.SCHEMA + ".appearance");
}
public static unowned AppearanceSettings get_default () {
if (instance == null)
instance = new AppearanceSettings ();
return instance;
}
}
public class ShadowSettings : Granite.Services.Settings {
public string[] menu { get; set; }
public string[] normal_focused { get; set; }

View File

@ -1541,7 +1541,8 @@ namespace Gala {
}
});
if (AppearanceSettings.get_default ().dim_parents &&
var appearance_settings = new GLib.Settings (Config.SCHEMA + ".appearance");
if (appearance_settings.get_boolean ("dim-parents") &&
window.window_type == Meta.WindowType.MODAL_DIALOG &&
window.is_attached_dialog ())
dim_window (window.find_root_ancestor (), true);