Skip to content

Commit

Permalink
fix workflow checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Norlock committed Nov 19, 2023
1 parent f4de1d8 commit 85b6b1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions crates/egui/src/containers/collapsing_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use epaint::Shape;
pub(crate) struct InnerState {
/// Expand / collapse
open: bool,

/// Show / Hide (only used on egui::Window components)
hidden: bool,

Expand Down Expand Up @@ -68,17 +69,17 @@ impl CollapsingState {
ui.ctx().request_repaint();
}

/// Only used on egui::Window components
/// Only used on `egui::Window` components
pub fn is_hidden(&self) -> bool {
self.state.hidden
}

/// Only used on egui::Window components
/// Only used on `egui::Window` components
pub fn toggle_hidden(&mut self) {
self.state.hidden = !self.state.hidden;
}

/// Only used on egui::Window components
/// Only used on `egui::Window` components
pub fn set_hidden(&mut self, hidden: bool) {
self.state.hidden = hidden;
}
Expand Down Expand Up @@ -351,7 +352,7 @@ pub fn paint_default_icon(ui: &mut Ui, openness: f32, response: &Response) {
}

/// A event to expand / collapse the widget automatically
#[derive(PartialEq, Default, Clone, Copy, Debug)]
#[derive(Eq, PartialEq, Default, Clone, Copy, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub enum CollapsingHeaderEvent {
#[default]
Expand Down Expand Up @@ -435,6 +436,7 @@ impl CollapsingHeader {
self
}

#[inline]
pub fn display(mut self, new_event: &mut Option<CollapsingHeaderEvent>) -> Self {
self.display_event = new_event.take();
self
Expand Down
5 changes: 4 additions & 1 deletion crates/egui/src/containers/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub struct Window<'open> {
open: Option<&'open mut bool>,
}

#[derive(PartialEq, Default, Clone, Copy, Debug)]
#[derive(Eq, PartialEq, Default, Clone, Copy, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub enum WindowEvent {
#[default]
Expand Down Expand Up @@ -102,12 +102,14 @@ impl<'open> Window<'open> {
/// * If `*open == false`, the window will not be visible.
/// * If `*open == true`, the window will have a close button.
/// * If the close button is pressed, `*open` will be set to `false`.
#[inline]
pub fn open(mut self, open: &'open mut bool) -> Self {
self.open = Some(open);
self.with_closing_btn = true;
self
}

#[inline]
pub fn closing_button(mut self, closing_button: bool) -> Self {
self.with_closing_btn = closing_button;
self
Expand Down Expand Up @@ -287,6 +289,7 @@ impl<'open> Window<'open> {
self
}

#[inline]
pub fn display_event(mut self, new_event: &mut Option<WindowEvent>) -> Self {
self.display_event = new_event.take();
self
Expand Down

0 comments on commit 85b6b1a

Please sign in to comment.