-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
702 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use gooey::value::Dynamic; | ||
use gooey::widget::{MakeWidget, WidgetInstance}; | ||
use gooey::widgets::{Button, Label}; | ||
use gooey::window::ThemeMode; | ||
use gooey::Run; | ||
|
||
fn main() -> gooey::Result { | ||
let theme_mode = Dynamic::default(); | ||
set_of_containers(1, theme_mode.clone()) | ||
.into_window() | ||
.with_theme_mode(theme_mode) | ||
.run() | ||
} | ||
|
||
fn set_of_containers(repeat: usize, theme_mode: Dynamic<ThemeMode>) -> WidgetInstance { | ||
let inner = if let Some(remaining_iters) = repeat.checked_sub(1) { | ||
set_of_containers(remaining_iters, theme_mode) | ||
} else { | ||
Button::new("Toggle Theme Mode") | ||
.on_click(move |_| { | ||
theme_mode.map_mut(|mode| mode.toggle()); | ||
}) | ||
.make_widget() | ||
}; | ||
Label::new("Lowest") | ||
.and( | ||
Label::new("Low") | ||
.and( | ||
Label::new("Mid") | ||
.and( | ||
Label::new("High") | ||
.and(Label::new("Highest").and(inner).into_rows().contain()) | ||
.into_rows() | ||
.contain(), | ||
) | ||
.into_rows() | ||
.contain(), | ||
) | ||
.into_rows() | ||
.contain(), | ||
) | ||
.into_rows() | ||
.contain() | ||
.make_widget() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.