In the normal course of events, an ArdourButton requests just enough
space to display its elements. In particular the size will change when
the text does. Yet, in several cases it is better to avoid layout jittering; until now ArdourButton users manually set a static size on the button at creation time.
Introduce new API to set the text used for measuring the button size
separately from the text that will be displayed. In most cases this
enables the callers to replace
set_size_request_to_display_given_text(button, text, w, h);
where w and h were hard-coded to cater for other button elements, by
button.set_sizing_text(text);
which will make ArdourButton correctly compute the size request in all
cases with its real elements and padding. ArdourButton users can call
button.set_sizing_text("");
to get the size request depend on displayed text (which is the default).
The insensitive state should not get a base color that's the same as the
enabled one, or the difference is not visible enough (only the text
color changes). In fact, since the goal of the entry modifications is to
aid visibility during user input, there is no reason to override the
insensitive colors.
Just inherit the insensitive colors of the global style.
Also fix a comment that was attached to the wrong declaration.
- Holding the constraint modifier at the time of grab gives constrained x.
- Holding the constraint modifier after the grab but before the first motion
constrains to the direction of first movement.
With the same color code as the fader automation button on mixer strips.
This is especially usefull when use_knob is true (e.g. for a-EQ) because
the automation only shows one letter and a "Write" state can thus be
easy to miss.
If for whatever reason a grab is taken (e.g. a menu popping up) while
somebody is pressing a mouse button on an ArdourButton, then the
ArdourButton will not get the mouse button release event and will look
stuck in pressed position.
The leave notify event is fired if the mouse is still on the
ArdourButton while the grab is taken, but not if the user was dragging
the mouse outside of the button.
The only reliable way is to listen for the grab_broken_event signal.
Do so.
Make their popup menus show attached, and on mouse down, but keep the
context menu behavior on middle- and right-click for the group button
that reacted to those (probably an oversight but some users might have
got the habit of right-clicking).
This also makes the group deletion on Ctrl+click happen on mouse down
instead of mouse up which is not a great difference and avoids
complicating the code.
By passing the current text of the automation button we can make the
dropdown menu align with the current mode. This will only work for
full-size automation buttons, not when use-knob is true, but in that
case it feels wrong to popup on top of the button anyway.
Also make the menu show on mouse down like a real dropdown.