mirror of
https://github.com/elementary/gala.git
synced 2024-11-23 20:07:21 +03:00
Use GLib.Settings for appearance (#843)
This commit is contained in:
parent
de379d7875
commit
6aff576247
@ -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);
|
||||
}
|
||||
|
@ -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; }
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user