1
0
forked from brl/citadel-tools

Updated to use new gsettings keys

This commit is contained in:
Bruce Leidl 2024-06-03 11:56:40 -04:00
parent c79ff22a98
commit 44c545a4a3
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema id="com.subgraph.citadel" path="/com/subgraph/citadel/">
<key name="frame-color-list" type="as">
<key name="label-color-list" type="as">
<default>[
'rgb(153,193,241)',
'rgb(143,240,164)',
@ -14,7 +14,7 @@
<summary />
</key>
<key name="realm-frame-colors" type="as">
<key name="realm-label-colors" type="as">
<default>['main:rgb(153,193,241)']</default>
</key>

View File

@ -68,18 +68,18 @@ impl CitadelSettings {
let list = self.realms.iter().map(|r| r.to_string()).collect::<Vec<String>>();
let realms = list.iter().map(|s| s.as_str()).collect::<Vec<&str>>();
self.settings.set_strv("realm-frame-colors", &realms).is_ok()
self.settings.set_strv("realm-label-colors", &realms).is_ok()
}
pub fn new() -> Self {
let settings = gio::Settings::new("com.subgraph.citadel");
let realms = settings.strv("realm-frame-colors")
let realms = settings.strv("realm-label-colors")
.into_iter()
.flat_map(|gs| RealmFrameColor::try_from(gs.as_str()).ok())
.collect::<Vec<RealmFrameColor>>();
let frame_colors = settings.strv("frame-color-list").into_iter()
let frame_colors = settings.strv("label-color-list").into_iter()
.flat_map(|gs| gs.as_str().parse().ok())
.collect();