Skip to content

Commit

Permalink
bring back displaying memory percentage in the Indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
stsdc committed Mar 14, 2022
1 parent 749f459 commit 1dd2195
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Indicator/Widgets/IndicatorWidget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ public class Monitor.IndicatorWidget : Gtk.Box {

public string icon_name { get; construct; }

public int state_percentage {
public uint state_percentage {
set {
label.label = "%i%%".printf (value);
label.label = "%u%%".printf (value);
label.get_style_context ().remove_class ("monitor-indicator-label-warning");
label.get_style_context ().remove_class ("monitor-indicator-label-critical");

Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Resources.vala
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public class Monitor.Resources : Object {
cpu_percentage = cpu.percentage,
cpu_frequency = cpu.frequency,
cpu_temperature = cpu.temperature_mean,
// memory_percentage = memory.used_percentage,
memory_percentage = memory.used_percentage,
memory_used = memory.used,
memory_total = memory.total,
swap_percentage = swap.percentage,
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/ResourcesSerialized.vala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ public struct ResourcesSerialized {
public int cpu_percentage;
public double cpu_frequency;
public double cpu_temperature;
public int memory_percentage;
public uint memory_percentage;
public double memory_used;
public double memory_total;
public int swap_percentage;
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/Statusbar/Statusbar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class Monitor.Statusbar : Gtk.ActionBar {

public bool update (ResourcesSerialized sysres) {
cpu_usage_label.set_text (("%d%%").printf (sysres.cpu_percentage));
memory_usage_label.set_text (("%d%%").printf (sysres.memory_percentage));
memory_usage_label.set_text (("%u%%").printf (sysres.memory_percentage));

string cpu_tooltip_text = ("%.2f %s").printf (sysres.cpu_frequency, _("GHz"));
cpu_usage_label.tooltip_text = cpu_tooltip_text;
Expand Down

0 comments on commit 1dd2195

Please sign in to comment.