summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-01-29 12:35:59 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-01-29 12:35:59 +0100
commit6a28df861112ae4de4d901c6f1bfa49daffde4a7 (patch)
tree9884025da236acb24db4be51037b080d901ee9cb
parentea09a8d5e6957bb98e674c557478f52f32737276 (diff)
gui/mapping-window: adjust x_step in widget depending on zoom level
-rw-r--r--gui/mapping-window.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/gui/mapping-window.cpp b/gui/mapping-window.cpp
index d34fcc48..7e5ad6e3 100644
--- a/gui/mapping-window.cpp
+++ b/gui/mapping-window.cpp
@@ -72,7 +72,8 @@ void MapWidget::load()
if (altp)
{
- connect(qfcs[i].checkbox, &QCheckBox::toggled,
+ connect(&axis.opts.altp,
+ static_cast<void(base_value::*)(bool) const>(&base_value::valueChanged),
this,
[&](bool f) -> void {qfc.setEnabled(f); qfc.force_redraw();});
qfc.setEnabled(qfcs[i].checkbox->isChecked());
@@ -80,13 +81,16 @@ void MapWidget::load()
}
connect(&axis.opts.clamp, static_cast<void(base_value::*)(int) const>(&base_value::valueChanged),
- &qfc, [&conf, &qfc](int value) { conf.set_max_input(value); qfc.reload_spline(); });
- conf.set_max_input(axis.opts.clamp);
+ &qfc, [&conf, &qfc](int value) {
+ conf.set_max_input(value);
+ qfc.reload_spline();
+ qfc.set_x_step(value + 1e-2 >= 90 ? 10 : 5);
+ });
+ // force signal to avoid duplicating the slot's logic
+ axis.opts.clamp.valueChanged(axis.opts.clamp);
if (qfcs[i].axis >= 3)
- {
qfcs[i].qfc->set_snap(1, 2.5);
- }
else
qfcs[i].qfc->set_snap(.5, 1);