Skip to content

Commit 39bd63d

Browse files
committed
Added possibility to move the whole range
1 parent 81ee052 commit 39bd63d

File tree

2 files changed

+155
-91
lines changed

2 files changed

+155
-91
lines changed

include/lsp-plug.in/tk/widgets/simple/RangeSlider.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ namespace lsp
9494
CHANGE_BOTH = CHANGE_MIN | CHANGE_MAX
9595
};
9696

97+
enum button_t
98+
{
99+
BTN_MIN,
100+
BTN_MAX,
101+
BTN_RANGE,
102+
BTN_TOTAL
103+
};
104+
97105
protected:
98106
enum flags_t
99107
{
@@ -113,10 +121,10 @@ namespace lsp
113121
uint32_t nButtons;
114122
uint32_t nXFlags;
115123
float fButtonRange;
116-
float fLastValue;
117-
float fCurrValue;
118-
ws::rectangle_t vButtons[2];
119-
ws::rectangle_t *pCurrButton;
124+
float fLastValue[2];
125+
float fCurrValue[2];
126+
ws::rectangle_t vButtons[BTN_TOTAL];
127+
ssize_t nCurrButton;
120128
ws::rectangle_t sHole;
121129

122130
style::RangeSliderColors vColors[RSLIDER_TOTAL];
@@ -141,11 +149,11 @@ namespace lsp
141149
prop::Boolean sInvertMouseVScroll;
142150

143151
protected:
144-
void update_value(float min, float max, size_t flags);
152+
void update_values(const float *values, ssize_t button_id);
145153
void add_values(float delta);
146154
void sync_button_pos();
147155
style::RangeSliderColors *select_colors();
148-
ws::rectangle_t *find_button(const ws::event_t *e);
156+
ssize_t find_button(const ws::event_t *e);
149157

150158
protected:
151159
static status_t slot_begin_edit(Widget *sender, void *ptr, void *data);

0 commit comments

Comments
 (0)