Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasssadar committed Jun 3, 2024
1 parent fdd7ad0 commit b882153
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/builder/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class Button : public Widget, public BuilderMixin<Button, gridui::Button> {
return *this;
}

Button& text(const std::string& text) {
extra().set("text", text);
return *this;
}

Button& fontSize(float fontSize) {
extra().set("fontSize", fontSize);
return *this;
Expand Down
2 changes: 1 addition & 1 deletion src/gridui.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ class _GridUi {
return *newWidget<builder::Select>(x, y, w, h, uuid, tab);
}

private:
template <typename T>
T* newWidget(float x, float y, float w, float h, uint16_t uuid, uint16_t tab) {
static_assert(std::is_base_of<builder::Widget, T>::value, "T must inherit from builder::Widget.");
Expand All @@ -165,6 +164,7 @@ class _GridUi {
return widget;
}

private:
inline WidgetState* stateByUuidLocked(uint16_t uuid) const {
for (auto& itr : m_states) {
if (itr->uuid() == uuid) {
Expand Down

0 comments on commit b882153

Please sign in to comment.