drag for resize hbs

This commit is contained in:
jess 2026-05-10 13:26:21 -07:00
parent 943aa82ec1
commit db4e30dc6d
1 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,4 @@
use iced_wgpu::core::mouse;
use iced_wgpu::core::{alignment, Background, Border, Element, Length, Padding, Shadow, Theme};
use iced_widget::{container, MouseArea};
@ -284,7 +285,14 @@ impl super::EditorState {
)
.width(zone_w)
.height(zone_h);
let cursor = match (horiz, vert) {
(true, true) => mouse::Interaction::ResizingDiagonallyDown,
(true, false) => mouse::Interaction::ResizingHorizontally,
(false, true) => mouse::Interaction::ResizingVertically,
(false, false) => mouse::Interaction::Idle,
};
let area = MouseArea::new(zone)
.interaction(cursor)
.on_press(Message::ResizePress { node_id, horiz, vert })
.on_release(Message::ResizeRelease);
iced_widget::container(area)