Headerbar: Make the switcher insensitive if empty

If there are no shows/episodes to display, there isn't any point
to being able to hit the switcher.
This commit is contained in:
Jordan Petridis 2018-08-19 14:31:27 +03:00
parent 14d4818867
commit 04161284a7
No known key found for this signature in database
GPG Key ID: E8523968931763BE
2 changed files with 3 additions and 1 deletions

View File

@ -356,6 +356,7 @@ impl App {
// Disable refresh action
.map(|action| action.set_enabled(false));
self.headerbar.switch.set_sensitive(false);
self.content.switch_to_empty_views();
}
Action::PopulatedState => {
@ -365,6 +366,7 @@ impl App {
// Enable refresh action
.map(|action| action.set_enabled(true));
self.headerbar.switch.set_sensitive(true);
self.content.switch_to_populated();
}
}

View File

@ -21,7 +21,7 @@ use i18n::i18n;
// TODO: Make a proper state machine for the headerbar states
pub(crate) struct Header {
pub(crate) container: gtk::HeaderBar,
switch: gtk::StackSwitcher,
pub(crate) switch: gtk::StackSwitcher,
back: gtk::Button,
show_title: gtk::Label,
hamburger: gtk::MenuButton,