This commit is contained in:
MihailRis
2023-12-19 20:10:09 +03:00
parent b4caf888dc
commit c9db1acd91
6 changed files with 227 additions and 221 deletions
+3 -1
View File
@@ -64,7 +64,9 @@ Button::Button(shared_ptr<UINode> content, glm::vec4 padding) : Panel(vec2(32,32
scrollable(false);
}
Button::Button(wstring text, glm::vec4 padding) : Panel(vec2(32,32), padding, 0) {
Button::Button(wstring text, glm::vec4 padding, glm::vec4 margin)
: Panel(vec2(32,32), padding, 0) {
this->margin(margin);
Label* label = new Label(text);
label->align(Align::center);
this->label = shared_ptr<UINode>(label);
+3 -1
View File
@@ -48,7 +48,9 @@ namespace gui {
std::shared_ptr<UINode> label = nullptr;
public:
Button(std::shared_ptr<UINode> content, glm::vec4 padding=glm::vec4(2.0f));
Button(std::wstring text, glm::vec4 padding=glm::vec4(2.0f));
Button(std::wstring text,
glm::vec4 padding=glm::vec4(2.0f),
glm::vec4 margin=glm::vec4(1.0f));
virtual void drawBackground(Batch2D* batch, Assets* assets);
+1
View File
@@ -19,6 +19,7 @@ Button* guiutil::backButton(PagesControl* menu) {
}
Button* guiutil::gotoButton(wstring text, string page, PagesControl* menu) {
text = langs::get(text, L"menu");
return (new Button(text, vec4(10.f)))->listenAction([=](GUI* gui) {
menu->set(page);
});