EvanZhu0721 / 公开仓库
SBMS
SBMS complete the calculation rules for the default logical desktop topology relationship and the physical dimensions of the displays in the Windows multi-screen collaboration system.
文件
../ pagescontrols.slint16.0 KBlaunch-intro.slint7.9 KBquick-access.slint13.9 KBremove-group-dialog.slint3.2 KBseven-segment.slint4.4 KBtheme.slint2.1 KBtray-icon.svg314 Bui/seven-segment.slint4.4 KB
1
import { MdTokens } from "theme.slint";2
3
component SegmentGlyph inherits Rectangle {4
in property <int> glyph;5
in property <brush> lit-color;6
property <brush> dim-color: transparent;7
8
width: 14px;9
height: 24px;10
background: transparent;11
12
// Segment order: a, b, c, d, e, f, g.13
Rectangle {14
x: 2px; y: 0px; width: 10px; height: 2px;15
background: root.glyph == 0 || root.glyph == 2 || root.glyph == 316
|| root.glyph == 5 || root.glyph == 6 || root.glyph == 717
|| root.glyph == 8 || root.glyph == 9 || root.glyph == 1018
|| root.glyph == 1419
? root.lit-color : root.dim-color;20
}21
Rectangle {22
x: 12px; y: 2px; width: 2px; height: 9px;23
background: root.glyph == 0 || root.glyph == 1 || root.glyph == 224
|| root.glyph == 3 || root.glyph == 4 || root.glyph == 725
|| root.glyph == 8 || root.glyph == 9 || root.glyph == 1426
? root.lit-color : root.dim-color;27
}28
Rectangle {29
x: 12px; y: 13px; width: 2px; height: 9px;30
background: root.glyph == 0 || root.glyph == 1 || root.glyph == 331
|| root.glyph == 4 || root.glyph == 5 || root.glyph == 632
|| root.glyph == 7 || root.glyph == 8 || root.glyph == 933
|| root.glyph == 13 || root.glyph == 1434
? root.lit-color : root.dim-color;35
}36
Rectangle {37
x: 2px; y: 22px; width: 10px; height: 2px;38
background: root.glyph == 0 || root.glyph == 2 || root.glyph == 339
|| root.glyph == 5 || root.glyph == 6 || root.glyph == 840
|| root.glyph == 9 || root.glyph == 1041
? root.lit-color : root.dim-color;42
}43
Rectangle {44
x: 0px; y: 13px; width: 2px; height: 9px;45
background: root.glyph == 0 || root.glyph == 2 || root.glyph == 646
|| root.glyph == 8 || root.glyph == 10 || root.glyph == 1147
|| root.glyph == 13 || root.glyph == 1448
? root.lit-color : root.dim-color;49
}50
Rectangle {51
x: 0px; y: 2px; width: 2px; height: 9px;52
background: root.glyph == 0 || root.glyph == 4 || root.glyph == 553
|| root.glyph == 6 || root.glyph == 8 || root.glyph == 954
|| root.glyph == 10 || root.glyph == 1455
? root.lit-color : root.dim-color;56
}57
Rectangle {58
x: 2px; y: 11px; width: 10px; height: 2px;59
background: root.glyph == 2 || root.glyph == 3 || root.glyph == 460
|| root.glyph == 5 || root.glyph == 6 || root.glyph == 861
|| root.glyph == 9 || root.glyph == 10 || root.glyph == 1162
|| root.glyph == 12 || root.glyph == 13 || root.glyph == 1463
? root.lit-color : root.dim-color;64
}65
}66
67
export component SevenSegmentDisplay inherits Rectangle {68
in property <int> fps;69
in property <bool> valid;70
in property <bool> running;71
in property <bool> error;72
in property <bool> not-a-number;73
property <int> clamped-fps: Math.min(Math.max(root.fps, 0), 999);74
property <brush> segment-color: root.error ? MdTokens.error : MdTokens.primary;75
76
width: 76px;77
height: 36px;78
background: transparent;79
accessible-role: text;80
accessible-label: root.error81
? "Mapping error"82
: (root.not-a-number ? "Stream only output has no local frame rate"83
: (root.running && root.valid84
? "Mapping frame rate " + root.clamped-fps + " frames per second"85
: "Mapping frame rate unavailable"));86
87
HorizontalLayout {88
padding-left: 9px;89
padding-right: 9px;90
padding-top: 6px;91
padding-bottom: 6px;92
spacing: 4px;93
alignment: center;94
95
SegmentGlyph {96
glyph: root.error ? 1097
: (root.not-a-number ? 1398
: (root.running && root.valid99
? Math.mod(Math.floor(root.clamped-fps / 100), 10) : 12));100
lit-color: root.segment-color;101
}102
SegmentGlyph {103
glyph: root.error ? 11104
: (root.not-a-number ? 14105
: (root.running && root.valid106
? Math.mod(Math.floor(root.clamped-fps / 10), 10) : 12));107
lit-color: root.segment-color;108
}109
SegmentGlyph {110
glyph: root.error ? 11111
: (root.not-a-number ? 13112
: (root.running && root.valid ? Math.mod(root.clamped-fps, 10) : 12));113
lit-color: root.segment-color;114
}115
}116
}117
118