drag for resize hbs
This commit is contained in:
parent
943aa82ec1
commit
db4e30dc6d
|
|
@ -1,3 +1,4 @@
|
||||||
|
use iced_wgpu::core::mouse;
|
||||||
use iced_wgpu::core::{alignment, Background, Border, Element, Length, Padding, Shadow, Theme};
|
use iced_wgpu::core::{alignment, Background, Border, Element, Length, Padding, Shadow, Theme};
|
||||||
use iced_widget::{container, MouseArea};
|
use iced_widget::{container, MouseArea};
|
||||||
|
|
||||||
|
|
@ -284,7 +285,14 @@ impl super::EditorState {
|
||||||
)
|
)
|
||||||
.width(zone_w)
|
.width(zone_w)
|
||||||
.height(zone_h);
|
.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)
|
let area = MouseArea::new(zone)
|
||||||
|
.interaction(cursor)
|
||||||
.on_press(Message::ResizePress { node_id, horiz, vert })
|
.on_press(Message::ResizePress { node_id, horiz, vert })
|
||||||
.on_release(Message::ResizeRelease);
|
.on_release(Message::ResizeRelease);
|
||||||
iced_widget::container(area)
|
iced_widget::container(area)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue