add 'font' xml property to label, button, bindbox, select, textbox

This commit is contained in:
MihailRis 2026-02-16 02:54:54 +03:00
parent 5505622395
commit b0d9a162ca
9 changed files with 51 additions and 0 deletions

View file

@ -91,6 +91,10 @@ void Button::setTextAlign(Align align) {
}
}
std::shared_ptr<Label> Button::getLabel() const {
return label;
}
Align Button::getTextAlign() const {
if (label) {
return label->getAlign();

View file

@ -30,6 +30,8 @@ namespace gui {
virtual Align getTextAlign() const;
virtual void setTextAlign(Align align);
std::shared_ptr<Label> getLabel() const;
virtual void setText(std::wstring text);
virtual std::wstring getText() const;

View file

@ -38,3 +38,7 @@ void InputBindBox::keyPressed(Keycode key) {
}
defocus();
}
std::shared_ptr<Label> InputBindBox::getLabel() const {
return label;
}

View file

@ -24,5 +24,7 @@ namespace gui {
bool isFocuskeeper() const override {
return true;
}
std::shared_ptr<Label> getLabel() const;
};
}

View file

@ -86,3 +86,7 @@ void SelectBox::drawBackground(const DrawContext& pctx, const Assets&) {
pos.y + size.y / 2.0f + heightHalf
);
}
std::shared_ptr<Label> SelectBox::getLabel() const {
return label;
}

View file

@ -35,5 +35,7 @@ namespace gui {
void setOptions(std::vector<Option>&& options);
void drawBackground(const DrawContext& pctx, const Assets&) override;
std::shared_ptr<Label> getLabel() const;
};
}

View file

@ -1289,3 +1289,7 @@ void TextBox::setMarkup(std::string_view lang) {
const std::string& TextBox::getMarkup() const {
return markup;
}
std::shared_ptr<Label> TextBox::getLabel() const {
return label;
}

View file

@ -255,5 +255,7 @@ namespace gui {
virtual void setMarkup(std::string_view lang);
virtual const std::string& getMarkup() const;
std::shared_ptr<Label> getLabel() const;
};
}