Style resize handles

We want the draggable area to be larger than the visual appearance, so we added a padding facility to MouseEventHandler that enlarges the "hit area" by the specified padding.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2021-09-07 13:22:21 -06:00
co-authored by Max Brunsfeld
parent 8085e74b98
commit 13143e64a2
4 changed files with 32 additions and 11 deletions
+5
View File
@@ -158,6 +158,11 @@ impl Sidebar {
.with_style(&self.theme(settings).resize_handle)
.boxed()
})
.with_padding(Padding {
left: 4.,
right: 4.,
..Default::default()
})
.with_cursor_style(CursorStyle::ResizeLeftRight)
.on_drag(move |delta, cx| {
let prev_width = *width.borrow();