Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions data/io.elementary.SettingsDaemon.AccountsService.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
<annotation name="org.freedesktop.Accounts.DefaultValue" value="false"/>
</property>

<property name="WingpanelUseTransparency" type="b" access="readwrite">
<annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>
</property>

<!-- Prefer dark schedule-->

<property name="PreferDarkSchedule" type="i" access="readwrite">
Expand Down
3 changes: 3 additions & 0 deletions src/AccountsService.vala
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public interface SettingsDaemon.AccountsService : Object {
public abstract string monospace_font_name { owned get; set; }
public abstract bool orientation_lock { get; set; }

/* Wingpanel */
public abstract bool wingpanel_use_transparency { get; set; }

/* Prefer Dark Schedule (part of interface settings)*/
/* Last coordinates are reused for Night Light settings */
public abstract Coordinates last_coordinates { get; set; }
Expand Down
18 changes: 17 additions & 1 deletion src/Backends/InterfaceSettings.vala
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,21 @@ public class SettingsDaemon.Backends.InterfaceSettings : GLib.Object {
private const string MONOSPACE_FONT_NAME = "monospace-font-name";

private const string LAST_COORDINATES = "last-coordinates";
private const string ORIENTATION_LOCK = "orientation-lock";
private const string PREFER_DARK_SCHEDULE = "prefer-dark-schedule";
private const string PREFER_DARK_SCHEDULE_FROM = "prefer-dark-schedule-from";
private const string PREFER_DARK_SCHEDULE_TO = "prefer-dark-schedule-to";

private const string ORIENTATION_LOCK = "orientation-lock";
private const string USE_TRANSPARENCY = "use-transparency";

public unowned AccountsService accounts_service { get; construct; }
public unowned DisplayManager.AccountsService display_manager_accounts_service { get; construct; }

private GLib.Settings interface_settings;
private GLib.Settings background_settings;
private GLib.Settings settings_daemon_settings;
private GLib.Settings touchscreen_settings;
private GLib.Settings? wingpanel_settings;

public InterfaceSettings (AccountsService accounts_service, DisplayManager.AccountsService display_manager_accounts_service) {
Object (
Expand All @@ -60,6 +63,11 @@ public class SettingsDaemon.Backends.InterfaceSettings : GLib.Object {
settings_daemon_settings = new GLib.Settings ("io.elementary.settings-daemon.prefers-color-scheme");
touchscreen_settings = new GLib.Settings ("org.gnome.settings-daemon.peripherals.touchscreen");

var wingpanel_schema = SettingsSchemaSource.get_default ().lookup ("io.elementary.desktop.wingpanel", true);
if (wingpanel_schema != null && wingpanel_schema.has_key (USE_TRANSPARENCY)) {
wingpanel_settings = new GLib.Settings ("io.elementary.desktop.wingpanel");
}

sync_gsettings_to_accountsservice ();

interface_settings.changed.connect ((key) => {
Expand Down Expand Up @@ -98,6 +106,10 @@ public class SettingsDaemon.Backends.InterfaceSettings : GLib.Object {
});

touchscreen_settings.changed.connect (sync_gsettings_to_accountsservice);

if (wingpanel_settings != null) {
wingpanel_settings.changed[USE_TRANSPARENCY].connect (sync_gsettings_to_accountsservice);
}
}

private void sync_gsettings_to_accountsservice () {
Expand Down Expand Up @@ -135,6 +147,10 @@ public class SettingsDaemon.Backends.InterfaceSettings : GLib.Object {
accounts_service.prefer_dark_schedule_to = settings_daemon_settings.get_double (PREFER_DARK_SCHEDULE_TO);

accounts_service.orientation_lock = touchscreen_settings.get_boolean (ORIENTATION_LOCK);

if (wingpanel_settings != null) {
accounts_service.wingpanel_use_transparency = wingpanel_settings.get_boolean (USE_TRANSPARENCY);
}
}

private void sync_background_to_greeter () {
Expand Down