Verified Commit 04161284 authored by Jordan Petridis's avatar Jordan Petridis 🌱

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.
parent 14d48188
Pipeline #25716 passed with stages
in 22 minutes and 20 seconds
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment