diff options
Diffstat (limited to 'src/ui/render')
-rw-r--r-- | src/ui/render/ScrollBar.cpp (renamed from src/ui/render/ScrollBarDelegate.cpp) | 12 | ||||
-rw-r--r-- | src/ui/render/ScrollRenderObject.cpp | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/ui/render/ScrollBarDelegate.cpp b/src/ui/render/ScrollBar.cpp index 2814c567..487f0b91 100644 --- a/src/ui/render/ScrollBarDelegate.cpp +++ b/src/ui/render/ScrollBar.cpp @@ -1,4 +1,4 @@ -#include "cru/ui/render/ScrollBarDelegate.hpp" +#include "cru/ui/render/ScrollBar.hpp" #include "../Helper.hpp" #include "cru/common/Base.hpp" @@ -125,12 +125,10 @@ ScrollBarDelegate::ScrollBarDelegate( : render_object_(render_object), horizontal_bar_(render_object), vertical_bar_(render_object) { - horizontal_bar_.ScrollAttemptEvent()->AddHandler([this](float offset) { - this->scroll_attempt_event_.Raise({offset, 0}); - }); - vertical_bar_.ScrollAttemptEvent()->AddHandler([this](float offset) { - this->scroll_attempt_event_.Raise({0, offset}); - }); + horizontal_bar_.ScrollAttemptEvent()->AddHandler( + [this](auto scroll) { this->scroll_attempt_event_.Raise(scroll); }); + vertical_bar_.ScrollAttemptEvent()->AddHandler( + [this](auto scroll) { this->scroll_attempt_event_.Raise(scroll); }); } void ScrollBarDelegate::DrawScrollBar(platform::graphics::IPainter* painter) { diff --git a/src/ui/render/ScrollRenderObject.cpp b/src/ui/render/ScrollRenderObject.cpp index 18b0adbf..a9ec729d 100644 --- a/src/ui/render/ScrollRenderObject.cpp +++ b/src/ui/render/ScrollRenderObject.cpp @@ -3,7 +3,7 @@ #include "cru/platform/graphics/Painter.hpp" #include "cru/platform/graphics/util/Painter.hpp" #include "cru/ui/controls/Control.hpp" -#include "cru/ui/render/ScrollBarDelegate.hpp" +#include "cru/ui/render/ScrollBar.hpp" #include <algorithm> #include <memory> |