Merge lp:~cameronnemo/noise/fix-1089869 into lp:~elementary-apps/noise/trunk

Proposed by Cameron Norman
Status: Superseded
Proposed branch: lp:~cameronnemo/noise/fix-1089869
Merge into: lp:~elementary-apps/noise/trunk
Diff against target: 52 lines (+20/-22)
1 file modified
src/Views/Wrappers/ViewWrapper.vala (+20/-22)
To merge this branch: bzr merge lp:~cameronnemo/noise/fix-1089869
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+208526@code.launchpad.net

This proposal has been superseded by a proposal from 2014-02-27.

Description of the change

This changes a couple things about the visibility and sensitivity of the search field and view selector.

1: the view selector is invisible if the list view or grid view is unavailable. This fixes #1089869 because the grid view is not available when the queue, device, et al lists are in use, and the view selector is made invisible.

2: the view selector and search field are invisible on the welcome screen.

3: the view selector is insensitive if the alert screen is present but the grid and list views are still available.

To post a comment you must log in.
lp:~cameronnemo/noise/fix-1089869 updated
1560. By Cameron Norman

nitpick for consistency

1561. By Cameron Norman

going with insensitive for all situations

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Views/Wrappers/ViewWrapper.vala'
2--- src/Views/Wrappers/ViewWrapper.vala 2013-06-26 21:03:16 +0000
3+++ src/Views/Wrappers/ViewWrapper.vala 2014-02-27 05:11:51 +0000
4@@ -222,28 +222,26 @@
5
6 debug ("update_library_window_widgets [%s]", hint.to_string());
7
8- // Insensitive if there's no media to search
9-
10- bool has_media = media_count > 0;
11- App.main_window.searchField.set_sensitive (has_media);
12-
13- // Make the view switcher and search box insensitive if the current item
14- // is the welcome screen. The view selector will only be sensitive if both
15- // views are available.
16- App.main_window.viewSelector.set_sensitive (has_grid_view && has_list_view
17- && current_view != ViewType.ALERT
18- && current_view != ViewType.WELCOME);
19-
20- bool column_browser_available = false;
21- bool column_browser_visible = false;
22-
23- // Sensitive only if the column browser is available
24- column_browser_available = list_view.has_column_browser;
25- if (column_browser_available)
26- column_browser_visible = list_view.column_browser.visible;
27-
28- App.main_window.viewSelector.set_column_browser_toggle_visible (column_browser_available);
29- App.main_window.viewSelector.set_column_browser_toggle_active (column_browser_visible);
30+ // Search field
31+ // Insensitive if there's no media to search (applies to ALERT view)
32+ App.main_window.searchField.set_sensitive (media_count > 0);
33+ // Invisible if the view is WELCOME
34+ App.main_window.searchField.visible = !(current_view == ViewType.WELCOME);
35+
36+ // View switcher
37+ // Insensitive if the view is ALERT
38+ App.main_window.viewSelector.set_sensitive (current_view != ViewType.ALERT);
39+ // Invisible if the current view is the welcome screen or if both views
40+ // are not available (in the queue, device, or playlist lists).
41+ App.main_window.viewSelector.visible = (has_grid_view && has_list_view
42+ && current_view != ViewType.WELCOME);
43+
44+ // Set active mode to column view if it is visible. We have to ensure
45+ // that it is not null because the column_browser is not guaranteed to
46+ // exist. This is done separately from below because of ViewSelector's
47+ // poor API.
48+ App.main_window.viewSelector.set_column_browser_toggle_active (list_view.column_browser != null
49+ && list_view.column_browser.visible);
50
51 // select the right view in the view selector if it's one of the three views.
52 // The order is important here. The sensitivity set above must be set before this,

Subscribers

People subscribed via source and target branches