visual fixes

This commit is contained in:
MihailRis
2024-02-03 06:08:27 +03:00
parent 9cb3923442
commit 4d54fadd61
4 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -146,8 +146,8 @@ Button* Button::textSupplier(wstringsupplier supplier) {
return this;
}
void Button::setSize(glm::vec2 size) {
Panel::setSize(size);
void Button::refresh() {
Panel::refresh();
if (label) {
label->setSize(size-vec2(padding.z+padding.x, padding.w+padding.y));
}
+2 -2
View File
@@ -82,7 +82,7 @@ namespace gui {
virtual Button* textSupplier(wstringsupplier supplier);
virtual void setSize(glm::vec2 size) override;
virtual void refresh() override;
};
class RichButton : public Container {
@@ -112,7 +112,7 @@ namespace gui {
bool valid = true;
public:
TextBox(std::wstring placeholder,
glm::vec4 padding=glm::vec4(2.0f));
glm::vec4 padding=glm::vec4(4.0f));
virtual std::shared_ptr<UINode> getAt(glm::vec2 pos, std::shared_ptr<UINode> self) override;
+1
View File
@@ -164,6 +164,7 @@ int Panel::getMaxLength() const {
void Panel::setPadding(glm::vec4 padding) {
this->padding = padding;
refresh();
}
glm::vec4 Panel::getPadding() const {