diff --git a/include/ui.hpp b/include/ui.hpp index 5d4c8061..514bef59 100644 --- a/include/ui.hpp +++ b/include/ui.hpp @@ -6,7 +6,7 @@ namespace rack { //////////////////// -// Layouts +// Layouts (layouts.cpp) //////////////////// /** Positions children in a row/column based on their widths/heights */ @@ -22,7 +22,10 @@ struct SequentialLayout : virtual Widget { RIGHT_ALIGNMENT, }; Alignment alignment = LEFT_ALIGNMENT; + /** Space outside elements */ float margin = 0.0; + /** Space between adjacent elements */ + float padding = 0.0; void step() override; }; diff --git a/src/app/ModuleBrowser.cpp b/src/app/ModuleBrowser.cpp index 579f1286..52b0e887 100644 --- a/src/app/ModuleBrowser.cpp +++ b/src/app/ModuleBrowser.cpp @@ -49,7 +49,7 @@ struct BrowserListItem : OpaqueWidget { bool selected = false; BrowserListItem() { - box.size.y = 3 * BND_WIDGET_HEIGHT; + box.size.y = 2 * BND_WIDGET_HEIGHT + 7; } void draw(NVGcontext *vg) override { @@ -80,43 +80,42 @@ struct BrowserListItem : OpaqueWidget { struct ModelItem : BrowserListItem { Model *model; - FavoriteRadioButton *favoriteButton; - Label *nameLabel; Label *manufacturerLabel; - Label *tagsLabel; - ModelItem() { - favoriteButton = new FavoriteRadioButton(); - favoriteButton->box.pos = Vec(7, BND_WIDGET_HEIGHT); - favoriteButton->box.size.x = 20; - favoriteButton->label = "★"; - addChild(favoriteButton); + void setModel(Model *model) { + assert(model); + this->model = model; - nameLabel = Widget::create