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) TriggerBoxWidget::TriggerBoxWidget (TriggerStrip& s, float w, float h)
: FittedCanvasWidget (w, h) : FittedCanvasWidget (w, h)
, ui (nullptr) , _ui (nullptr)
, _strip (s) , _strip (s)
{ {
use_intermediate_surface (false); use_intermediate_surface (false);
@ -1140,16 +1140,16 @@ TriggerBoxWidget::TriggerBoxWidget (TriggerStrip& s, float w, float h)
void void
TriggerBoxWidget::set_triggerbox (TriggerBox* tb) TriggerBoxWidget::set_triggerbox (TriggerBox* tb)
{ {
if (ui) { if (_ui) {
root ()->remove (ui); root ()->remove (_ui);
delete ui; delete _ui;
ui = nullptr; _ui = nullptr;
} }
if (!tb) { if (!tb) {
return; return;
} }
ui = new TriggerBoxUI (root (), _strip, *tb); _ui = new TriggerBoxUI (root (), _strip, *tb);
repeat_size_allocation (); repeat_size_allocation ();
} }

View file

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