57 Commits

Author SHA1 Message Date
jean-emmanuel
3cd1c0e4b1 Dropdown/Metabutton: fix some scaling issues 2026-01-15 00:39:54 +01:00
jean-emmanuel
a18c8e3287 Dropdown: adjust separator position and use themable outline color 2026-01-15 00:38:29 +01:00
jean-emmanuel
4980efdfa5 Dropdown: move triangle slightly to the left 2026-01-15 00:38:02 +01:00
Paul Davis
9d25f83e21 move UIConfigurationBase from libs/widgets to libs/gtkmm2ext 2025-11-18 13:08:45 -07:00
Robin Gareus
cb64c9a9c1 Update action state when watched controllable changes
This fixes bug, when a button has both a controllable and
a toggle action assigned. Previously only the visual state
was updated.  e.g. monitor section mute button.

When "cut all" was toggled (e.g. Control surface, or a Lua script:
`Session:monitor_out():monitor_control():set_cut_all(true)`,

The action state itself remained unchanged. Also the button
in the application remained unchanged since that button does
not :watch() the controllable.
2025-09-24 17:11:59 +02:00
Robin Gareus
3cc13c1f1e Consolidate ArdourButton layout and size for derivative projects 2025-07-16 13:56:43 +02:00
Robin Gareus
704241dec2 Fix button corner radius math 2025-06-13 02:42:26 +02:00
Ben Loftis
9463eabfe4 Expose corner_mask variable for ArdourButtons 2025-06-10 21:18:36 +02:00
Ben Loftis
b397d48a56 Remove redundant logic for calculating button rg color 2025-06-10 21:18:36 +02:00
Ben Loftis
d9176fd862 Button-sizing Tweak:TransportIcon alternative to ExpandToSquare 2025-06-10 21:18:32 +02:00
Robin Gareus
5a90eb0776 Fix double toggle on repeat call of on_button_release_event
This can happen with touch screens.. leading to
`set_active (!get_active ());` being called twice, and effective NOOP.
2025-04-15 21:48:42 +02:00
Robin Gareus
7e8230c3be Allow touch to tigger act-on-release events 2025-04-10 18:26:23 +02:00
Robin Gareus
f3ec590eb5 Dynamically update ArdourButton indicator
Previously this was semi-random, on_size_request() may be called
in response to some other widget changing size, before a given
ArdourButton DPIReset handler could set _diameter = 0.
2025-03-06 17:02:33 +01:00
Paul Davis
16535e9e1d expand ArdourButton API to expose ::is_led_click() for use by derived classes and owners 2025-02-08 09:28:53 -07:00
Robin Gareus
000c25edcc Update gtkmm -> ytkmm header location (omnibus commit) 2025-02-01 15:25:14 +01:00
Robin Gareus
fb6b64f736 Allow left-click on MetaButton Dropdown indicator 2025-01-28 17:38:38 +01:00
Robin Gareus
d280c46d44 Add API to add sizing-texts to ArdourButton 2025-01-28 07:52:34 +01:00
Robin Gareus
8bf9aefe10 NO-OP: whitespace 2025-01-11 02:38:22 +01:00
Ben Loftis
45265a98ed Allow theming of ardourbutton text so it can be less severe 2025-01-10 23:40:30 +01:00
Ben Loftis
aa04c115c1 Less horizontal padding is better to my eye YMMV 2025-01-10 23:40:10 +01:00
Paul Davis
0133400b8a add ArdourButton::remove_elements() 2024-12-29 14:34:57 -07:00
Paul Davis
228a4931e1 NO-OP: obey code formatting rules and conventions 2024-12-20 10:06:57 -07:00
Robin Gareus
c2b1748de7 Emulate GTK button events for signal-proxy connections 2024-12-12 17:34:44 +01:00
Robin Gareus
2066f7018d ArdourButton: add option to expand buttons to be square 2024-11-10 23:27:30 +01:00
Robin Gareus
24b916d125 Touch Support for Ardour Button 2024-10-24 23:33:31 +02:00
Robin Gareus
74c4ca3e52 Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Mattias Ohlsson
10109c3147 Fix typos 2024-05-07 18:52:02 +02:00
Paul Davis
16ed245977 allow true boxy buttons for ArdourButtons
Also add a default tweaks static member to force all buttons to a given tweak state
2024-04-25 13:03:52 -06:00
jean-emmanuel
f8a2c847b5 ui: correctly implement themable button outline color 2024-01-20 15:38:35 +01:00
jean-emmanuel
08ad1af9dc ui: button: themable outline color instead of hard-coded black 2024-01-20 14:44:30 +01:00
Paul Davis
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Robin Gareus
3d6ecaad79 Allow to override Ardour button text padding 2022-11-09 09:42:50 +01:00
Robin Gareus
8508b3dba4 Allow multiple sizing texts for ArdourButton/Dropdown
A widget's style (font) is only set after the widget has been
packed and inherits relevant information from the top-level window.

`set_size_request_to_display_given_text()` produces incorrect
results when it is called for widgets without a top-level
(here ARDOUR_UI::setup_windows() _main_window.add(), changes the
font from "Sans 11" to "Sans 9" for ArdourDropdowns).

`set_size_request_to_display_given_text()` must subscribe to
`signal_style_changed()`, however in case of ArdourButton UI-scaling
of elements also needs to be taken into account. It is preferable
to allow for multiple sizing-texts directly.
2022-09-20 02:35:26 +02:00
Mads Kiilerich
91b08d5f45 gtkmm: use get_realized() instead of deprecated Gtk::Widget::is_realized() 2022-04-08 20:20:32 +02:00
Ben Loftis
d87b1053df ArdourButton: ColorBox flag is for color-picker buttons 2021-12-30 21:25:39 -06:00
Robin Gareus
5957e14259 Remove unused #include<> (2/2)
PBD::stacktrace() is not used nor needed by default.
It should be used sparingly.
2021-05-05 17:57:16 +02:00
Ben Loftis
6f28d71729 ArdourButton: add flags to force boxy/flat style
Add flags ForceBoxy, ForceFlat for the rectab track header grid
2021-02-22 01:00:06 +01:00
Robin Gareus
d05572e14a Fix round-corner backround of insensitive ArdourWidgets
ArdourButton draws a custom insensitive background, using
the color "gtk_background". This can conflict with gtk's
insensitive background color when using round-corners.
2021-02-14 22:53:18 +01:00
Robin Gareus
2abf9c66a4 Fix size-request that rely on Pango::Layout
A Pango::Layout created by Gtk::Widget::get_pango_context ()
does not have any font set. The Font is inherited from the
layout's context.

The actual font is set when the layout is used in
on_expose_event() via get_window ()->create_cairo_context ().

In some cases we rely on the font-size to calculate the widget's
size before rendering. At this point in time there is no drawing
context from which to inherit the style.

Furthermore, even after a call to `ensure_style()` in the c'tor
of a Widget get_font() simply returns the default value.

All Widgets that rely an Pango::Layout font size during
size-requests have to explicitly set the font.

This fixes various overlarge buttons with the initial default layout.
2021-01-30 02:23:35 +01:00
Robin Gareus
42ac0f1d64 ArdourButton: Render text on pixel boundaries
This fixes some occasional blurry font display when text
was rendered to non-integer pixel positions.
2021-01-27 18:33:03 +01:00
Robin Gareus
70ad205bc1 Separate static widget theme into abstract class
This allow the style to be used in classed that are not
directly derived from Ardour's CairoWidget, notably
container widgets or plugin UIs.
2021-01-26 23:37:54 +01:00
Robin Gareus
e78de225d4 ArdourButton: LED-sized buttons w/o LED
This is useful for consistent layout in the recorder Window,
where Buttons are either push-buttons or LED toggle-buttons.
2021-01-25 19:18:56 +01:00
Robin Gareus
959f83244e Fix ArdourButton text-align when button size grows
This is mainly relevant when the button is placed inside a
Gtk::SizeGroup.
2021-01-21 02:19:06 +01:00
Robin Gareus
b36e6b8341 Optimize drawing of buttons with changing text
When a button has a fixed size, there's no need to call queue_resize().
This fixes an issue with the ArdourClock info displays when slaved.
The Timecode and Delta display text changes in small intervals and
caused excessive CPU load due to GUI size-requests + redraws.
2020-05-12 13:22:11 +02:00
Robin Gareus
7b3ca486a4 Allow to un-set custom Ardour-button colors 2019-09-01 16:57:48 +02:00
Robin Gareus
46bbe83400 Changing active-state needs no color lookup
Colors and patterns are cached, independent of active-state.
This didn't used to be the case in the distant ArdourButton past.
2019-09-01 16:52:24 +02:00
Robin Gareus
09a71b4392 Allow Icon + Text on ArdourButton
Allow placing an icon left of some text in Ardour-button.
This also tweaks some spacing and alignment of Icons when
a LED toggle indicator is used.
2019-08-26 16:04:22 +02:00
Robin Gareus
dfa93e0b17 Tweak Ardourbutton: support (VectorIcon | Indicator) 2019-08-21 01:25:34 +02:00
Robin Gareus
cec5ce8f45 Update canvas/UI lib GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
Robin Gareus
e01582dd9a Prepare a boxy, no round borders, button-style 2018-10-02 21:28:49 +02:00