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:
parent
14d4818867
commit
04161284a7
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user