From c16eb8212233e6bfafb944fdd86c7a5405c93061 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 29 Sep 2020 19:12:47 +0200 Subject: [PATCH] Cosmetics --- radio/src/thirdparty/libopenui/src/roller.h | 11 ++++++----- radio/src/thirdparty/libopenui/src/window.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/radio/src/thirdparty/libopenui/src/roller.h b/radio/src/thirdparty/libopenui/src/roller.h index 77a897801..2a44db723 100644 --- a/radio/src/thirdparty/libopenui/src/roller.h +++ b/radio/src/thirdparty/libopenui/src/roller.h @@ -31,7 +31,8 @@ constexpr WindowFlags ROLLER_SEPARATION_LINES = (FORM_FLAGS_LAST << 1u); constexpr coord_t SCROLL_POSITION_INVALIDATED = INT_MIN; -class Roller: public Choice { +class Roller: public Choice +{ public: Roller(FormGroup * parent, const rect_t & rect, const char * label, const char * const * values, int16_t vmin, int16_t vmax, std::function getValue, std::function setValue = nullptr, WindowFlags windowFlags = ROLLER_SEPARATION_LINES): Choice(parent, rect, values, vmin, vmax, std::move(getValue), std::move(setValue), windowFlags | NO_SCROLLBAR) @@ -144,15 +145,15 @@ class Roller: public Choice { invalidateScrollPosition(); } - protected: - coord_t lastScrollPositionY = SCROLL_POSITION_INVALIDATED; - bool lastEditMode = false; - void invalidateScrollPosition() { lastScrollPositionY = SCROLL_POSITION_INVALIDATED; } + protected: + coord_t lastScrollPositionY = SCROLL_POSITION_INVALIDATED; + bool lastEditMode = false; + void updateScrollPositionFromValue() { setScrollPositionY(ROLLER_LINE_HEIGHT * (getIndexFromValue(this->getValue()) - 1)); diff --git a/radio/src/thirdparty/libopenui/src/window.h b/radio/src/thirdparty/libopenui/src/window.h index 2fa1273cb..2f6e9789f 100644 --- a/radio/src/thirdparty/libopenui/src/window.h +++ b/radio/src/thirdparty/libopenui/src/window.h @@ -347,7 +347,7 @@ class Window { void detach(); - bool deleted() + bool deleted() const { return _deleted; }