From e74cb666ed3c110f404a24ba94d04dbc0c39d402 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 6 Feb 2023 01:27:06 +0100 Subject: [PATCH] Allow to set transparency to 100% Despite what the docs say Gtk::HScale(0,1,s) with a step-size s > 0 has a range [0, 1 - s]. GTKMM does allow for a step-size of zero, which also works around this issue. This works because gtkmm sidesteps gtk_hscale_new_with_range() which would fail with g_return_val_if_fail (step != 0.0, NULL); The reason for this is that gtkmm creates an Adjustment with a page-size = step-size: ``` Adjustment* adjustment = manage(new Adjustment(min, min, max, step, 10 * step, step)); ``` and `gtk_adjustment_configure` limits the range: ``` value = MIN (value, upper - page_size); ``` --- gtk2_ardour/color_theme_manager.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/color_theme_manager.cc b/gtk2_ardour/color_theme_manager.cc index 6eb44a9d1d..38afb10e39 100644 --- a/gtk2_ardour/color_theme_manager.cc +++ b/gtk2_ardour/color_theme_manager.cc @@ -193,7 +193,8 @@ ColorThemeManager::setup_modifiers () for (UIConfiguration::Modifiers::const_iterator m = modifiers.begin(); m != modifiers.end(); ++m) { mod_hbox = manage (new HBox); - mod_scale = manage (new HScale (0.0, 1.0, 0.01)); + Adjustment* adj = manage (new Adjustment (0.0, 0.0, 1.0, 0.01, 0.1, 0)); + mod_scale = manage (new HScale (*adj)); mod_scale->set_draw_value (false); mod_scale->set_value (m->second.a()); mod_scale->set_update_policy (Gtk::UPDATE_DISCONTINUOUS);