Commit Graph

30 Commits

Author SHA1 Message Date
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
Robin Gareus fe63db8697 Ardour Button Toggle explosion
Add option to use ArduorButton as standalone Toggle/Checkbox.
Usually ArdourButton relegates this to Actions or is backed by Config.
This allows to use the Button as standalone Toggle, get_active()
It should maybe be a derived Class, but ArdourButton is already beyond
that..
2018-01-30 19:52:27 +01:00
Robin Gareus 5cbd978735 ArdourButton: honor text-ellipsis width for size-request 2018-01-30 16:27:18 +01:00
Robin Gareus d1183770de ArdourButton: ignore double+tripple clicks 2017-11-29 12:06:42 +01:00
Julien "_FrnchFrgg_" RIVAUD 03f77792dd Remove over-protection
The queued resize will only happen trigger a size-request when the
widget is realized, and on_size_request() calls ensure_layout().

Moreover, this over protection meant that sometimes a resize wasn't
noticed by the button containers.
2017-08-30 20:11:17 +02:00
Robin Gareus 601c317d70 Clean up library inheritance (colors.h, utils.h)
make libwidget independent of libcanvas.
Confine basics to pbd and gtkmm2ext.
2017-07-17 21:06:04 +02:00
Robin Gareus f9e5e4360e Move more Gtkmm2ext widgets into libwidget 2017-07-17 21:06:04 +02:00
Robin Gareus 5c92613698 Separate Ardour UI widgets into dedicated library 2017-07-17 21:06:04 +02:00