Skip to content

Commit

Permalink
fmt and clippy
Browse files Browse the repository at this point in the history
Fix collapse action
  • Loading branch information
Norlock committed Jul 16, 2024
1 parent 5116a19 commit 90b69dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/egui/src/containers/collapsing_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl CollapsingState {
}
WindowAction::Collapse => {
self.state.shown = true;
self.state.expanded = true;
self.state.expanded = false;
}
WindowAction::ToggleShow => {
self.state.shown = !self.state.shown;
Expand Down
10 changes: 7 additions & 3 deletions crates/egui_demo_lib/src/demo/about.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use egui::WindowAction;
use crate::demo::Demo;
use egui::WindowAction;

#[derive(Default)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
Expand All @@ -25,7 +25,12 @@ impl crate::Demo for About {
}

impl About {
pub fn show_action(&mut self, ctx: &egui::Context, open: &mut bool, action: &mut Option<WindowAction>) {
pub fn show_action(
&mut self,
ctx: &egui::Context,
open: &mut bool,
action: &mut Option<WindowAction>,
) {
egui::Window::new(self.name())
.default_width(320.0)
.default_height(480.0)
Expand All @@ -38,7 +43,6 @@ impl About {
self.ui(ui);
});
}

}

impl crate::View for About {
Expand Down
3 changes: 2 additions & 1 deletion crates/egui_demo_lib/src/demo/demo_app_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ impl DemoWindows {

/// Show the open windows.
fn show_windows(&mut self, ctx: &Context) {
self.about.show_action(ctx, &mut self.about_is_open, &mut self.about_window_action);
self.about
.show_action(ctx, &mut self.about_is_open, &mut self.about_window_action);
self.demos.windows(ctx);
self.tests.windows(ctx);
}
Expand Down

0 comments on commit 90b69dc

Please sign in to comment.