diff --git a/include/ui.hpp b/include/ui.hpp index 7cfc8773..b8f9195f 100644 --- a/include/ui.hpp +++ b/include/ui.hpp @@ -33,21 +33,21 @@ struct SequentialLayout : virtual Widget { struct Label : VirtualWidget { std::string text; + float fontSize; + NVGcolor color; enum Alignment { LEFT_ALIGNMENT, CENTER_ALIGNMENT, RIGHT_ALIGNMENT, }; Alignment alignment = LEFT_ALIGNMENT; - Label() { - box.size.y = BND_WIDGET_HEIGHT; - } + + Label(); void draw(NVGcontext *vg) override; }; struct List : OpaqueWidget { void step() override; - void draw(NVGcontext *vg) override; }; /** Deletes itself from parent when clicked */ diff --git a/src/app/ModuleBrowser.cpp b/src/app/ModuleBrowser.cpp index 938d1704..0de8ce16 100644 --- a/src/app/ModuleBrowser.cpp +++ b/src/app/ModuleBrowser.cpp @@ -5,7 +5,7 @@ #include -#define BND_LABEL_FONT_SIZE 13 +static const float itemMargin = 2.0; namespace rack { @@ -51,13 +51,15 @@ struct FavoriteRadioButton : RadioButton { struct SeparatorItem : OpaqueWidget { SeparatorItem() { - box.size.y = BND_WIDGET_HEIGHT; + box.size.y = 2*BND_WIDGET_HEIGHT + 2*itemMargin; } void setText(std::string text) { clearChildren(); - Label *label = Widget::create