summaryrefslogtreecommitdiffhomepage
path: root/options
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-10-18 17:58:37 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-10-19 14:46:27 +0200
commit562785b09f4641dd71eb36d36bd92c945e0bd7cf (patch)
tree0d0f8b6b3c69cc870a6cd61028d237c746747ed3 /options
parentd4eed6d0e23dc385c24ebdbc46628e24ac42982e (diff)
options/tie: output slider_value after truncation error
Diffstat (limited to 'options')
-rw-r--r--options/tie.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/options/tie.hpp b/options/tie.hpp
index a47dbd3d..accd958e 100644
--- a/options/tie.hpp
+++ b/options/tie.hpp
@@ -154,12 +154,18 @@ inline void tie_setting(value<slider_value>& v, QSlider* w)
base_value::connect(w,
&QSlider::valueChanged,
&v,
- [=, &v](int pos) { v = v->update_from_slider(pos, q_min, q_max); },
+ [=, &v](int pos) {
+ v = v->update_from_slider(pos, q_min, q_max);
+ w->setValue(v->to_slider_pos(q_min, q_max));
+ },
v.DIRECT_CONNTYPE);
base_value::connect(&v,
static_cast<void(base_value::*)(double) const>(&base_value::valueChanged),
w,
- [=, &v](double) { w->setValue(v->to_slider_pos(q_min, q_max)); },
+ [=, &v](double) {
+ w->setValue(v->to_slider_pos(q_min, q_max));
+ v = v->update_from_slider(w->value(), q_min, q_max);
+ },
v.SAFE_CONNTYPE);
}