From 8c8256e4aa517ebd4773432fb194e205824189e3 Mon Sep 17 00:00:00 2001
From: robertwidfen <126524724+robertwidfen@users.noreply.github.com>
Date: Tue, 23 Jun 2026 20:22:22 +0200
Subject: [PATCH] feat: annotation-size-factor with Ctrl mod and climb rate
- Holding Ctrl now changes the step size to 1.0.
- Restore set_climb_rate to 0.1 (previously lost in PR #549).
Thanks to PR #284 for the inspiration, but a climb rate of 1.0
is IMHO a bit too much.
---
README.md | 1 +
src/ui/toolbars.rs | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index ba02d089..cff5ae2e 100644
--- a/README.md
+++ b/README.md
@@ -77,6 +77,7 @@ Minimum is 0.1 and maximum to 99.99.
The bindings are:
- Mouse left-button, wheel and key up/down step size is 0.1
- Holding Shift will switch to 0.01 step size
+- Holding Ctrl will switch to 1.0 step size
- Mouse middle-button and page up/page down step size is 1.0
- Mouse right-button jumps to minimum/maximum
diff --git a/src/ui/toolbars.rs b/src/ui/toolbars.rs
index fbbdda45..7dd42028 100644
--- a/src/ui/toolbars.rs
+++ b/src/ui/toolbars.rs
@@ -527,6 +527,7 @@ impl Component for StyleToolbar {
0.1, 99.99, // min, max
0.1, 1.0, // step sizes
0.0),
+ set_climb_rate: 0.1,
set_numeric: true,
set_digits: 2,
set_width_chars: 4,
@@ -547,13 +548,15 @@ impl Component for StyleToolbar {
if matches!(keyval, Key::Shift_L | Key::Shift_R) {
size_spin_button.adjustment().set_step_increment(0.01);
+ } else if matches!(keyval, Key::Control_L | Key::Control_R) {
+ size_spin_button.adjustment().set_step_increment(1.0);
}
relm4::gtk::glib::Propagation::Proceed
},
connect_key_released[size_spin_button] => move |_, keyval, _, _| {
- if matches!(keyval, Key::Shift_L | Key::Shift_R) {
+ if matches!(keyval, Key::Shift_L | Key::Shift_R| Key::Control_L | Key::Control_R) {
size_spin_button.adjustment().set_step_increment(0.1);
}
},