summaryrefslogtreecommitdiff
path: root/Userland/Applications/PixelPaint/LayerListWidget.h
diff options
context:
space:
mode:
authorMarcus Nilsson <brainbomb@gmail.com>2021-09-16 19:05:47 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-16 22:29:21 +0200
commitdc9b18da22821eaacb06bfb1b695698ee3e83f3a (patch)
tree4ce0517fc3e63b7f7282287ab160373e2d2b636b /Userland/Applications/PixelPaint/LayerListWidget.h
parenteec411c50854bc43d5a2c82684d4b080abb1c4ee (diff)
downloadserenity-dc9b18da22821eaacb06bfb1b695698ee3e83f3a.zip
PixelPaint: Implement automatic scrolling in LayerListWidget
The previous implementation of automatic scrolling in LayerListWidget relied on mousemove events to perform the scrolling, which didn't produce the expected behavior. Instead use the new auto scroll timer.
Diffstat (limited to 'Userland/Applications/PixelPaint/LayerListWidget.h')
-rw-r--r--Userland/Applications/PixelPaint/LayerListWidget.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/LayerListWidget.h b/Userland/Applications/PixelPaint/LayerListWidget.h
index 6b16d93912..646773ac71 100644
--- a/Userland/Applications/PixelPaint/LayerListWidget.h
+++ b/Userland/Applications/PixelPaint/LayerListWidget.h
@@ -45,6 +45,7 @@ private:
virtual void image_did_modify_layer_properties(size_t) override;
virtual void image_did_modify_layer_bitmap(size_t) override;
virtual void image_did_modify_layer_stack() override;
+ virtual void on_automatic_scrolling_timer_fired() override;
void rebuild_gadgets();
void relayout_gadgets();
@@ -72,6 +73,8 @@ private:
Optional<size_t> m_moving_gadget_index;
Gfx::IntPoint m_moving_event_origin;
+ Gfx::IntPoint m_automatic_scroll_delta;
+
size_t m_selected_gadget_index { 0 };
};