Merge lp:~philip.scott/granite/hide-legend into lp:~elementary-pantheon/granite/granite

Proposed by Felipe Escoto
Status: Rejected
Rejected by: Danielle Foré
Proposed branch: lp:~philip.scott/granite/hide-legend
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 31 lines (+10/-0)
1 file modified
lib/Widgets/StorageBar.vala (+10/-0)
To merge this branch: bzr merge lp:~philip.scott/granite/hide-legend
Reviewer Review Type Date Requested Status
Danielle Foré Disapprove
Review via email: mp+298375@code.launchpad.net

Commit message

StorageBar: Hide legend if there is only one file type

Description of the change

Hides the legend if the StorageBar only has one file type (such as Other)

To post a comment you must log in.
lp:~philip.scott/granite/hide-legend updated
954. By Felipe Escoto

Hide legend if only one file type

Revision history for this message
Danielle Foré (danrabbit) wrote :

After some discussion (and a new bit of API), it sounds like we don't want this anymore. You can hide the legend by using the new usage part of the API. But when we have explicit file types, we should have the legend for those

review: Disapprove

Unmerged revisions

954. By Felipe Escoto

Hide legend if only one file type

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Widgets/StorageBar.vala'
2--- lib/Widgets/StorageBar.vala 2016-06-24 18:16:08 +0000
3+++ lib/Widgets/StorageBar.vala 2016-06-25 18:08:27 +0000
4@@ -223,10 +223,12 @@
5
6 private void update_size_description () {
7 uint64 user_size = 0;
8+ int displayed_blocks = 0;
9 foreach (weak FillBlock block in blocks.get_values ()) {
10 if (block.visible == false || block == free_space || block == used_space)
11 continue;
12 user_size += block.size;
13+ displayed_blocks++;
14 }
15
16 uint64 free;
17@@ -240,6 +242,14 @@
18
19 free_space.size = free;
20 description_label.label = _("%s free out of %s").printf (GLib.format_size (free), GLib.format_size (storage));
21+
22+ if (displayed_blocks > 1) {
23+ legend_box.visible = true;
24+ legend_box.no_show_all = false;
25+ } else {
26+ legend_box.visible = false;
27+ legend_box.no_show_all = true;
28+ }
29 }
30
31 /**

Subscribers

People subscribed via source and target branches