Cosmetics
This commit is contained in:
+6
-5
@@ -31,7 +31,8 @@
|
|||||||
constexpr WindowFlags ROLLER_SEPARATION_LINES = (FORM_FLAGS_LAST << 1u);
|
constexpr WindowFlags ROLLER_SEPARATION_LINES = (FORM_FLAGS_LAST << 1u);
|
||||||
constexpr coord_t SCROLL_POSITION_INVALIDATED = INT_MIN;
|
constexpr coord_t SCROLL_POSITION_INVALIDATED = INT_MIN;
|
||||||
|
|
||||||
class Roller: public Choice {
|
class Roller: public Choice
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
Roller(FormGroup * parent, const rect_t & rect, const char * label, const char * const * values, int16_t vmin, int16_t vmax, std::function<int16_t()> getValue, std::function<void(int16_t)> setValue = nullptr, WindowFlags windowFlags = ROLLER_SEPARATION_LINES):
|
Roller(FormGroup * parent, const rect_t & rect, const char * label, const char * const * values, int16_t vmin, int16_t vmax, std::function<int16_t()> getValue, std::function<void(int16_t)> setValue = nullptr, WindowFlags windowFlags = ROLLER_SEPARATION_LINES):
|
||||||
Choice(parent, rect, values, vmin, vmax, std::move(getValue), std::move(setValue), windowFlags | NO_SCROLLBAR)
|
Choice(parent, rect, values, vmin, vmax, std::move(getValue), std::move(setValue), windowFlags | NO_SCROLLBAR)
|
||||||
@@ -144,15 +145,15 @@ class Roller: public Choice {
|
|||||||
invalidateScrollPosition();
|
invalidateScrollPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
coord_t lastScrollPositionY = SCROLL_POSITION_INVALIDATED;
|
|
||||||
bool lastEditMode = false;
|
|
||||||
|
|
||||||
void invalidateScrollPosition()
|
void invalidateScrollPosition()
|
||||||
{
|
{
|
||||||
lastScrollPositionY = SCROLL_POSITION_INVALIDATED;
|
lastScrollPositionY = SCROLL_POSITION_INVALIDATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
coord_t lastScrollPositionY = SCROLL_POSITION_INVALIDATED;
|
||||||
|
bool lastEditMode = false;
|
||||||
|
|
||||||
void updateScrollPositionFromValue()
|
void updateScrollPositionFromValue()
|
||||||
{
|
{
|
||||||
setScrollPositionY(ROLLER_LINE_HEIGHT * (getIndexFromValue(this->getValue()) - 1));
|
setScrollPositionY(ROLLER_LINE_HEIGHT * (getIndexFromValue(this->getValue()) - 1));
|
||||||
|
|||||||
+1
-1
@@ -347,7 +347,7 @@ class Window {
|
|||||||
|
|
||||||
void detach();
|
void detach();
|
||||||
|
|
||||||
bool deleted()
|
bool deleted() const
|
||||||
{
|
{
|
||||||
return _deleted;
|
return _deleted;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user