From d931f4f69da478fca17257b1725ac68f9b8dc1b7 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 23 Sep 2017 19:40:55 +0200 Subject: The beginning of the end for ClickBox This fixes various issues with integer controls (some values are not reachable due to incorrect rounding in AutoSpin) and also pulls in the various benefits of BarController: * mouse-drags * numeric entry * alternative entry modes (piano-keyboard, tempo-based values) If this style remains, ClickBox & AutoSpin should be removed from the codebase. --- gtk2_ardour/generic_pluginui.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index e1a737444d..e01a367559 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -1014,7 +1014,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param, Adjustment* adj = control_ui->controller->adjustment(); - if (desc.integer_step && !desc.toggled) { + if (false /* desc.integer_step && !desc.toggled */) { control_ui->clickbox = new ArdourWidgets::ClickBox (adj, "PluginUIClickBox", true); Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->clickbox, "g9999999", 2, 2); if (desc.unit == ParameterDescriptor::MIDI_NOTE) { @@ -1034,6 +1034,11 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param, } else { control_ui->controller->set_size_request (200, -1); control_ui->controller->set_name (X_("ProcessorControlSlider")); + if (desc.integer_step) { + AutomationBarController* abc = dynamic_cast (control_ui->controller->widget ()); + assert (abc); + abc->set_digits (0); + } } if (!desc.integer_step && !desc.toggled && use_knob) { -- cgit v1.2.3