mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
add 'font' xml property to label, button, bindbox, select, textbox
This commit is contained in:
parent
5505622395
commit
b0d9a162ca
9 changed files with 51 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,3 +38,7 @@ void InputBindBox::keyPressed(Keycode key) {
|
|||
}
|
||||
defocus();
|
||||
}
|
||||
|
||||
std::shared_ptr<Label> InputBindBox::getLabel() const {
|
||||
return label;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,5 +24,7 @@ namespace gui {
|
|||
bool isFocuskeeper() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<Label> getLabel() const;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue