Major refactoring but now centering text and sprites works. See Issue #16 for why only those and not anything else yet.
This commit is contained in:
parent
2c22da022f
commit
9e9b9620c9
6 changed files with 47 additions and 92 deletions
|
@ -141,12 +141,12 @@ struct CalculatorUI {
|
|||
$gui.layout(
|
||||
"[*%(400)stack |_|_|_]"
|
||||
"[*%(400)readout|_|_|_]"
|
||||
"[push|pop|clear|eq]"
|
||||
"[add |sub|mul |div]"
|
||||
"[btn7|btn8|btn9]"
|
||||
"[btn4|btn5|btn6]"
|
||||
"[btn1|btn2|btn3]"
|
||||
"[neg |btn0|del]");
|
||||
"[=push|=pop|=clear|=eq]"
|
||||
"[=add |=sub|=mul |=div]"
|
||||
"[=btn7|=btn8|=btn9]"
|
||||
"[=btn4|=btn5|=btn6]"
|
||||
"[=btn1|=btn2|=btn3]"
|
||||
"[=neg |=btn0|=del]");
|
||||
}
|
||||
|
||||
void init() {
|
||||
|
@ -161,12 +161,12 @@ struct CalculatorUI {
|
|||
$gui.set<guecs::Rectangle>(id, {});
|
||||
|
||||
if(name == "readout") {
|
||||
$gui.set<guecs::Textual>(id, {L"", 40});
|
||||
$gui.set<guecs::Text>(id, {L"", 40});
|
||||
} else if(name == "stack") {
|
||||
$gui.set<guecs::Textual>(id, {L"", 20});
|
||||
$gui.set<guecs::Text>(id, {L"", 20});
|
||||
} else {
|
||||
$gui.set<guecs::Effect>(id, {});
|
||||
$gui.set<guecs::Label>(id, { label });
|
||||
$gui.set<guecs::Text>(id, { label });
|
||||
wchar_t op = label[0];
|
||||
$gui.set<guecs::Clickable>(id, {
|
||||
[&, op](auto, auto) { handle_button(op); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue