Uncommittete Arbeit der Session "Windows Cockpit GUI Swift migration"
(local_47bddbc0) aus D:\Projects\pokerfreak\cockpit, 1:1 kopiert (36 Dateien:
Sitzungsleiste, Live, Reiter, Einstellungen, Zeitplan, Turnierplan, Zuschauer,
Chips, Diagramm, Bruecke live/reiter, UI-Slint). Basis main 5d4f939.
cargo test --locked -j 4: 142 gruen. Optik nicht geprueft; nicht in den
Live-Branch gemergt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
140 lines
4.1 KiB
Plaintext
140 lines
4.1 KiB
Plaintext
// Die Sitzungsleiste ganz oben (src/sitzungsleiste.rs): Ergebnis der laufenden oder letzten Sitzung
|
|
// gross in Geld und BB, darunter neun Kennzahlen und der Abstand zum Sitzungs-Stop.
|
|
|
|
import { Farbe } from "bausteine.slint";
|
|
|
|
export struct SZelle {
|
|
titel: string,
|
|
wert: string,
|
|
ton: int,
|
|
}
|
|
|
|
export struct SLeisteD {
|
|
da: bool,
|
|
laeuft: bool,
|
|
titel: string,
|
|
geld: string,
|
|
bb: string,
|
|
ton: int,
|
|
stopp-da: bool,
|
|
stopp-anteil: float,
|
|
stopp-text: string,
|
|
ende: string,
|
|
}
|
|
|
|
component Kennzahl inherits VerticalLayout {
|
|
in property <SZelle> zelle;
|
|
spacing: 1px;
|
|
horizontal-stretch: 1;
|
|
// gleich breite Spalten, egal wie lang der Wert ist
|
|
min-width: 0px;
|
|
preferred-width: 0px;
|
|
Text {
|
|
text: root.zelle.titel;
|
|
color: Farbe.gedaempft;
|
|
font-size: 10px;
|
|
overflow: elide;
|
|
}
|
|
Text {
|
|
text: root.zelle.wert;
|
|
color: root.zelle.ton > 0 ? Farbe.gruen : root.zelle.ton < 0 ? Farbe.rot-hell : Farbe.text;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
overflow: elide;
|
|
}
|
|
}
|
|
|
|
export component Sitzungsleiste inherits Rectangle {
|
|
in property <SLeisteD> d;
|
|
in property <[SZelle]> zellen;
|
|
property <color> farbe: root.d.ton > 0 ? Farbe.gruen : root.d.ton < 0 ? Farbe.rot-hell : Farbe.text;
|
|
|
|
border-radius: 8px;
|
|
background: Farbe.karte-stark;
|
|
border-width: 1px;
|
|
border-color: Farbe.linie;
|
|
height: inhalt.preferred-height;
|
|
|
|
inhalt := VerticalLayout {
|
|
padding: 12px;
|
|
padding-top: 9px;
|
|
spacing: 8px;
|
|
|
|
HorizontalLayout {
|
|
spacing: 6px;
|
|
Rectangle {
|
|
width: 8px;
|
|
Rectangle {
|
|
width: 8px;
|
|
height: 8px;
|
|
y: (parent.height - self.height) / 2;
|
|
border-radius: 4px;
|
|
background: root.d.laeuft ? Farbe.gruen : Farbe.gedaempft;
|
|
}
|
|
}
|
|
Text {
|
|
text: root.d.titel;
|
|
color: Farbe.hell;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
vertical-alignment: center;
|
|
overflow: elide;
|
|
horizontal-stretch: 1;
|
|
}
|
|
}
|
|
|
|
HorizontalLayout {
|
|
spacing: 10px;
|
|
alignment: start;
|
|
if root.d.geld != "": Text {
|
|
text: root.d.geld;
|
|
color: root.farbe;
|
|
font-size: 28px;
|
|
font-weight: 700;
|
|
vertical-alignment: bottom;
|
|
}
|
|
Text {
|
|
text: root.d.bb;
|
|
color: root.d.geld != "" ? root.farbe.with-alpha(0.8) : root.farbe;
|
|
font-size: root.d.geld != "" ? 16px : 28px;
|
|
font-weight: 600;
|
|
vertical-alignment: bottom;
|
|
}
|
|
}
|
|
|
|
for reihe in [0, 1, 2]: HorizontalLayout {
|
|
spacing: 10px;
|
|
Kennzahl { zelle: root.zellen[reihe * 3]; }
|
|
Kennzahl { zelle: root.zellen[reihe * 3 + 1]; }
|
|
Kennzahl { zelle: root.zellen[reihe * 3 + 2]; }
|
|
}
|
|
|
|
VerticalLayout {
|
|
spacing: 4px;
|
|
if root.d.stopp-da: Rectangle {
|
|
height: 4px;
|
|
border-radius: 2px;
|
|
background: Farbe.feld-schwebe;
|
|
Rectangle {
|
|
x: 0px;
|
|
width: parent.width * root.d.stopp-anteil;
|
|
border-radius: 2px;
|
|
background: root.d.stopp-anteil > 0.75 ? Farbe.rot-hell : root.d.stopp-anteil > 0.4 ? #f7a43a : Farbe.gruen;
|
|
}
|
|
}
|
|
Text {
|
|
text: root.d.stopp-text;
|
|
color: Farbe.gedaempft;
|
|
font-size: 10px;
|
|
overflow: elide;
|
|
}
|
|
if root.d.ende != "": Text {
|
|
text: root.d.ende;
|
|
color: Farbe.bernstein;
|
|
font-size: 10px;
|
|
wrap: word-wrap;
|
|
}
|
|
}
|
|
}
|
|
}
|