Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
<summary>Show Network usage in Wingpanel</summary>
<description></description>
</key>
<key type="b" name="show-perc">
<default>true</default>
<summary>Show percentage for CPU/RAM in Wingpanel</summary>
<description></description>
</key>
<key type="b" name="show-desr">
<default>false</default>
<summary>Show label for CPU/RAM in Wingpanel</summary>
Expand Down
1 change: 1 addition & 0 deletions src/Services/Settings.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class SysMonitor.Services.SettingsManager : Granite.Services.Settings {
public bool show_cpu { set; get; }
public bool show_ram { set; get; }
public bool show_network { set; get; }
public bool show_perc { set; get; }
public bool show_desr { set; get; }
public bool show_graph { set; get; }
public bool show_icon { set; get; }
Expand Down
4 changes: 2 additions & 2 deletions src/Widgets/DisplayWidget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public class SysMonitor.Widgets.DisplayWidget : Gtk.Grid {
}

private void update_cpu_revelear () {
cpu_revealer.reveal_child = settings.show_cpu;
cpu_revealer.reveal_child = settings.show_cpu && settings.show_perc;
}

private void update_cpu_desr_revelear () {
Expand All @@ -166,7 +166,7 @@ public class SysMonitor.Widgets.DisplayWidget : Gtk.Grid {
}

private void update_ram_revealer () {
ram_revealer.reveal_child = settings.show_ram;
ram_revealer.reveal_child = settings.show_ram && settings.show_perc;
}

private void update_ram_desr_revelear () {
Expand Down
12 changes: 8 additions & 4 deletions src/Widgets/SettingsView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class SysMonitor.Widgets.SettingsView : Gtk.Grid {
private Wingpanel.Widgets.Switch show_cpu_switch;
private Wingpanel.Widgets.Switch show_ram_switch;
private Wingpanel.Widgets.Switch show_network_switch;
private Wingpanel.Widgets.Switch show_perc_switch;
private Wingpanel.Widgets.Switch show_desr_switch;
private Wingpanel.Widgets.Switch show_graph_switch;
private Wingpanel.Widgets.Switch show_icon_switch;
Expand All @@ -40,6 +41,7 @@ public class SysMonitor.Widgets.SettingsView : Gtk.Grid {
show_cpu_switch = new Wingpanel.Widgets.Switch (_ ("Display CPU usage"), settings.show_cpu);
show_ram_switch = new Wingpanel.Widgets.Switch (_ ("Display RAM usage"), settings.show_ram);
show_network_switch = new Wingpanel.Widgets.Switch (_ ("Display Network usage"), settings.show_network);
show_perc_switch = new Wingpanel.Widgets.Switch (_ ("Display percentage"), settings.show_perc);
show_desr_switch = new Wingpanel.Widgets.Switch (_ ("Display label"), settings.show_desr);
show_graph_switch = new Wingpanel.Widgets.Switch (_ ("Display graph"), settings.show_graph);
show_icon_switch = new Wingpanel.Widgets.Switch (_ ("Display icon"), settings.show_icon);
Expand All @@ -48,6 +50,7 @@ public class SysMonitor.Widgets.SettingsView : Gtk.Grid {
settings.schema.bind ("show-ram", show_ram_switch.get_switch (), "active", SettingsBindFlags.DEFAULT);
settings.schema.bind ("show-cpu", show_cpu_switch.get_switch (), "active", SettingsBindFlags.DEFAULT);
settings.schema.bind ("show-network", show_network_switch.get_switch (), "active", SettingsBindFlags.DEFAULT);
settings.schema.bind ("show-perc", show_perc_switch.get_switch (), "active", SettingsBindFlags.DEFAULT);
settings.schema.bind ("show-desr", show_desr_switch.get_switch (), "active", SettingsBindFlags.DEFAULT);
settings.schema.bind ("show-graph", show_graph_switch.get_switch (), "active", SettingsBindFlags.DEFAULT);
settings.schema.bind ("show-icon", show_icon_switch.get_switch (), "active", SettingsBindFlags.DEFAULT);
Expand All @@ -56,10 +59,11 @@ public class SysMonitor.Widgets.SettingsView : Gtk.Grid {
attach (show_cpu_switch, 0, 1, 1, 1);
attach (show_ram_switch, 0, 2, 1, 1);
attach (show_network_switch, 0, 3, 1, 1);
attach (show_desr_switch, 0, 4, 1, 1);
attach (show_graph_switch, 0, 5, 1, 1);
attach (show_icon_switch, 0, 6, 1, 1);
attach (network_in_bits_switch, 0, 7, 1, 1);
attach (show_perc_switch, 0, 4, 1, 1);
attach (show_desr_switch, 0, 5, 1, 1);
attach (show_graph_switch, 0, 6, 1, 1);
attach (show_icon_switch, 0, 7, 1, 1);
attach (network_in_bits_switch, 0, 8, 1, 1);
}
}