diff --git a/src/layout/general_settings.rs b/src/layout/general_settings.rs index f63bc274..e6051566 100644 --- a/src/layout/general_settings.rs +++ b/src/layout/general_settings.rs @@ -50,6 +50,8 @@ pub struct GeneralSettings { pub separators_color: Color, /// The text color to use for text that doesn't specify its own color. pub text_color: Color, + /// Ignore Mouse While Running and Not In Focus + pub mouse_pass_through_while_running: bool, } impl Default for GeneralSettings { @@ -73,6 +75,7 @@ impl Default for GeneralSettings { thin_separators_color: Color::hsla(0.0, 0.0, 1.0, 0.09), separators_color: Color::hsla(0.0, 0.0, 1.0, 0.35), text_color: Color::hsla(0.0, 0.0, 1.0, 1.0), + mouse_pass_through_while_running: false, } } } @@ -173,6 +176,11 @@ impl GeneralSettings { "The color to use for text that doesn't specify its own color.".into(), self.text_color.into(), ), + Field::new( + "Running Ignore Mouse".into(), + "Ignore Mouse While Running and Not In Focus".into(), + self.mouse_pass_through_while_running.into(), + ), ]) } @@ -201,6 +209,7 @@ impl GeneralSettings { 13 => self.thin_separators_color = value.into(), 14 => self.separators_color = value.into(), 15 => self.text_color = value.into(), + 16 => self.mouse_pass_through_while_running = value.into(), _ => panic!("Unsupported Setting Index"), } } diff --git a/src/layout/layout_state.rs b/src/layout/layout_state.rs index 8ec0ace3..345b4ab6 100644 --- a/src/layout/layout_state.rs +++ b/src/layout/layout_state.rs @@ -30,6 +30,8 @@ pub struct LayoutState { pub separators_color: Color, /// The text color to use for text that doesn't specify its own color. pub text_color: Color, + /// Ignore Mouse While Running and Not In Focus + pub mouse_pass_through_while_running: bool, } #[cfg(feature = "std")] diff --git a/src/layout/mod.rs b/src/layout/mod.rs index c187184b..aeffde2e 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -119,6 +119,7 @@ impl Layout { state.separators_color = settings.separators_color; state.text_color = settings.text_color; state.direction = settings.direction; + state.mouse_pass_through_while_running = settings.mouse_pass_through_while_running; } /// Calculates the layout's state based on the timer provided. You can use diff --git a/src/layout/parser/mod.rs b/src/layout/parser/mod.rs index 6cdbfb28..92d34137 100644 --- a/src/layout/parser/mod.rs +++ b/src/layout/parser/mod.rs @@ -779,6 +779,9 @@ fn parse_general_settings(layout: &mut Layout, reader: &mut Reader<'_>) -> Resul }), "ImageOpacity" => percentage(reader, |v| image_opacity = v), "ImageBlur" => percentage(reader, |v| image_blur = v), + "MousePassThroughWhileRunning" => { + parse_bool(reader, |b| settings.mouse_pass_through_while_running = b) + } _ => end_tag(reader), })?;