triggerbox: switch GUI packer from ConstraintPacker to Table (non-functional test platform)

This commit is contained in:
Paul Davis 2021-09-14 16:12:45 -06:00
parent f05bb4afab
commit 46586f3a9d
2 changed files with 6 additions and 25 deletions

View file

@ -54,7 +54,7 @@ static std::vector<std::string> follow_strings;
static std::string longest_follow; static std::string longest_follow;
TriggerUI::TriggerUI (Item* parent, Trigger& t) TriggerUI::TriggerUI (Item* parent, Trigger& t)
: ConstraintPacker (parent) : Table (parent)
, trigger (t) , trigger (t)
{ {
if (follow_strings.empty()) { if (follow_strings.empty()) {
@ -103,29 +103,12 @@ TriggerUI::TriggerUI (Item* parent, Trigger& t)
follow_right = new Widget (canvas(), *_follow_right); follow_right = new Widget (canvas(), *_follow_right);
follow_right->name = "FollowRight"; follow_right->name = "FollowRight";
ConstrainedItem* cfa = add_constrained (follow_action_button);
ConstrainedItem* cfl = add_constrained (follow_left);
ConstrainedItem* cfr = add_constrained (follow_right);
/* sizing */
const double scale = UIConfiguration::instance().get_ui_scale(); const double scale = UIConfiguration::instance().get_ui_scale();
const Distance spacing = 12. * scale; const Distance spacing = 12. * scale;
constrain (this->width == cfa->width() + (2. * spacing)); attach (follow_action_button, { 0, 0 }, { 2, 1 });
constrain (cfa->top() == spacing); attach (follow_left, { 0, 1 }, { 1, 1 });
constrain (cfa->left() == spacing); attach (follow_right, { 0, 1 }, { 2, 1 });
constrain (cfa->height() == 26); /* XXX fix me */
cfl->below (*cfa, spacing);
cfl->same_size_as (*cfr);
cfl->left_aligned_with (*cfa);
cfl->same_height_as (*cfa);
cfl->top_aligned_with (*cfr);
cfr->below (*cfa, spacing);
cfr->right_aligned_with (*cfa);
cfr->right_of (*cfl, spacing);
trigger_changed (); trigger_changed ();
} }

View file

@ -23,7 +23,7 @@
#include "canvas/box.h" #include "canvas/box.h"
#include "canvas/canvas.h" #include "canvas/canvas.h"
#include "canvas/constraint_packer.h" #include "canvas/table.h"
namespace ArdourWidgets { namespace ArdourWidgets {
class ArdourButton; class ArdourButton;
@ -36,7 +36,7 @@ namespace ArdourCanvas {
class Rectangle; class Rectangle;
}; };
class TriggerUI : public ArdourCanvas::ConstraintPacker class TriggerUI : public ArdourCanvas::Table
{ {
public: public:
TriggerUI (ArdourCanvas::Item* parent, ARDOUR::Trigger&); TriggerUI (ArdourCanvas::Item* parent, ARDOUR::Trigger&);
@ -59,8 +59,6 @@ class TriggerUI : public ArdourCanvas::ConstraintPacker
ArdourWidgets::ArdourButton* _follow_right_percentage; ArdourWidgets::ArdourButton* _follow_right_percentage;
ArdourCanvas::Widget* follow_right_percentage; ArdourCanvas::Widget* follow_right_percentage;
ArdourCanvas::ConstraintPacker* follow_upper_box;
ArdourCanvas::Rectangle* percentage_slider; ArdourCanvas::Rectangle* percentage_slider;
ArdourCanvas::Rectangle* follow_count; ArdourCanvas::Rectangle* follow_count;