tweak API for TriggerBoxWidget, allow access to TriggerBoxUI member

This commit is contained in:
Paul Davis 2025-10-25 15:25:48 -06:00
parent 7b5030bdf1
commit 8a66082429
2 changed files with 8 additions and 8 deletions

View file

@ -1130,7 +1130,7 @@ TriggerBoxUI::drag_data_received (Glib::RefPtr<Gdk::DragContext> const& context,
TriggerBoxWidget::TriggerBoxWidget (TriggerStrip& s, float w, float h)
: FittedCanvasWidget (w, h)
, ui (nullptr)
, _ui (nullptr)
, _strip (s)
{
use_intermediate_surface (false);
@ -1140,16 +1140,16 @@ TriggerBoxWidget::TriggerBoxWidget (TriggerStrip& s, float w, float h)
void
TriggerBoxWidget::set_triggerbox (TriggerBox* tb)
{
if (ui) {
root ()->remove (ui);
delete ui;
ui = nullptr;
if (_ui) {
root ()->remove (_ui);
delete _ui;
_ui = nullptr;
}
if (!tb) {
return;
}
ui = new TriggerBoxUI (root (), _strip, *tb);
_ui = new TriggerBoxUI (root (), _strip, *tb);
repeat_size_allocation ();
}

View file

@ -161,9 +161,9 @@ public:
void set_triggerbox (ARDOUR::TriggerBox* tb);
TriggerStrip& strip() const { return _strip; }
TriggerBoxUI* ui() const { return _ui; }
private:
TriggerBoxUI* ui;
TriggerBoxUI* _ui;
TriggerStrip& _strip;
};