Skip to content

Commit

Permalink
Refactor UI code for version footer
Browse files Browse the repository at this point in the history
  • Loading branch information
MrEnder0 committed Jan 22, 2024
1 parent 1381e70 commit 60e7f74
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .todo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[ ] Create a version checker
[ ] Create a config system that saves settings
7 changes: 1 addition & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,7 @@ impl eframe::App for MyApp {
ui.add_enabled(allow_preview, egui::Checkbox::new(&mut self.display_rgb_preview, "Display RGB Preview")).on_hover_text("Displays a preview of the lighting, this can be disabled to improve performance");

egui::TopBottomPanel::bottom("footer").show(ctx, |ui| {
ui.horizontal(|ui| {
ui.hyperlink_to(format!(
"Wootili-View {} by Mr.Ender",
env!("CARGO_PKG_VERSION")
), format!("https://github.com/MrEnder0/wootili-view/releases/tag/{}", env!("CARGO_PKG_VERSION")));
});
version_footer(ui);
});

egui::SidePanel::right("lighting_preview_panel").show(ctx, |ui| {
Expand Down
12 changes: 12 additions & 0 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,15 @@ pub fn display_lighting_dimensions(ui: &mut egui::Ui, frame_rgb_size: (u32, u32)
lighting_dimensions
)));
}

pub fn version_footer(ui: &mut egui::Ui) {
ui.horizontal(|ui| {
ui.hyperlink_to(
format!("Wootili-View {} by Mr.Ender", env!("CARGO_PKG_VERSION")),
format!(
"https://github.com/MrEnder0/wootili-view/releases/tag/{}",
env!("CARGO_PKG_VERSION")
),
);
});
}

0 comments on commit 60e7f74

Please sign in to comment.