From 1ca545db5e2a8a4ef858cbb40b4fca56e81334dd Mon Sep 17 00:00:00 2001
From: Colin Fletcher <colin.m.fletcher@googlemail.com>
Date: Sat, 23 Jul 2022 15:40:45 +0100
Subject: [PATCH 1/2] libs/widgets: allow fader to opt out of shift+click
 "reset to default"

Add a tweak value to ArdourFader::Tweaks that will disable the action of
resetting the fader to its default value on shift+click when set.
---
 libs/widgets/ardour_fader.cc        | 3 ++-
 libs/widgets/widgets/ardour_fader.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libs/widgets/ardour_fader.cc b/libs/widgets/ardour_fader.cc
index b414e27883..54e14c9522 100644
--- a/libs/widgets/ardour_fader.cc
+++ b/libs/widgets/ardour_fader.cc
@@ -464,7 +464,8 @@ ArdourFader::on_button_release_event (GdkEventButton* ev)
 				ev_pos = rint(ev_pos);
 
 				if (ev->state & Keyboard::TertiaryModifier) {
-					_adjustment.set_value (_default_value);
+					if (!(tweaks() & NoResetDefault))
+						_adjustment.set_value (_default_value);
 				} else if (ev->state & Keyboard::GainFineScaleModifier) {
 					_adjustment.set_value (_adjustment.get_lower());
 #if 0 // ignore clicks
diff --git a/libs/widgets/widgets/ardour_fader.h b/libs/widgets/widgets/ardour_fader.h
index 31ca47d6c1..9029e5572d 100644
--- a/libs/widgets/widgets/ardour_fader.h
+++ b/libs/widgets/widgets/ardour_fader.h
@@ -49,6 +49,7 @@ public:
 		NoShowUnityLine = 0x1,
 		NoButtonForward = 0x2,
 		NoVerticalScroll = 0x4,
+		NoResetDefault = 0x08,
 	};
 
 	Tweaks tweaks() const { return _tweaks; }
-- 
2.30.2

