mirror of
https://github.com/zoriya/astal.git
synced 2026-06-07 19:50:41 +00:00
add icon-name
This commit is contained in:
@@ -43,6 +43,8 @@ public class PowerProfiles : Object {
|
||||
var map = (HashTable<string, Variant>)props;
|
||||
foreach (var key in map.get_keys()) {
|
||||
notify_property(kebab_case(key));
|
||||
if (key == "ActiveProfile")
|
||||
notify_property("icon-name");
|
||||
}
|
||||
});
|
||||
} catch (Error error){
|
||||
@@ -55,6 +57,10 @@ public class PowerProfiles : Object {
|
||||
set { proxy.active_profile = value; }
|
||||
}
|
||||
|
||||
public string icon_name {
|
||||
owned get { return @"power-profile-$active_profile-symbolic"; }
|
||||
}
|
||||
|
||||
public string[] actions {
|
||||
owned get { return proxy.actions.copy(); }
|
||||
}
|
||||
@@ -153,6 +159,7 @@ public class PowerProfiles : Object {
|
||||
return Json.to_string(new Json.Builder()
|
||||
.begin_object()
|
||||
.set_member_name("active_profile").add_string_value(active_profile)
|
||||
.set_member_name("icon_name").add_string_value(icon_name)
|
||||
.set_member_name("performance_degraded").add_string_value(performance_degraded)
|
||||
.set_member_name("performance_inhibited").add_string_value(performance_inhibited)
|
||||
.set_member_name("actions").add_value(acts.end_array().get_root())
|
||||
|
||||
Reference in New Issue
Block a user