This commit is contained in:
2026-08-02 13:11:42 +03:00
parent 4f043fc1c0
commit 0e40f7f1cd
14 changed files with 716 additions and 219 deletions
+226 -112
View File
@@ -3,17 +3,46 @@ export struct BitInfo {
index: int,
}
export global UiStyle {
in-out property <int> size: 2;
in-out property <int> theme: 0;
in-out property <color> bg: #202020;
in-out property <color> surface: #2a2a2a;
in-out property <color> btn: #323232;
in-out property <color> btn-hover: #464646;
in-out property <color> digit: #3b3b3b;
in-out property <color> digit-hover: #505050;
in-out property <color> accent: #60cdff;
in-out property <color> accent-hover: #78d7ff;
in-out property <color> text: #ffffff;
in-out property <color> text-muted: #c8c8c8;
in-out property <color> text-dim: #9a9a9a;
in-out property <color> menu-active: #2f3a42;
in-out property <color> eq-text: #141414;
in-out property <color> border: #404040;
in-out property <length> btn-h: UiStyle.size == 1 ? 34px : (UiStyle.size == 3 ? 52px : 42px);
in-out property <length> btn-h-sm: UiStyle.size == 1 ? 28px : (UiStyle.size == 3 ? 40px : 32px);
in-out property <length> mem-h: UiStyle.size == 1 ? 26px : (UiStyle.size == 3 ? 38px : 32px);
in-out property <length> tab-h: UiStyle.size == 1 ? 26px : (UiStyle.size == 3 ? 34px : 30px);
in-out property <length> font-sm: UiStyle.size == 1 ? 12px : (UiStyle.size == 3 ? 15px : 13px);
in-out property <length> font-md: UiStyle.size == 1 ? 13px : (UiStyle.size == 3 ? 16px : 14px);
in-out property <length> font-digit: UiStyle.size == 1 ? 14px : (UiStyle.size == 3 ? 18px : 16px);
in-out property <length> font-eq: UiStyle.size == 1 ? 16px : (UiStyle.size == 3 ? 20px : 18px);
}
component BitCell inherits Rectangle {
callback toggled();
in property <bool> on;
width: 14px;
height: 16px;
border-radius: 2px;
background: touch.has-hover ? #3a4550 : transparent;
background: touch.has-hover ? UiStyle.menu-active : transparent;
Text {
text: root.on ? "1" : "0";
color: root.on ? #60cdff : #6a6a6a;
color: root.on ? UiStyle.accent : UiStyle.text-dim;
font-size: 10px;
font-weight: 700;
font-family: "Cascadia Mono, Consolas, DejaVu Sans Mono, monospace";
@@ -78,14 +107,14 @@ component BitLine inherits Rectangle {
component MemBtn inherits Rectangle {
callback clicked();
in property <string> label;
height: 32px;
background: touch.has-hover ? #323232 : transparent;
height: UiStyle.mem-h;
background: touch.has-hover ? UiStyle.btn : transparent;
border-radius: 4px;
Text {
text: root.label;
color: #c8c8c8;
font-size: 13px;
color: UiStyle.text-muted;
font-size: UiStyle.font-sm;
horizontal-alignment: center;
vertical-alignment: center;
}
@@ -99,16 +128,16 @@ component FuncBtn inherits Rectangle {
callback clicked();
in property <string> label;
in property <bool> enabled: true;
in property <length> min-h: 42px;
background: !root.enabled ? #2a2a2a : (touch.has-hover ? #464646 : #323232);
in property <length> min-h: UiStyle.btn-h;
background: !root.enabled ? UiStyle.surface : (touch.has-hover ? UiStyle.btn-hover : UiStyle.btn);
border-radius: 4px;
min-height: root.min-h;
opacity: root.enabled ? 1.0 : 0.45;
Text {
text: root.label;
color: white;
font-size: 14px;
color: UiStyle.text;
font-size: UiStyle.font-md;
horizontal-alignment: center;
vertical-alignment: center;
}
@@ -123,16 +152,16 @@ component DigitBtn inherits Rectangle {
callback clicked();
in property <string> label;
in property <bool> enabled: true;
in property <length> min-h: 42px;
background: !root.enabled ? #2a2a2a : (touch.has-hover ? #505050 : #3b3b3b);
in property <length> min-h: UiStyle.btn-h;
background: !root.enabled ? UiStyle.surface : (touch.has-hover ? UiStyle.digit-hover : UiStyle.digit);
border-radius: 4px;
min-height: root.min-h;
opacity: root.enabled ? 1.0 : 0.4;
Text {
text: root.label;
color: white;
font-size: 16px;
color: UiStyle.text;
font-size: UiStyle.font-digit;
font-weight: 600;
horizontal-alignment: center;
vertical-alignment: center;
@@ -146,15 +175,15 @@ component DigitBtn inherits Rectangle {
component EqBtn inherits Rectangle {
callback clicked();
in property <length> min-h: 42px;
background: touch.has-hover ? #78d7ff : #60cdff;
in property <length> min-h: UiStyle.btn-h;
background: touch.has-hover ? UiStyle.accent-hover : UiStyle.accent;
border-radius: 4px;
min-height: root.min-h;
Text {
text: "=";
color: #141414;
font-size: 18px;
color: UiStyle.eq-text;
font-size: UiStyle.font-eq;
font-weight: 700;
horizontal-alignment: center;
vertical-alignment: center;
@@ -170,11 +199,11 @@ component MenuRow inherits Rectangle {
in property <string> label;
in property <bool> active;
height: 36px;
background: root.active ? #2f3a42 : (touch.has-hover ? #323232 : transparent);
background: root.active ? UiStyle.menu-active : (touch.has-hover ? UiStyle.btn : transparent);
Text {
text: root.label;
color: root.active ? #60cdff : #e0e0e0;
color: root.active ? UiStyle.accent : UiStyle.text;
font-size: 14px;
font-weight: root.active ? 700 : 500;
vertical-alignment: center;
@@ -193,14 +222,14 @@ component ModeTab inherits Rectangle {
callback clicked();
in property <string> label;
in property <bool> active;
height: 30px;
height: UiStyle.tab-h;
border-radius: 4px;
background: root.active ? #3b3b3b : (touch.has-hover ? #2c2c2c : transparent);
background: root.active ? UiStyle.btn : (touch.has-hover ? UiStyle.surface : transparent);
Text {
text: root.label;
color: root.active ? #60cdff : #c8c8c8;
font-size: 13px;
color: root.active ? UiStyle.accent : UiStyle.text-muted;
font-size: UiStyle.font-sm;
font-weight: root.active ? 700 : 500;
horizontal-alignment: center;
vertical-alignment: center;
@@ -325,12 +354,14 @@ export component AppWindow inherits Window {
preferred-height: 640px;
min-width: 380px;
min-height: 520px;
background: #202020;
background: UiStyle.bg;
// 0=standard 1=engineering 2=programmer 3=convert 4=crc
// 0=standard 1=engineering 2=programmer 3=convert 4=crc 5=settings
in-out property <int> mode: 0;
in-out property <bool> menu-open: false;
in property <string> mode-title: "Standard";
in property <int> cfg-button-size: 2;
in property <int> cfg-theme: 0;
in property <string> display-text: "0";
in property <string> expression-text: "";
@@ -414,7 +445,7 @@ export component AppWindow inherits Window {
width: 34px;
height: 34px;
border-radius: 4px;
background: menu-touch.has-hover || root.menu-open ? #3b3b3b : transparent;
background: menu-touch.has-hover || root.menu-open ? UiStyle.btn : transparent;
// Drawn icon — Unicode ☰ is missing in many Windows fonts.
VerticalLayout {
@@ -424,9 +455,9 @@ export component AppWindow inherits Window {
padding-right: 8px;
spacing: 4px;
Rectangle { height: 2px; background: #e8e8e8; border-radius: 1px; }
Rectangle { height: 2px; background: #e8e8e8; border-radius: 1px; }
Rectangle { height: 2px; background: #e8e8e8; border-radius: 1px; }
Rectangle { height: 2px; background: UiStyle.text; border-radius: 1px; }
Rectangle { height: 2px; background: UiStyle.text; border-radius: 1px; }
Rectangle { height: 2px; background: UiStyle.text; border-radius: 1px; }
}
menu-touch := TouchArea {
@@ -444,14 +475,14 @@ export component AppWindow inherits Window {
x: 0;
y: 38px;
width: 210px;
height: 220px;
height: 260px;
close-on-click: true;
Rectangle {
background: #2a2a2a;
background: UiStyle.surface;
border-radius: 6px;
border-width: 1px;
border-color: #404040;
border-color: UiStyle.border;
VerticalLayout {
padding: 6px;
@@ -502,6 +533,15 @@ export component AppWindow inherits Window {
mode-menu.close();
}
}
MenuRow {
label: "Settings";
active: root.mode == 5;
clicked => {
root.press("mode:settings");
root.menu-open = false;
mode-menu.close();
}
}
}
}
}
@@ -509,7 +549,7 @@ export component AppWindow inherits Window {
Text {
text: root.mode-title;
color: white;
color: UiStyle.text;
font-size: 18px;
font-weight: 700;
vertical-alignment: center;
@@ -521,7 +561,7 @@ export component AppWindow inherits Window {
height: 18px;
Text {
text: root.has-memory && (root.mode == 0 || root.mode == 1) ? "M" : "";
color: #b4b4b4;
color: UiStyle.text-muted;
font-size: 12px;
horizontal-alignment: left;
vertical-alignment: center;
@@ -529,13 +569,13 @@ export component AppWindow inherits Window {
}
Text {
text: root.mode == 2 ? root.word-size-label : "";
color: #60cdff;
color: UiStyle.accent;
font-size: 11px;
vertical-alignment: center;
}
Text {
text: root.expression-text;
color: #aaaaaa;
color: UiStyle.text-dim;
font-size: 13px;
horizontal-alignment: right;
vertical-alignment: center;
@@ -544,7 +584,7 @@ export component AppWindow inherits Window {
if root.mode == 0 || root.mode == 1 || root.mode == 2: Text {
text: root.display-text;
color: white;
color: UiStyle.text;
font-size: root.mode == 2 ? 28px : 34px;
font-weight: 700;
horizontal-alignment: right;
@@ -1141,85 +1181,85 @@ export component AppWindow inherits Window {
spacing: 4px;
Row {
FuncBtn {
min-h: 32px;
min-h: UiStyle.btn-h-sm;
label: root.eng-second ? "2nd●" : "2nd";
clicked => { root.press("eng:2nd"); }
}
FuncBtn { min-h: 32px; label: "π"; clicked => { root.press("eng:pi"); } }
FuncBtn { min-h: 32px; label: "e"; clicked => { root.press("eng:e"); } }
FuncBtn { min-h: 32px; label: "C"; clicked => { root.press("C"); } }
FuncBtn { min-h: 32px; label: "⌫"; clicked => { root.press("BS"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "π"; clicked => { root.press("eng:pi"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "e"; clicked => { root.press("eng:e"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "C"; clicked => { root.press("C"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "⌫"; clicked => { root.press("BS"); } }
}
Row {
FuncBtn {
min-h: 32px;
min-h: UiStyle.btn-h-sm;
label: root.eng-second ? "sin⁻¹" : "sin";
clicked => { root.press(root.eng-second ? "eng:asin" : "eng:sin"); }
}
FuncBtn {
min-h: 32px;
min-h: UiStyle.btn-h-sm;
label: root.eng-second ? "cos⁻¹" : "cos";
clicked => { root.press(root.eng-second ? "eng:acos" : "eng:cos"); }
}
FuncBtn {
min-h: 32px;
min-h: UiStyle.btn-h-sm;
label: root.eng-second ? "tan⁻¹" : "tan";
clicked => { root.press(root.eng-second ? "eng:atan" : "eng:tan"); }
}
FuncBtn {
min-h: 32px;
min-h: UiStyle.btn-h-sm;
label: root.eng-second ? "³√x" : "√x";
clicked => { root.press(root.eng-second ? "eng:cbrt" : "eng:sqrt"); }
}
FuncBtn { min-h: 32px; label: "÷"; clicked => { root.press("/"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "÷"; clicked => { root.press("/"); } }
}
Row {
FuncBtn {
min-h: 32px;
min-h: UiStyle.btn-h-sm;
label: root.eng-second ? "x³" : "x²";
clicked => { root.press(root.eng-second ? "eng:cube" : "eng:sq"); }
}
FuncBtn { min-h: 32px; label: "1/x"; clicked => { root.press("eng:inv"); } }
FuncBtn { min-h: 32px; label: "|x|"; clicked => { root.press("eng:abs"); } }
FuncBtn { min-h: 32px; label: "n!"; clicked => { root.press("eng:fact"); } }
FuncBtn { min-h: 32px; label: "×"; clicked => { root.press("*"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "1/x"; clicked => { root.press("eng:inv"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "|x|"; clicked => { root.press("eng:abs"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "n!"; clicked => { root.press("eng:fact"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "×"; clicked => { root.press("*"); } }
}
Row {
FuncBtn { min-h: 32px; label: "x^y"; clicked => { root.press("^"); } }
FuncBtn { min-h: 32px; label: "("; clicked => { root.press("("); } }
FuncBtn { min-h: 32px; label: ")"; clicked => { root.press(")"); } }
FuncBtn { min-h: 32px; label: "CE"; clicked => { root.press("CE"); } }
FuncBtn { min-h: 32px; label: "−"; clicked => { root.press("-"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "x^y"; clicked => { root.press("^"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "("; clicked => { root.press("("); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: ")"; clicked => { root.press(")"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "CE"; clicked => { root.press("CE"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "−"; clicked => { root.press("-"); } }
}
Row {
FuncBtn {
min-h: 32px;
min-h: UiStyle.btn-h-sm;
label: root.eng-second ? "eˣ" : "10ˣ";
clicked => { root.press(root.eng-second ? "eng:exp" : "eng:tenpow"); }
}
DigitBtn { min-h: 32px; label: "7"; clicked => { root.press("7"); } }
DigitBtn { min-h: 32px; label: "8"; clicked => { root.press("8"); } }
DigitBtn { min-h: 32px; label: "9"; clicked => { root.press("9"); } }
FuncBtn { min-h: 32px; label: "+"; clicked => { root.press("+"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "7"; clicked => { root.press("7"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "8"; clicked => { root.press("8"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "9"; clicked => { root.press("9"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "+"; clicked => { root.press("+"); } }
}
Row {
FuncBtn { min-h: 32px; label: "log"; clicked => { root.press("eng:log"); } }
DigitBtn { min-h: 32px; label: "4"; clicked => { root.press("4"); } }
DigitBtn { min-h: 32px; label: "5"; clicked => { root.press("5"); } }
DigitBtn { min-h: 32px; label: "6"; clicked => { root.press("6"); } }
DigitBtn { min-h: 32px; label: "±"; clicked => { root.press("neg"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "log"; clicked => { root.press("eng:log"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "4"; clicked => { root.press("4"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "5"; clicked => { root.press("5"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "6"; clicked => { root.press("6"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "±"; clicked => { root.press("neg"); } }
}
Row {
FuncBtn { min-h: 32px; label: "ln"; clicked => { root.press("eng:ln"); } }
DigitBtn { min-h: 32px; label: "1"; clicked => { root.press("1"); } }
DigitBtn { min-h: 32px; label: "2"; clicked => { root.press("2"); } }
DigitBtn { min-h: 32px; label: "3"; clicked => { root.press("3"); } }
EqBtn { min-h: 32px; clicked => { root.press("="); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "ln"; clicked => { root.press("eng:ln"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "1"; clicked => { root.press("1"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "2"; clicked => { root.press("2"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "3"; clicked => { root.press("3"); } }
EqBtn { min-h: UiStyle.btn-h-sm; clicked => { root.press("="); } }
}
Row {
DigitBtn { min-h: 32px; label: "0"; clicked => { root.press("0"); } }
DigitBtn { min-h: 32px; label: "."; clicked => { root.press("."); } }
FuncBtn { min-h: 32px; label: "exp"; clicked => { root.press("eng:exp"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "0"; clicked => { root.press("0"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "."; clicked => { root.press("."); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "exp"; clicked => { root.press("eng:exp"); } }
Rectangle { min-height: 32px; background: transparent; }
Rectangle { min-height: 32px; background: transparent; }
}
@@ -1295,62 +1335,136 @@ export component AppWindow inherits Window {
if root.mode == 2: GridLayout {
spacing: 4px;
Row {
FuncBtn { min-h: 34px; label: root.word-size-label; clicked => { root.press("word"); } }
FuncBtn { min-h: 34px; label: "CE"; clicked => { root.press("CE"); } }
FuncBtn { min-h: 34px; label: "C"; clicked => { root.press("clear"); } }
FuncBtn { min-h: 34px; label: "⌫"; clicked => { root.press("BS"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: root.word-size-label; clicked => { root.press("word"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "CE"; clicked => { root.press("CE"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "C"; clicked => { root.press("clear"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "⌫"; clicked => { root.press("BS"); } }
}
Row {
FuncBtn { min-h: 34px; label: "AND"; clicked => { root.press("AND"); } }
FuncBtn { min-h: 34px; label: "OR"; clicked => { root.press("OR"); } }
FuncBtn { min-h: 34px; label: "NOT"; clicked => { root.press("NOT"); } }
FuncBtn { min-h: 34px; label: "NAND"; clicked => { root.press("NAND"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "AND"; clicked => { root.press("AND"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "OR"; clicked => { root.press("OR"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "NOT"; clicked => { root.press("NOT"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "NAND"; clicked => { root.press("NAND"); } }
}
Row {
FuncBtn { min-h: 34px; label: "NOR"; clicked => { root.press("NOR"); } }
FuncBtn { min-h: 34px; label: "XOR"; clicked => { root.press("XOR"); } }
FuncBtn { min-h: 34px; label: "Lsh"; clicked => { root.press("Lsh"); } }
FuncBtn { min-h: 34px; label: "Rsh"; clicked => { root.press("Rsh"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "NOR"; clicked => { root.press("NOR"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "XOR"; clicked => { root.press("XOR"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "Lsh"; clicked => { root.press("Lsh"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "Rsh"; clicked => { root.press("Rsh"); } }
}
Row {
DigitBtn { min-h: 34px; label: "A"; enabled: root.allow-a; clicked => { root.press("A"); } }
DigitBtn { min-h: 34px; label: "B"; enabled: root.allow-a; clicked => { root.press("B"); } }
DigitBtn { min-h: 34px; label: "C"; enabled: root.allow-a; clicked => { root.press("C"); } }
FuncBtn { min-h: 34px; label: "÷"; clicked => { root.press("/"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "A"; enabled: root.allow-a; clicked => { root.press("A"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "B"; enabled: root.allow-a; clicked => { root.press("B"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "C"; enabled: root.allow-a; clicked => { root.press("C"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "÷"; clicked => { root.press("/"); } }
}
Row {
DigitBtn { min-h: 34px; label: "D"; enabled: root.allow-a; clicked => { root.press("D"); } }
DigitBtn { min-h: 34px; label: "E"; enabled: root.allow-a; clicked => { root.press("E"); } }
DigitBtn { min-h: 34px; label: "F"; enabled: root.allow-a; clicked => { root.press("F"); } }
FuncBtn { min-h: 34px; label: "×"; clicked => { root.press("*"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "D"; enabled: root.allow-a; clicked => { root.press("D"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "E"; enabled: root.allow-a; clicked => { root.press("E"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "F"; enabled: root.allow-a; clicked => { root.press("F"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "×"; clicked => { root.press("*"); } }
}
Row {
DigitBtn { min-h: 34px; label: "7"; enabled: root.allow-2; clicked => { root.press("7"); } }
DigitBtn { min-h: 34px; label: "8"; enabled: root.allow-8; clicked => { root.press("8"); } }
DigitBtn { min-h: 34px; label: "9"; enabled: root.allow-8; clicked => { root.press("9"); } }
FuncBtn { min-h: 34px; label: "−"; clicked => { root.press("-"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "7"; enabled: root.allow-2; clicked => { root.press("7"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "8"; enabled: root.allow-8; clicked => { root.press("8"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "9"; enabled: root.allow-8; clicked => { root.press("9"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "−"; clicked => { root.press("-"); } }
}
Row {
DigitBtn { min-h: 34px; label: "4"; enabled: root.allow-2; clicked => { root.press("4"); } }
DigitBtn { min-h: 34px; label: "5"; enabled: root.allow-2; clicked => { root.press("5"); } }
DigitBtn { min-h: 34px; label: "6"; enabled: root.allow-2; clicked => { root.press("6"); } }
FuncBtn { min-h: 34px; label: "+"; clicked => { root.press("+"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "4"; enabled: root.allow-2; clicked => { root.press("4"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "5"; enabled: root.allow-2; clicked => { root.press("5"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "6"; enabled: root.allow-2; clicked => { root.press("6"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "+"; clicked => { root.press("+"); } }
}
Row {
DigitBtn { min-h: 34px; label: "1"; clicked => { root.press("1"); } }
DigitBtn { min-h: 34px; label: "2"; enabled: root.active-base != 3; clicked => { root.press("2"); } }
DigitBtn { min-h: 34px; label: "3"; enabled: root.allow-2; clicked => { root.press("3"); } }
FuncBtn { min-h: 34px; label: "%"; clicked => { root.press("%"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "1"; clicked => { root.press("1"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "2"; enabled: root.active-base != 3; clicked => { root.press("2"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "3"; enabled: root.allow-2; clicked => { root.press("3"); } }
FuncBtn { min-h: UiStyle.btn-h-sm; label: "%"; clicked => { root.press("%"); } }
}
Row {
DigitBtn { min-h: 34px; label: "±"; clicked => { root.press("neg"); } }
DigitBtn { min-h: 34px; label: "0"; clicked => { root.press("0"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "±"; clicked => { root.press("neg"); } }
DigitBtn { min-h: UiStyle.btn-h-sm; label: "0"; clicked => { root.press("0"); } }
FuncBtn {
min-h: 34px;
min-h: UiStyle.btn-h-sm;
label: root.show-bits ? "Bits●" : "Bits";
clicked => { root.press("bits"); }
}
EqBtn { min-h: 34px; clicked => { root.press("="); } }
EqBtn { min-h: UiStyle.btn-h-sm; clicked => { root.press("="); } }
}
}
if root.mode == 5: VerticalLayout {
spacing: 14px;
padding-top: 8px;
Text {
text: "Appearance";
color: UiStyle.accent;
font-size: 16px;
font-weight: 700;
}
Text {
text: "Button size";
color: UiStyle.text-dim;
font-size: 12px;
}
HorizontalLayout {
spacing: 6px;
ModeTab {
label: "1 Compact";
active: root.cfg-button-size == 1;
clicked => { root.press("cfg:size:1"); }
}
ModeTab {
label: "2 Normal";
active: root.cfg-button-size == 2;
clicked => { root.press("cfg:size:2"); }
}
ModeTab {
label: "3 Large";
active: root.cfg-button-size == 3;
clicked => { root.press("cfg:size:3"); }
}
}
Text {
text: "Theme";
color: UiStyle.text-dim;
font-size: 12px;
}
HorizontalLayout {
spacing: 6px;
ModeTab {
label: "Dark";
active: root.cfg-theme == 0;
clicked => { root.press("cfg:theme:0"); }
}
ModeTab {
label: "Light";
active: root.cfg-theme == 1;
clicked => { root.press("cfg:theme:1"); }
}
ModeTab {
label: "Blue";
active: root.cfg-theme == 2;
clicked => { root.press("cfg:theme:2"); }
}
}
Text {
text: "Settings are saved automatically.";
color: UiStyle.text-dim;
font-size: 12px;
}
HorizontalLayout {
spacing: 6px;
FuncBtn {
label: "Back";
clicked => { root.press("mode:std"); }
}
}
}
}