When requesting a size for ArdourButton, the width and height of the
button could be increased by one to ensure the center of the text would
lie exactly at the center of the button.
I initially thought that it was a good idea even when the text used for
sizing was frozen, but the main (and only?) use-case for that is to
actually freeze the size of the button regardless of the actual
displayed text, so jittering by one pixel is not welcome.
Only do the centering tweak if there is no sizing text.
So that the padding and other elements always correctly depend on the
font instead of the default GTK font (which might have a wildly
different size from the fixed size fonts of Ardour's custom theme).
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).
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.
This functor/closure is responsible for stealing focus from any existing text entry (or whatever else may have focus)
when clicking on a CairoWidget or derived class.
The old implementation just gave focus back to the editor canvas. The new version walks up the widget packing
heirarchy to find a focusable parent (from the CairoWidget for which it is invoked). If no focusable parent
is found, it cancels keyboard focus in the toplevel window containing the CairoWidget
If a custom LED color is used, the LED does not
reflect the ExplicitActive state. Hence the
Body Element (if visible) should be used just like
for buttons without LED indicator.