47 lines
1.3 KiB
Rust
47 lines
1.3 KiB
Rust
|
/*
|
||
|
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/>.
|
||
|
*/
|
||
|
|
||
|
mod historical_view;
|
||
|
pub use historical_view::HistoricalView;
|
||
|
|
||
|
mod placeholder_view;
|
||
|
pub use placeholder_view::PlaceholderView;
|
||
|
|
||
|
mod welcome_view;
|
||
|
pub use welcome_view::WelcomeView;
|
||
|
|
||
|
#[derive(Clone, Debug, PartialEq)]
|
||
|
pub enum ViewName {
|
||
|
Welcome,
|
||
|
Historical,
|
||
|
}
|
||
|
|
||
|
pub enum View {
|
||
|
Placeholder(gtk::Widget),
|
||
|
Welcome(gtk::Widget),
|
||
|
Historical(gtk::Widget),
|
||
|
}
|
||
|
|
||
|
impl View {
|
||
|
pub fn widget<'a>(&'a self) -> &'a gtk::Widget {
|
||
|
match self {
|
||
|
View::Placeholder(widget) => widget,
|
||
|
View::Welcome(widget) => widget,
|
||
|
View::Historical(widget) => widget,
|
||
|
}
|
||
|
}
|
||
|
}
|