Skip to content
Open
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
27 changes: 2 additions & 25 deletions src/Views/SystemView/SystemStorageView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -96,34 +96,16 @@ public class Monitor.SystemStorageView : Gtk.Box {
size = H3
};

string size_string = format_size ((uint64) drive.size, IEC_UNITS);
string used_string = format_size ((uint64) (drive.size - drive.free), IEC_UNITS);
string size_string = format_size ((uint64) drive.size);

string drive_block_name_and_size_string = "%s 𐄁 %s / %s".printf (drive.device, used_string, size_string);

if (drive.free == 0) {
drive_block_name_and_size_string = "%s 𐄁 %s".printf (drive.device, size_string);
}
string drive_block_name_and_size_string = "%s 𐄁 %s".printf (drive.device, size_string);

var drive_block_name_and_size_label = new Gtk.Label (drive_block_name_and_size_string) {
halign = START,
margin_bottom = 6
};
drive_block_name_and_size_label.add_css_class (Granite.CssClass.DIM);

var drive_not_mounted_label = new Gtk.Label (_("Not mounted")) {
halign = START
};
drive_not_mounted_label.add_css_class (Granite.CssClass.DIM);

var usagebar = new Gtk.LevelBar () {
max_value = 100.0,
min_value = 0.0,
margin_bottom = 6
};
usagebar.add_css_class (Granite.STYLE_CLASS_FLAT);
usagebar.set_value (100.0 * (drive.size - drive.free) / drive.size);

var drive_box = new Gtk.Box (VERTICAL, 0) {
margin_top = 6,
margin_end = 12,
Expand All @@ -132,11 +114,6 @@ public class Monitor.SystemStorageView : Gtk.Box {
};
drive_box.append (drive_name_label);
drive_box.append (drive_block_name_and_size_label);
if (drive.free == 0) {
drive_box.append (drive_not_mounted_label);
} else {
drive_box.append (usagebar);
}

add_css_class (Granite.CssClass.CARD);
append (drive_box);
Expand Down
Loading