2023-12-22 19:54:38 +00:00
|
|
|
/*
|
|
|
|
Copyright 2023, Savanni D'Gerinel <savanni@luminescent-dreams.com>
|
|
|
|
|
|
|
|
This file is part of FitnessTrax.
|
|
|
|
|
|
|
|
FitnessTrax is free software: you can redistribute it and/or modify it under the terms of the GNU
|
|
|
|
General Public License as published by the Free Software Foundation, either version 3 of the
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
FitnessTrax is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
|
|
|
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with FitnessTrax. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2023-12-28 17:59:29 +00:00
|
|
|
use gtk::prelude::*;
|
|
|
|
|
2023-12-22 19:54:38 +00:00
|
|
|
mod historical_view;
|
|
|
|
pub use historical_view::HistoricalView;
|
|
|
|
|
|
|
|
mod placeholder_view;
|
|
|
|
pub use placeholder_view::PlaceholderView;
|
|
|
|
|
|
|
|
mod welcome_view;
|
|
|
|
pub use welcome_view::WelcomeView;
|
|
|
|
|
|
|
|
pub enum View {
|
2023-12-28 17:59:29 +00:00
|
|
|
Placeholder(PlaceholderView),
|
|
|
|
Welcome(WelcomeView),
|
|
|
|
Historical(HistoricalView),
|
2023-12-22 19:54:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl View {
|
2023-12-28 17:59:29 +00:00
|
|
|
pub fn widget(&self) -> gtk::Widget {
|
2023-12-22 19:54:38 +00:00
|
|
|
match self {
|
2023-12-28 17:59:29 +00:00
|
|
|
View::Placeholder(widget) => widget.clone().upcast::<gtk::Widget>(),
|
|
|
|
View::Welcome(widget) => widget.clone().upcast::<gtk::Widget>(),
|
|
|
|
View::Historical(widget) => widget.clone().upcast::<gtk::Widget>(),
|
2023-12-22 19:54:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|