- Verlustdeckel-Kacheln: Fusszeile bricht um (Statuskarte fuss-umbruch),
vorher "Deckel 200 · noch..." / "3.088/10...".
- Sitzungsleiste: "im Plus" in den Titel ("Tische · im Plus"), Wert
"0 offen · 6/18" - vorher abgeschnitten.
- Haende-Kopf: der Zaehler mit Protokoll-Hinweis bricht um statt abzuschneiden.
Offscreen gerendert (examples/bild, einst_bild), 19 Bilder geprueft.
cargo test --locked -j 2: 145 gruen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
795 lines
30 KiB
Plaintext
795 lines
30 KiB
Plaintext
// Die Reiter Hände, Statistik und Protokoll (EntscheidungenGeld.swift, Diagramme.swift). Was
|
|
// zu sehen ist - gefilterte Zeilen, Kennzahlen, die fertige Diagramm-Geometrie -, rechnet Rust
|
|
// (src/reiter.rs, src/diagramm.rs); hier wird nur gezeichnet und jeder Klick gemeldet.
|
|
|
|
import { ListView } from "std-widgets.slint";
|
|
import { Farbe, Icon, Auswahl } from "bausteine.slint";
|
|
import { Knopf, Wahlleiste } from "einstellungen.slint";
|
|
|
|
// ---- Daten ---------------------------------------------------------------------------------
|
|
|
|
export struct DPfad { befehle: string, farbe: color, gefuellt: bool, dicke: float }
|
|
export struct DRechteck { x: float, y: float, b: float, h: float, farbe: color }
|
|
export struct DPunkt { x: float, y: float, r: float, farbe: color }
|
|
export struct DMarke { pos: float, text: string }
|
|
export struct DLegende { text: string, farbe: color }
|
|
export struct DiagrammDaten {
|
|
pfade: [DPfad],
|
|
rechtecke: [DRechteck],
|
|
punkte: [DPunkt],
|
|
x-marken: [DMarke],
|
|
y-marken: [DMarke],
|
|
x-titel: string,
|
|
y-titel: string,
|
|
legende: [DLegende],
|
|
// Hoehe der Nulllinie (0..1), negativ: keine
|
|
null: float,
|
|
leer: bool,
|
|
// Platz links fuer die y-Beschriftung (px)
|
|
links: float,
|
|
}
|
|
|
|
export struct DKarte { text: string, rot: bool }
|
|
export struct HandZeile {
|
|
id: string,
|
|
uhr: string,
|
|
strasse: string,
|
|
aktion: string,
|
|
ergebnis: string,
|
|
ergebnis-farbe: color,
|
|
klick: string,
|
|
klick-farbe: color,
|
|
karten: [DKarte],
|
|
board: [DKarte],
|
|
text: string,
|
|
offen: bool,
|
|
det-titel: [string],
|
|
det-wert: [string],
|
|
}
|
|
export struct Facette { optionen: [string], index: int }
|
|
export struct HaendeKopf {
|
|
facetten: [Facette],
|
|
zuruecksetzen: bool,
|
|
zaehler: string,
|
|
leer: bool,
|
|
leer-titel: string,
|
|
leer-text: string,
|
|
}
|
|
|
|
export struct KennzahlD { titel: string, wert: string, farbe: color }
|
|
export struct FormatBalkenD {
|
|
name: string,
|
|
haende: string,
|
|
wert: string,
|
|
farbe: color,
|
|
// Lage auf der gemeinsamen Achse (0..1), negativ: unbekannt
|
|
punkt: float,
|
|
u: float,
|
|
o: float,
|
|
null: float,
|
|
}
|
|
export struct SitzungD { raum: string, unter: string, netto: string, farbe: color }
|
|
export struct ErgebnisD {
|
|
grundlage: int,
|
|
grundlage-text: string,
|
|
hinweise: [string],
|
|
reset-knoepfe: bool,
|
|
ab-anfang: bool,
|
|
fragt-reset: bool,
|
|
reset-frage: string,
|
|
kennzahlen: [KennzahlD],
|
|
formate: [FormatBalkenD],
|
|
urteil: bool,
|
|
urteil-titel: string,
|
|
urteil-grund: string,
|
|
urteil-sieger: bool,
|
|
teile: [string],
|
|
teil: int,
|
|
diagramm: DiagrammDaten,
|
|
sitzungen: [SitzungD],
|
|
leer: bool,
|
|
leer-titel: string,
|
|
leer-text: string,
|
|
}
|
|
export struct AnteilD { name: string, anteil: float, farbe: color, text: string }
|
|
export struct StilD {
|
|
teil: int,
|
|
anteile: [AnteilD],
|
|
fuss: string,
|
|
kennzahlen: [KennzahlD],
|
|
diagramm: DiagrammDaten,
|
|
leer: bool,
|
|
leer-titel: string,
|
|
leer-text: string,
|
|
}
|
|
export struct EreignisD { uhr: string, art: string, text: string }
|
|
export struct GeldD { uhr: string, art: string, uebung: bool, betrag: string, betrag-bb: string, unter: string }
|
|
export struct ProtokollD {
|
|
teil: int,
|
|
pausiert: bool,
|
|
geld-arten: [string],
|
|
geld-index: int,
|
|
geld-uebung: bool,
|
|
leer: bool,
|
|
leer-titel: string,
|
|
leer-text: string,
|
|
}
|
|
|
|
// ---- Bausteine -----------------------------------------------------------------------------
|
|
|
|
// Leerzustand: Titel und ein Satz, mittig.
|
|
component LeerAnsicht inherits Rectangle {
|
|
in property <string> titel;
|
|
in property <string> text;
|
|
min-height: 160px;
|
|
VerticalLayout {
|
|
alignment: center;
|
|
spacing: 6px;
|
|
padding: 24px;
|
|
Rectangle {
|
|
height: 28px;
|
|
Icon { art: "protokoll"; farbe: Farbe.text3; groesse: 26px; x: (parent.width - self.width) / 2; }
|
|
}
|
|
Text { text: root.titel; color: Farbe.text; font-size: 16px; font-weight: 700; horizontal-alignment: center; }
|
|
Text { text: root.text; color: Farbe.gedaempft; font-size: 12px; horizontal-alignment: center; wrap: word-wrap; }
|
|
}
|
|
}
|
|
|
|
// Kleine Beschriftung, grosser Wert (Kennzahl).
|
|
component KennzahlKachel inherits Rectangle {
|
|
in property <KennzahlD> k;
|
|
height: 56px;
|
|
border-radius: 8px;
|
|
background: Farbe.karte;
|
|
border-width: 1px;
|
|
border-color: Farbe.linie;
|
|
VerticalLayout {
|
|
padding-left: 10px;
|
|
padding-right: 8px;
|
|
alignment: center;
|
|
spacing: 1px;
|
|
Text { text: root.k.titel; color: Farbe.gedaempft; font-size: 11px; overflow: elide; }
|
|
Text { text: root.k.wert; color: root.k.farbe; font-size: 19px; font-weight: 600; overflow: elide; }
|
|
}
|
|
}
|
|
|
|
// Ein Link-Knopf (borderless): nur Text in Akzent.
|
|
export component Verweis inherits Rectangle {
|
|
in property <string> text;
|
|
callback geklickt();
|
|
width: t.preferred-width;
|
|
t := Text {
|
|
text: root.text;
|
|
color: ta.has-hover ? Farbe.text : Farbe.akzent;
|
|
font-size: 12px;
|
|
vertical-alignment: center;
|
|
}
|
|
ta := TouchArea { clicked => { root.geklickt(); } }
|
|
}
|
|
|
|
// Eine Spielkarte, klein (KarteAnsicht).
|
|
export component KarteKlein inherits Rectangle {
|
|
in property <DKarte> k;
|
|
width: max(24px, t.preferred-width + 6px);
|
|
height: 28px;
|
|
border-radius: 4px;
|
|
background: #ffffff14;
|
|
border-width: 1px;
|
|
border-color: Farbe.strich;
|
|
t := Text {
|
|
text: root.k.text;
|
|
color: root.k.rot ? #ff6b6b : Farbe.text;
|
|
font-size: 13px;
|
|
font-weight: 700;
|
|
horizontal-alignment: center;
|
|
vertical-alignment: center;
|
|
}
|
|
}
|
|
|
|
// Ein Diagramm aus fertiger Geometrie: Rust liefert alles in einer Einheitsflaeche (0..1).
|
|
export component DiagrammFlaeche inherits Rectangle {
|
|
in property <DiagrammDaten> d;
|
|
property <length> links: root.d.links * 1px;
|
|
property <length> oben: root.d.y-titel != "" ? 16px : 6px;
|
|
property <length> unten: root.d.x-titel != "" ? 34px : 20px;
|
|
property <length> legende-h: root.d.legende.length > 0 ? 22px : 0px;
|
|
height: 240px;
|
|
|
|
if root.d.y-titel != "": Text {
|
|
x: 0px;
|
|
y: 0px;
|
|
width: root.links - 6px;
|
|
text: root.d.y-titel;
|
|
color: Farbe.text3;
|
|
font-size: 10px;
|
|
horizontal-alignment: right;
|
|
}
|
|
|
|
flaeche := Rectangle {
|
|
x: root.links;
|
|
y: root.oben;
|
|
width: root.width - root.links - 10px;
|
|
height: root.height - root.oben - root.unten - root.legende-h;
|
|
|
|
for m in root.d.y-marken: Rectangle {
|
|
x: 0px;
|
|
y: m.pos * parent.height;
|
|
width: parent.width;
|
|
height: 1px;
|
|
background: Farbe.linie;
|
|
}
|
|
if root.d.null >= 0: Rectangle {
|
|
x: 0px;
|
|
y: root.d.null * parent.height;
|
|
width: parent.width;
|
|
height: 1px;
|
|
background: #ffffff40;
|
|
}
|
|
for r in root.d.rechtecke: Rectangle {
|
|
x: r.x * parent.width;
|
|
y: r.y * parent.height;
|
|
width: r.b * parent.width;
|
|
height: max(1px, r.h * parent.height);
|
|
border-radius: 2px;
|
|
background: r.farbe;
|
|
}
|
|
for p in root.d.pfade: Path {
|
|
x: 0px;
|
|
y: 0px;
|
|
width: parent.width;
|
|
height: parent.height;
|
|
viewbox-x: 0;
|
|
viewbox-y: 0;
|
|
viewbox-width: 1000;
|
|
viewbox-height: 1000;
|
|
// strecken, nicht einpassen: die Einheitsflaeche ist nicht quadratisch
|
|
fit: fill;
|
|
commands: p.befehle;
|
|
fill: p.gefuellt ? p.farbe : transparent;
|
|
stroke: p.gefuellt ? transparent : p.farbe;
|
|
stroke-width: p.dicke * 1px;
|
|
stroke-line-join: round;
|
|
stroke-line-cap: round;
|
|
}
|
|
for q in root.d.punkte: Rectangle {
|
|
x: q.x * parent.width - q.r * 1px;
|
|
y: q.y * parent.height - q.r * 1px;
|
|
width: q.r * 2px;
|
|
height: q.r * 2px;
|
|
border-radius: q.r * 1px;
|
|
background: q.farbe;
|
|
}
|
|
}
|
|
|
|
for m in root.d.y-marken: Text {
|
|
x: 0px;
|
|
y: flaeche.y + m.pos * flaeche.height - 7px;
|
|
width: root.links - 6px;
|
|
height: 14px;
|
|
text: m.text;
|
|
color: Farbe.gedaempft;
|
|
font-size: 10px;
|
|
horizontal-alignment: right;
|
|
vertical-alignment: center;
|
|
overflow: elide;
|
|
}
|
|
for m in root.d.x-marken: Text {
|
|
x: m.pos < 0.05 ? flaeche.x : m.pos > 0.95 ? flaeche.x + flaeche.width - 90px : flaeche.x + m.pos * flaeche.width - 45px;
|
|
y: flaeche.y + flaeche.height + 4px;
|
|
width: 90px;
|
|
text: m.text;
|
|
color: Farbe.gedaempft;
|
|
font-size: 10px;
|
|
horizontal-alignment: m.pos < 0.05 ? left : m.pos > 0.95 ? right : center;
|
|
overflow: elide;
|
|
}
|
|
if root.d.x-titel != "": Text {
|
|
x: flaeche.x;
|
|
y: flaeche.y + flaeche.height + 18px;
|
|
width: flaeche.width;
|
|
text: root.d.x-titel;
|
|
color: Farbe.text3;
|
|
font-size: 10px;
|
|
horizontal-alignment: center;
|
|
}
|
|
if root.d.legende.length > 0: HorizontalLayout {
|
|
x: flaeche.x;
|
|
y: root.height - 18px;
|
|
height: 16px;
|
|
alignment: start;
|
|
spacing: 10px;
|
|
for l in root.d.legende: HorizontalLayout {
|
|
spacing: 4px;
|
|
Rectangle {
|
|
width: 8px;
|
|
height: 8px;
|
|
y: 4px;
|
|
border-radius: 4px;
|
|
background: l.farbe;
|
|
}
|
|
Text { text: l.text; color: Farbe.text2; font-size: 10px; vertical-alignment: center; }
|
|
}
|
|
}
|
|
}
|
|
|
|
// Eine Entscheidung; ein Klick klappt sie auf.
|
|
component HandZeileAnsicht inherits Rectangle {
|
|
in property <HandZeile> zeile;
|
|
callback geklickt();
|
|
border-radius: 6px;
|
|
background: root.zeile.offen ? Farbe.karte : ta.has-hover ? Farbe.schwebe : transparent;
|
|
ta := TouchArea { clicked => { root.geklickt(); } }
|
|
VerticalLayout {
|
|
padding-left: 10px;
|
|
padding-right: 10px;
|
|
padding-top: 7px;
|
|
padding-bottom: 7px;
|
|
spacing: 5px;
|
|
HorizontalLayout {
|
|
spacing: 6px;
|
|
Text { text: root.zeile.uhr; color: Farbe.gedaempft; font-size: 11px; vertical-alignment: center; }
|
|
Text { text: root.zeile.strasse; color: Farbe.gedaempft; font-size: 11px; vertical-alignment: center; }
|
|
Text {
|
|
text: root.zeile.aktion;
|
|
color: Farbe.text;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
vertical-alignment: center;
|
|
overflow: elide;
|
|
horizontal-stretch: 1;
|
|
}
|
|
if root.zeile.ergebnis != "": Text {
|
|
text: root.zeile.ergebnis;
|
|
color: root.zeile.ergebnis-farbe;
|
|
font-size: 11px;
|
|
vertical-alignment: center;
|
|
}
|
|
Rectangle {
|
|
width: 16px;
|
|
height: 16px;
|
|
y: (parent.height - self.height) / 2;
|
|
border-radius: 8px;
|
|
background: root.zeile.klick-farbe;
|
|
Text { text: root.zeile.klick; color: #000000c0; font-size: 10px; font-weight: 700; horizontal-alignment: center; vertical-alignment: center; }
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
spacing: 8px;
|
|
if root.zeile.karten.length > 0 || root.zeile.board.length > 0: HorizontalLayout {
|
|
spacing: 3px;
|
|
for k in root.zeile.karten: KarteKlein { k: k; }
|
|
if root.zeile.board.length > 0: Rectangle { width: 1px; background: Farbe.strich; }
|
|
for k in root.zeile.board: KarteKlein { k: k; }
|
|
}
|
|
Text {
|
|
text: root.zeile.text;
|
|
color: Farbe.text2;
|
|
font-size: 11.5px;
|
|
wrap: word-wrap;
|
|
overflow: elide;
|
|
vertical-alignment: center;
|
|
horizontal-stretch: 1;
|
|
max-height: root.zeile.offen ? 10000px : 32px;
|
|
}
|
|
}
|
|
if root.zeile.offen: VerticalLayout {
|
|
padding-top: 4px;
|
|
spacing: 3px;
|
|
for t[i] in root.zeile.det-titel: HorizontalLayout {
|
|
spacing: 10px;
|
|
Text { width: 78px; text: t; color: Farbe.gedaempft; font-size: 11px; }
|
|
Text { text: root.zeile.det-wert[i]; color: Farbe.text2; font-size: 11px; wrap: word-wrap; horizontal-stretch: 1; }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Der Kopf eines Reiters mit Abstand nach unten (Divider).
|
|
export component Trenner inherits Rectangle {
|
|
height: 1px;
|
|
background: Farbe.linie;
|
|
}
|
|
|
|
// ---- Hände ---------------------------------------------------------------------------------
|
|
|
|
export component HaendeInhalt inherits VerticalLayout {
|
|
in property <HaendeKopf> kopf;
|
|
in property <[HandZeile]> zeilen;
|
|
in-out property <string> suche;
|
|
callback suche-geaendert(string);
|
|
callback facette-gewaehlt(int, int);
|
|
callback zuruecksetzen();
|
|
callback hand-geklickt(string);
|
|
|
|
VerticalLayout {
|
|
vertical-stretch: 0;
|
|
padding: 12px;
|
|
spacing: 7px;
|
|
// Suchfeld
|
|
Rectangle {
|
|
height: 32px;
|
|
border-radius: 4px;
|
|
background: eingabe.has-focus ? #1e1e1e : Farbe.feld;
|
|
border-width: 1px;
|
|
border-color: eingabe.has-focus ? Farbe.akzent : Farbe.strich;
|
|
if root.suche == "": Text {
|
|
x: 10px;
|
|
height: parent.height;
|
|
text: "Suchen: Grund, Karten, Hand, Tisch";
|
|
color: Farbe.text3;
|
|
font-size: 13px;
|
|
vertical-alignment: center;
|
|
}
|
|
eingabe := TextInput {
|
|
x: 10px;
|
|
width: parent.width - 20px;
|
|
height: parent.height;
|
|
text <=> root.suche;
|
|
color: Farbe.text;
|
|
font-size: 13px;
|
|
vertical-alignment: center;
|
|
single-line: true;
|
|
edited => { root.suche-geaendert(self.text); }
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
spacing: 6px;
|
|
for f[i] in root.kopf.facetten: Auswahl {
|
|
horizontal-stretch: 1;
|
|
optionen: f.optionen;
|
|
index: f.index;
|
|
menue-breite: 170px;
|
|
gewaehlt(j) => { root.facette-gewaehlt(i, j); }
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
Text { text: root.kopf.zaehler; color: Farbe.gedaempft; font-size: 11px; wrap: word-wrap; horizontal-stretch: 1; vertical-alignment: center; }
|
|
if root.kopf.zuruecksetzen: Verweis { text: "Zurücksetzen"; geklickt => { root.zuruecksetzen(); } }
|
|
}
|
|
}
|
|
Trenner { }
|
|
if root.kopf.leer: LeerAnsicht { vertical-stretch: 1; titel: root.kopf.leer-titel; text: root.kopf.leer-text; }
|
|
if !root.kopf.leer: ListView {
|
|
vertical-stretch: 1;
|
|
for z in root.zeilen: VerticalLayout {
|
|
padding-left: 6px;
|
|
padding-right: 6px;
|
|
padding-top: 1px;
|
|
padding-bottom: 1px;
|
|
HandZeileAnsicht { zeile: z; geklickt => { root.hand-geklickt(z.id); } }
|
|
}
|
|
}
|
|
}
|
|
|
|
// ---- Statistik -----------------------------------------------------------------------------
|
|
|
|
// Formate im Vergleich (FormatVergleich.swift): bb/100 je Format mit 95-%-Spanne auf einer Achse.
|
|
component FormatBalkenAnsicht inherits VerticalLayout {
|
|
in property <FormatBalkenD> f;
|
|
spacing: 3px;
|
|
HorizontalLayout {
|
|
spacing: 6px;
|
|
Text { text: root.f.name; color: Farbe.text; font-size: 11.5px; font-weight: 600; }
|
|
Text { text: root.f.haende; color: Farbe.text3; font-size: 10.5px; vertical-alignment: center; horizontal-stretch: 1; }
|
|
Text { text: root.f.wert; color: root.f.farbe; font-size: 11.5px; font-weight: 600; }
|
|
}
|
|
Rectangle {
|
|
height: 12px;
|
|
Rectangle { y: 4px; height: 4px; border-radius: 2px; background: #ffffff14; }
|
|
Rectangle { x: root.f.null * parent.width; width: 1px; background: #ffffff80; }
|
|
if root.f.u >= 0: Rectangle {
|
|
x: root.f.u * parent.width;
|
|
y: 2px;
|
|
width: max(2px, (root.f.o - root.f.u) * parent.width);
|
|
height: 8px;
|
|
border-radius: 4px;
|
|
background: root.f.farbe.with-alpha(0.35);
|
|
}
|
|
if root.f.punkt >= 0: Rectangle {
|
|
x: root.f.punkt * parent.width - 4px;
|
|
y: 2px;
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 4px;
|
|
background: root.f.farbe;
|
|
}
|
|
}
|
|
}
|
|
|
|
component ErgebnisInhalt inherits VerticalLayout {
|
|
in property <ErgebnisD> e;
|
|
callback grundlage-gewaehlt(int);
|
|
callback teil-gewaehlt(int);
|
|
callback reset-fragen();
|
|
callback reset-abbrechen();
|
|
callback reset-bestaetigen();
|
|
callback ab-anfang();
|
|
spacing: 10px;
|
|
|
|
Wahlleiste {
|
|
optionen: ["Übung", "Cash", "Archiv"];
|
|
index: root.e.grundlage;
|
|
gewaehlt(i) => { root.grundlage-gewaehlt(i); }
|
|
}
|
|
HorizontalLayout {
|
|
spacing: 10px;
|
|
Text { text: root.e.grundlage-text; color: Farbe.gedaempft; font-size: 11px; wrap: word-wrap; horizontal-stretch: 1; vertical-alignment: center; }
|
|
if root.e.reset-knoepfe && root.e.ab-anfang: Verweis { text: "Ab Anfang"; geklickt => { root.ab-anfang(); } }
|
|
if root.e.reset-knoepfe: Verweis { text: "Zurücksetzen"; geklickt => { root.reset-fragen(); } }
|
|
}
|
|
if root.e.fragt-reset: Rectangle {
|
|
border-radius: 8px;
|
|
background: #f0a0301f;
|
|
HorizontalLayout {
|
|
padding: 8px;
|
|
spacing: 8px;
|
|
Text { text: root.e.reset-frage; color: Farbe.text; font-size: 11.5px; wrap: word-wrap; horizontal-stretch: 1; vertical-alignment: center; }
|
|
Knopf { titel: "Abbrechen"; geklickt => { root.reset-abbrechen(); } }
|
|
Knopf { titel: "Zurücksetzen"; primaer: true; geklickt => { root.reset-bestaetigen(); } }
|
|
}
|
|
}
|
|
for h in root.e.hinweise: Text { text: h; color: Farbe.text3; font-size: 10.5px; wrap: word-wrap; }
|
|
if root.e.leer: LeerAnsicht { titel: root.e.leer-titel; text: root.e.leer-text; }
|
|
if !root.e.leer: VerticalLayout {
|
|
spacing: 10px;
|
|
HorizontalLayout {
|
|
spacing: 8px;
|
|
KennzahlKachel { k: root.e.kennzahlen[0]; }
|
|
KennzahlKachel { k: root.e.kennzahlen[1]; }
|
|
}
|
|
HorizontalLayout {
|
|
spacing: 8px;
|
|
KennzahlKachel { k: root.e.kennzahlen[2]; }
|
|
KennzahlKachel { k: root.e.kennzahlen[3]; }
|
|
}
|
|
if root.e.formate.length > 0: Rectangle {
|
|
border-radius: 12px;
|
|
background: Farbe.karte;
|
|
VerticalLayout {
|
|
padding: 10px;
|
|
spacing: 8px;
|
|
HorizontalLayout {
|
|
Text { text: "Formate im Vergleich"; color: Farbe.text2; font-size: 11px; font-weight: 600; horizontal-stretch: 1; }
|
|
Text { text: "bb/100 · 95 %"; color: Farbe.text3; font-size: 10px; }
|
|
}
|
|
if root.e.urteil: VerticalLayout {
|
|
spacing: 1px;
|
|
Text { text: root.e.urteil-titel; color: root.e.urteil-sieger ? Farbe.gruen : Farbe.gedaempft; font-size: 13px; font-weight: 600; }
|
|
Text { text: root.e.urteil-grund; color: Farbe.text3; font-size: 10.5px; wrap: word-wrap; }
|
|
}
|
|
for f in root.e.formate: FormatBalkenAnsicht { f: f; }
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
alignment: start;
|
|
Auswahl {
|
|
width: 150px;
|
|
optionen: root.e.teile;
|
|
index: root.e.teil;
|
|
gewaehlt(i) => { root.teil-gewaehlt(i); }
|
|
}
|
|
}
|
|
if root.e.teile[root.e.teil] != "Sitzungen": DiagrammFlaeche { d: root.e.diagramm; height: 240px; }
|
|
if root.e.teile[root.e.teil] == "Sitzungen" && root.e.sitzungen.length == 0: Text {
|
|
text: "Noch keine Sitzungen.";
|
|
color: Farbe.gedaempft;
|
|
font-size: 12px;
|
|
}
|
|
for s in root.e.sitzungen: VerticalLayout {
|
|
spacing: 6px;
|
|
HorizontalLayout {
|
|
VerticalLayout {
|
|
horizontal-stretch: 1;
|
|
Text { text: s.raum; color: Farbe.text; font-size: 13px; font-weight: 600; }
|
|
Text { text: s.unter; color: Farbe.gedaempft; font-size: 11px; }
|
|
}
|
|
Text { text: s.netto; color: s.farbe; font-size: 13px; vertical-alignment: center; }
|
|
}
|
|
Trenner { }
|
|
}
|
|
}
|
|
}
|
|
|
|
component StilInhalt inherits VerticalLayout {
|
|
in property <StilD> s;
|
|
callback teil-gewaehlt(int);
|
|
spacing: 12px;
|
|
|
|
Wahlleiste {
|
|
optionen: ["Anteile", "Verlauf", "Größen", "Denkzeit"];
|
|
index: root.s.teil;
|
|
gewaehlt(i) => { root.teil-gewaehlt(i); }
|
|
}
|
|
if root.s.leer: LeerAnsicht { titel: root.s.leer-titel; text: root.s.leer-text; }
|
|
if !root.s.leer && root.s.teil == 0: VerticalLayout {
|
|
spacing: 9px;
|
|
for a in root.s.anteile: HorizontalLayout {
|
|
spacing: 8px;
|
|
Text { width: 52px; text: a.name; color: Farbe.text; font-size: 13px; vertical-alignment: center; }
|
|
Rectangle {
|
|
height: 16px;
|
|
horizontal-stretch: 1;
|
|
Rectangle { y: 4px; height: 8px; border-radius: 4px; background: #ffffff14; }
|
|
Rectangle { x: 0px; y: 4px; width: parent.width * a.anteil; height: 8px; border-radius: 4px; background: a.farbe; }
|
|
}
|
|
Text { width: 40px; text: a.text; color: Farbe.text2; font-size: 11px; horizontal-alignment: right; vertical-alignment: center; }
|
|
}
|
|
}
|
|
if !root.s.leer && root.s.teil == 3: HorizontalLayout {
|
|
spacing: 8px;
|
|
for k in root.s.kennzahlen: KennzahlKachel { k: k; }
|
|
}
|
|
if !root.s.leer && root.s.teil != 0: DiagrammFlaeche { d: root.s.diagramm; height: root.s.teil == 3 ? 210px : 250px; }
|
|
if !root.s.leer && root.s.fuss != "": Text { text: root.s.fuss; color: Farbe.gedaempft; font-size: 11px; wrap: word-wrap; }
|
|
}
|
|
|
|
export component StatistikInhalt inherits VerticalLayout {
|
|
in property <bool> stil;
|
|
in property <ErgebnisD> ergebnis;
|
|
in property <StilD> stil-daten;
|
|
callback teil-gewaehlt(bool);
|
|
callback grundlage-gewaehlt(int);
|
|
callback ergebnis-teil-gewaehlt(int);
|
|
callback reset-fragen();
|
|
callback reset-abbrechen();
|
|
callback reset-bestaetigen();
|
|
callback ab-anfang();
|
|
callback stil-teil-gewaehlt(int);
|
|
|
|
HorizontalLayout {
|
|
padding-left: 12px;
|
|
padding-right: 12px;
|
|
padding-top: 4px;
|
|
Rectangle {
|
|
height: 36px;
|
|
HorizontalLayout {
|
|
for t[i] in ["Ergebnis", "Stil"]: Rectangle {
|
|
background: seg.has-hover ? Farbe.schwebe : transparent;
|
|
border-radius: 4px;
|
|
Text {
|
|
text: t;
|
|
color: (i == 1) == root.stil ? Farbe.text : Farbe.text3;
|
|
font-size: 14px;
|
|
font-weight: (i == 1) == root.stil ? 600 : 400;
|
|
horizontal-alignment: center;
|
|
vertical-alignment: center;
|
|
}
|
|
Rectangle {
|
|
x: (parent.width - self.width) / 2;
|
|
y: parent.height - 4px;
|
|
width: 16px;
|
|
height: 2.5px;
|
|
border-radius: 1.25px;
|
|
background: (i == 1) == root.stil ? Farbe.akzent : transparent;
|
|
}
|
|
seg := TouchArea { clicked => { root.teil-gewaehlt(i == 1); } }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Flickable {
|
|
vertical-stretch: 1;
|
|
content-width: self.width;
|
|
content-height: inhalt.preferred-height;
|
|
inhalt := VerticalLayout {
|
|
width: parent.width;
|
|
padding: 12px;
|
|
if !root.stil: ErgebnisInhalt {
|
|
e: root.ergebnis;
|
|
grundlage-gewaehlt(i) => { root.grundlage-gewaehlt(i); }
|
|
teil-gewaehlt(i) => { root.ergebnis-teil-gewaehlt(i); }
|
|
reset-fragen => { root.reset-fragen(); }
|
|
reset-abbrechen => { root.reset-abbrechen(); }
|
|
reset-bestaetigen => { root.reset-bestaetigen(); }
|
|
ab-anfang => { root.ab-anfang(); }
|
|
}
|
|
if root.stil: StilInhalt {
|
|
s: root.stil-daten;
|
|
teil-gewaehlt(i) => { root.stil-teil-gewaehlt(i); }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// ---- Protokoll -----------------------------------------------------------------------------
|
|
|
|
export component ProtokollInhalt inherits VerticalLayout {
|
|
in property <ProtokollD> p;
|
|
in property <[string]> gedanken;
|
|
in property <[EreignisD]> ereignisse;
|
|
in property <[GeldD]> geld;
|
|
callback teil-gewaehlt(int);
|
|
callback pause-umschalten();
|
|
callback geld-art-gewaehlt(int);
|
|
|
|
HorizontalLayout {
|
|
padding: 12px;
|
|
spacing: 8px;
|
|
Wahlleiste {
|
|
horizontal-stretch: 1;
|
|
optionen: ["Gedanken", "Ereignisse", "Geld"];
|
|
index: root.p.teil;
|
|
gewaehlt(i) => { root.teil-gewaehlt(i); }
|
|
}
|
|
if root.p.teil != 2: Rectangle {
|
|
width: 30px;
|
|
height: 28px;
|
|
border-radius: 4px;
|
|
background: root.p.pausiert ? Farbe.akzent-fuell : pt.has-hover ? Farbe.feld-schwebe : Farbe.feld;
|
|
border-width: root.p.pausiert ? 0px : 1px;
|
|
border-color: Farbe.strich;
|
|
// Pause-Zeichen aus zwei Balken (die Glyphe fehlt in Segoe UI)
|
|
Rectangle { x: parent.width / 2 - 5px; y: 8px; width: 3px; height: 12px; border-radius: 1px; background: root.p.pausiert ? #ffffff : Farbe.text2; }
|
|
Rectangle { x: parent.width / 2 + 2px; y: 8px; width: 3px; height: 12px; border-radius: 1px; background: root.p.pausiert ? #ffffff : Farbe.text2; }
|
|
pt := TouchArea { clicked => { root.pause-umschalten(); } }
|
|
}
|
|
if root.p.teil == 2: Auswahl {
|
|
width: 108px;
|
|
optionen: root.p.geld-arten;
|
|
index: root.p.geld-index;
|
|
gewaehlt(i) => { root.geld-art-gewaehlt(i); }
|
|
}
|
|
if root.p.teil == 2 && root.p.geld-uebung: Rectangle {
|
|
width: 52px;
|
|
height: 22px;
|
|
y: (parent.height - self.height) / 2;
|
|
border-radius: 11px;
|
|
background: #4f8cf024;
|
|
Text { text: "ÜBUNG"; color: #4f8cf0; font-size: 10px; font-weight: 700; horizontal-alignment: center; vertical-alignment: center; }
|
|
}
|
|
}
|
|
Trenner { }
|
|
if root.p.leer: LeerAnsicht { vertical-stretch: 1; titel: root.p.leer-titel; text: root.p.leer-text; }
|
|
if !root.p.leer && root.p.teil == 0: ListView {
|
|
vertical-stretch: 1;
|
|
for g in root.gedanken: HorizontalLayout {
|
|
padding-left: 12px;
|
|
padding-right: 12px;
|
|
padding-top: 3px;
|
|
padding-bottom: 3px;
|
|
Text { text: g; color: Farbe.text2; font-size: 11px; font-family: "Cascadia Mono"; wrap: word-wrap; }
|
|
}
|
|
}
|
|
if !root.p.leer && root.p.teil == 1: ListView {
|
|
vertical-stretch: 1;
|
|
for z in root.ereignisse: HorizontalLayout {
|
|
padding-left: 12px;
|
|
padding-right: 12px;
|
|
padding-top: 3px;
|
|
padding-bottom: 3px;
|
|
spacing: 6px;
|
|
Text { text: z.uhr; color: Farbe.gedaempft; font-size: 11px; font-family: "Cascadia Mono"; }
|
|
Text { text: z.art; color: Farbe.akzent; font-size: 11px; font-family: "Cascadia Mono"; }
|
|
Text { text: z.text; color: Farbe.text2; font-size: 11px; font-family: "Cascadia Mono"; wrap: word-wrap; horizontal-stretch: 1; }
|
|
}
|
|
}
|
|
if !root.p.leer && root.p.teil == 2: ListView {
|
|
vertical-stretch: 1;
|
|
for z in root.geld: VerticalLayout {
|
|
padding-left: 12px;
|
|
padding-right: 12px;
|
|
padding-top: 6px;
|
|
padding-bottom: 6px;
|
|
spacing: 3px;
|
|
opacity: z.uebung ? 0.75 : 1;
|
|
HorizontalLayout {
|
|
spacing: 6px;
|
|
Text { text: z.uhr; color: Farbe.gedaempft; font-size: 11px; vertical-alignment: center; }
|
|
Text { text: z.art; color: Farbe.text; font-size: 13px; font-weight: 600; vertical-alignment: center; }
|
|
if z.uebung: Rectangle {
|
|
width: 46px;
|
|
height: 18px;
|
|
y: (parent.height - self.height) / 2;
|
|
border-radius: 9px;
|
|
background: #4f8cf024;
|
|
Text { text: "Übung"; color: #4f8cf0; font-size: 10px; font-weight: 600; horizontal-alignment: center; vertical-alignment: center; }
|
|
}
|
|
Rectangle { horizontal-stretch: 1; }
|
|
Text { text: z.betrag; color: Farbe.text; font-size: 13px; vertical-alignment: center; }
|
|
Text { text: z.betrag-bb; color: Farbe.gedaempft; font-size: 11px; vertical-alignment: center; }
|
|
}
|
|
if z.unter != "": Text { text: z.unter; color: Farbe.gedaempft; font-size: 11px; wrap: word-wrap; }
|
|
}
|
|
}
|
|
}
|