Updated to use new gsettings keys
This commit is contained in:
parent
c79ff22a98
commit
44c545a4a3
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<schemalist>
|
<schemalist>
|
||||||
<schema id="com.subgraph.citadel" path="/com/subgraph/citadel/">
|
<schema id="com.subgraph.citadel" path="/com/subgraph/citadel/">
|
||||||
<key name="frame-color-list" type="as">
|
<key name="label-color-list" type="as">
|
||||||
<default>[
|
<default>[
|
||||||
'rgb(153,193,241)',
|
'rgb(153,193,241)',
|
||||||
'rgb(143,240,164)',
|
'rgb(143,240,164)',
|
||||||
@ -14,7 +14,7 @@
|
|||||||
<summary />
|
<summary />
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
<key name="realm-frame-colors" type="as">
|
<key name="realm-label-colors" type="as">
|
||||||
<default>['main:rgb(153,193,241)']</default>
|
<default>['main:rgb(153,193,241)']</default>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
@ -68,18 +68,18 @@ impl CitadelSettings {
|
|||||||
|
|
||||||
let list = self.realms.iter().map(|r| r.to_string()).collect::<Vec<String>>();
|
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>>();
|
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 {
|
pub fn new() -> Self {
|
||||||
let settings = gio::Settings::new("com.subgraph.citadel");
|
let settings = gio::Settings::new("com.subgraph.citadel");
|
||||||
|
|
||||||
let realms = settings.strv("realm-frame-colors")
|
let realms = settings.strv("realm-label-colors")
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.flat_map(|gs| RealmFrameColor::try_from(gs.as_str()).ok())
|
.flat_map(|gs| RealmFrameColor::try_from(gs.as_str()).ok())
|
||||||
.collect::<Vec<RealmFrameColor>>();
|
.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())
|
.flat_map(|gs| gs.as_str().parse().ok())
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user