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
=== modified file 'src/Views/Wrappers/ViewWrapper.vala'
--- src/Views/Wrappers/ViewWrapper.vala 2013-06-26 21:03:16 +0000
+++ src/Views/Wrappers/ViewWrapper.vala 2014-02-27 05:11:51 +0000
@@ -222,28 +222,26 @@
222222
223 debug ("update_library_window_widgets [%s]", hint.to_string());223 debug ("update_library_window_widgets [%s]", hint.to_string());
224224
225 // Insensitive if there's no media to search225 // Search field
226 226 // Insensitive if there's no media to search (applies to ALERT view)
227 bool has_media = media_count > 0;227 App.main_window.searchField.set_sensitive (media_count > 0);
228 App.main_window.searchField.set_sensitive (has_media);228 // Invisible if the view is WELCOME
229229 App.main_window.searchField.visible = !(current_view == ViewType.WELCOME);
230 // Make the view switcher and search box insensitive if the current item230
231 // is the welcome screen. The view selector will only be sensitive if both231 // View switcher
232 // views are available.232 // Insensitive if the view is ALERT
233 App.main_window.viewSelector.set_sensitive (has_grid_view && has_list_view233 App.main_window.viewSelector.set_sensitive (current_view != ViewType.ALERT);
234 && current_view != ViewType.ALERT234 // Invisible if the current view is the welcome screen or if both views
235 && current_view != ViewType.WELCOME);235 // are not available (in the queue, device, or playlist lists).
236236 App.main_window.viewSelector.visible = (has_grid_view && has_list_view
237 bool column_browser_available = false;237 && current_view != ViewType.WELCOME);
238 bool column_browser_visible = false;238
239239 // Set active mode to column view if it is visible. We have to ensure
240 // Sensitive only if the column browser is available240 // that it is not null because the column_browser is not guaranteed to
241 column_browser_available = list_view.has_column_browser;241 // exist. This is done separately from below because of ViewSelector's
242 if (column_browser_available)242 // poor API.
243 column_browser_visible = list_view.column_browser.visible;243 App.main_window.viewSelector.set_column_browser_toggle_active (list_view.column_browser != null
244244 && list_view.column_browser.visible);
245 App.main_window.viewSelector.set_column_browser_toggle_visible (column_browser_available);
246 App.main_window.viewSelector.set_column_browser_toggle_active (column_browser_visible);
247245
248 // select the right view in the view selector if it's one of the three views.246 // select the right view in the view selector if it's one of the three views.
249 // The order is important here. The sensitivity set above must be set before this,247 // The order is important here. The sensitivity set above must be set before this,

Subscribers

People subscribed via source and target branches