diff options
| author | Aram Drevekenin <aram@poor.dev> | 2026-02-04 11:59:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-04 11:59:21 +0100 |
| commit | 690a1e4506854c1e7637cf4c27f75e39b923972d (patch) | |
| tree | ecedd56de5971abe1db82d83402815e52e9df3b2 /zellij-utils/src/kdl | |
| parent | fix(layout): Correctly handle relative layout paths from CLI (#4664) (diff) | |
| download | sl0ppij-690a1e4506854c1e7637cf4c27f75e39b923972d.tar.gz sl0ppij-690a1e4506854c1e7637cf4c27f75e39b923972d.tar.xz sl0ppij-690a1e4506854c1e7637cf4c27f75e39b923972d.zip | |
Allow resizing panes with the mouse (#4678)
* initial implementation
* improve edge detection
* fix up/down resize increment bug
* temporarily disable alt-mouse grouping
* fix inverting strategies and simplify edge detection
* resize of floating -> ctrl click, resize of tiled -> (ctrl)click
* fix old functionality and tests
* refactor and fixes
* refactor mouse click handling
* move mouse click handling to separate module
* resize scroll up/down with scroll wheel
* tests for scroll resize
* implement hover help
* fix occlusion bug
* allow disabling with config
* fix focus pinned pane on frame
* use strategy invert resize directly rather than function parameter
* remove annoying log message
* cleanups and formatting
* add pr
Diffstat (limited to 'zellij-utils/src/kdl')
3 files changed, 42 insertions, 0 deletions
diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs index 0780aa2a..fb152dd1 100644 --- a/zellij-utils/src/kdl/mod.rs +++ b/zellij-utils/src/kdl/mod.rs @@ -2675,6 +2675,9 @@ impl Options { let advanced_mouse_actions = kdl_property_first_arg_as_bool_or_error!(kdl_options, "advanced_mouse_actions") .map(|(v, _)| v); + let mouse_hover_effects = + kdl_property_first_arg_as_bool_or_error!(kdl_options, "mouse_hover_effects") + .map(|(v, _)| v); let web_server_ip = match kdl_property_first_arg_as_string_or_error!(kdl_options, "web_server_ip") { Some((string, entry)) => Some(IpAddr::from_str(string).map_err(|_| { @@ -2736,6 +2739,7 @@ impl Options { show_startup_tips, show_release_notes, advanced_mouse_actions, + mouse_hover_effects, web_server_ip, web_server_port, web_server_cert, @@ -3839,6 +3843,33 @@ impl Options { None } } + fn mouse_hover_effects_to_kdl(&self, add_comments: bool) -> Option<KdlNode> { + let comment_text = format!( + "{}\n{}\n{}", + " ", + "// Whether to enable mouse hover visual effects (frame highlight and help text)", + "// default is true", + ); + + let create_node = |node_value: bool| -> KdlNode { + let mut node = KdlNode::new("mouse_hover_effects"); + node.push(KdlValue::Bool(node_value)); + node + }; + if let Some(mouse_hover_effects) = self.mouse_hover_effects { + let mut node = create_node(mouse_hover_effects); + if add_comments { + node.set_leading(format!("{}\n", comment_text)); + } + Some(node) + } else if add_comments { + let mut node = create_node(false); + node.set_leading(format!("{}\n// ", comment_text)); + Some(node) + } else { + None + } + } fn web_server_ip_to_kdl(&self, add_comments: bool) -> Option<KdlNode> { let comment_text = format!( "{}\n{}\n{}\n{}", @@ -4044,6 +4075,9 @@ impl Options { if let Some(advanced_mouse_actions) = self.advanced_mouse_actions_to_kdl(add_comments) { nodes.push(advanced_mouse_actions); } + if let Some(mouse_hover_effects) = self.mouse_hover_effects_to_kdl(add_comments) { + nodes.push(mouse_hover_effects); + } if let Some(web_server_ip) = self.web_server_ip_to_kdl(add_comments) { nodes.push(web_server_ip); } diff --git a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string_with_comments.snap b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string_with_comments.snap index 6767921f..2faf486d 100644 --- a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string_with_comments.snap +++ b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string_with_comments.snap @@ -539,6 +539,10 @@ web_client { // default is true // advanced_mouse_actions false +// Whether to enable mouse hover visual effects (frame highlight and help text) +// default is true +// mouse_hover_effects false + // The ip address the web server should listen on when it starts // Default: "127.0.0.1" // (Requires restart) diff --git a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__config_options_to_string_with_comments.snap b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__config_options_to_string_with_comments.snap index 2a6a6a9f..7d45fb9d 100644 --- a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__config_options_to_string_with_comments.snap +++ b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__config_options_to_string_with_comments.snap @@ -252,6 +252,10 @@ web_sharing "disabled" // default is true // advanced_mouse_actions false +// Whether to enable mouse hover visual effects (frame highlight and help text) +// default is true +// mouse_hover_effects false + // The ip address the web server should listen on when it starts // Default: "127.0.0.1" // (Requires restart) |
