Add Store support and unsigned app releases
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
// Settings screen: categories on the left, rows on the right.
|
||||
// Settings screen: categories on the left, the selected page's rows on one
|
||||
// grouped platter on the right.
|
||||
//
|
||||
// Only text and icons are drawn here. The glass (pane, rows, chips) comes from
|
||||
// `settings_screen::glass` in Rust, which mirrors the geometry below: keep the
|
||||
// row/nav formulas (position, focus `f`, visibility `vis`) in sync with it.
|
||||
// Only text and icons are drawn here. The glass (platter, focus pills) comes
|
||||
// from `settings_screen::glass` in Rust, which mirrors the geometry below: keep
|
||||
// the row/nav formulas (position, focus `f`, visibility `vis`) in sync with it.
|
||||
|
||||
import { WifiIcon, BluetoothIcon, InfoIcon, DisplayIcon, PowerIcon, SignalIcon, LockIcon } from "icons.slint";
|
||||
import { WifiIcon, BluetoothIcon, InfoIcon, DisplayIcon, AudioIcon, PowerIcon, SignalIcon, LockIcon, ChevronIcon, StoreIcon, CheckIcon, LinkIcon } from "icons.slint";
|
||||
|
||||
export struct SettingRow {
|
||||
title: string,
|
||||
@@ -22,9 +23,14 @@ component NavIcon inherits Rectangle {
|
||||
in property <color> ink;
|
||||
if root.index == 0: DisplayIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 1: BluetoothIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 2: WifiIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 3: PowerIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 4: InfoIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 2: AudioIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 3: WifiIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 4: PowerIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 5: InfoIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
// App Store mode: Felfedezés, Telepítve, Források.
|
||||
if root.index == 6: StoreIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 7: CheckIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
if root.index == 8: LinkIcon { width: 100%; height: 100%; ink: root.ink; }
|
||||
}
|
||||
|
||||
export component SettingsView inherits Rectangle {
|
||||
@@ -52,38 +58,47 @@ export component SettingsView inherits Rectangle {
|
||||
in property <string> subtitle;
|
||||
in property <[SettingRow]> rows;
|
||||
in property <[string]> categories;
|
||||
// The same pane serves the App Store (app.slint set-mode).
|
||||
in property <string> heading: "Beállítások";
|
||||
in property <int> icon-base: 0;
|
||||
|
||||
// Row text is inset from the platter edge by the focus pill's margin.
|
||||
property <length> inset: 8 * root.u;
|
||||
property <length> pad: 28 * root.u;
|
||||
|
||||
// ---- left column ----------------------------------------------------
|
||||
Text {
|
||||
x: root.nav-x + 8 * root.u;
|
||||
y: root.pane-y + 50 * root.u;
|
||||
text: "Beállítások";
|
||||
font-family: "Inter Display";
|
||||
font-weight: 800;
|
||||
font-size: 50 * root.u;
|
||||
letter-spacing: -1.5 * root.u;
|
||||
x: root.nav-x;
|
||||
y: root.pane-y;
|
||||
width: root.nav-w;
|
||||
height: 88 * root.u;
|
||||
vertical-alignment: center;
|
||||
text: root.heading;
|
||||
font-weight: 700;
|
||||
font-size: 56 * root.u;
|
||||
letter-spacing: -1 * root.u;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
for name[i] in root.categories: Rectangle {
|
||||
property <float> f: max(0, 1 - abs(root.nav-pos - i)) * root.nav-active;
|
||||
property <float> sel: max(0, 1 - abs(root.nav-pos - i));
|
||||
property <color> ink: self.f > 0.5 ? #121317 : #ffffff.with-alpha(0.72 + 0.28 * self.sel);
|
||||
property <color> ink: self.f > 0.5 ? #121317 : #ffffff.with-alpha(0.62 + 0.38 * self.sel);
|
||||
x: root.nav-x;
|
||||
y: root.nav-y + i * root.nav-step;
|
||||
width: root.nav-w;
|
||||
height: root.nav-h;
|
||||
NavIcon {
|
||||
x: 28 * root.u;
|
||||
x: 24 * root.u;
|
||||
y: (parent.height - self.height) / 2;
|
||||
width: 34 * root.u;
|
||||
height: 34 * root.u;
|
||||
index: i;
|
||||
width: 32 * root.u;
|
||||
height: 32 * root.u;
|
||||
index: i + root.icon-base;
|
||||
ink: parent.ink;
|
||||
}
|
||||
Text {
|
||||
x: 82 * root.u;
|
||||
width: parent.width - 100 * root.u;
|
||||
x: 76 * root.u;
|
||||
width: parent.width - 96 * root.u;
|
||||
height: parent.height;
|
||||
vertical-alignment: center;
|
||||
text: name;
|
||||
@@ -94,46 +109,35 @@ export component SettingsView inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
x: root.nav-x;
|
||||
y: root.pane-y + root.pane-h - 92 * root.u;
|
||||
width: 300 * root.u;
|
||||
height: 56 * root.u;
|
||||
horizontal-alignment: center;
|
||||
vertical-alignment: center;
|
||||
text: "‹ Vissza · Esc";
|
||||
font-size: 21 * root.u;
|
||||
font-weight: 500;
|
||||
color: #ffffffc0;
|
||||
}
|
||||
|
||||
// ---- right column ---------------------------------------------------
|
||||
Text {
|
||||
x: root.rows-x + 8 * root.u;
|
||||
y: root.pane-y + 44 * root.u;
|
||||
width: root.rows-w - 16 * root.u;
|
||||
x: root.rows-x + root.inset + root.pad;
|
||||
y: root.nav-y;
|
||||
width: root.rows-w - 2 * (root.inset + root.pad);
|
||||
height: root.nav-h;
|
||||
vertical-alignment: center;
|
||||
text: root.title;
|
||||
font-family: "Inter Display";
|
||||
font-weight: 800;
|
||||
font-weight: 700;
|
||||
font-size: 40 * root.u;
|
||||
letter-spacing: -1 * root.u;
|
||||
color: #ffffff;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
x: root.rows-x + 8 * root.u;
|
||||
y: root.pane-y + 102 * root.u;
|
||||
width: root.rows-w - 16 * root.u;
|
||||
height: 64 * root.u;
|
||||
x: root.rows-x + root.inset + root.pad;
|
||||
y: root.nav-y + root.nav-h;
|
||||
width: root.rows-w - 2 * (root.inset + root.pad);
|
||||
height: root.rows-y - root.nav-y - root.nav-h - 24 * root.u;
|
||||
text: root.subtitle;
|
||||
wrap: word-wrap;
|
||||
overflow: elide;
|
||||
font-size: 21 * root.u;
|
||||
font-size: 24 * root.u;
|
||||
color: #ffffffa8;
|
||||
}
|
||||
|
||||
for row[j] in root.rows: r := Rectangle {
|
||||
property <float> f: max(0, 1 - abs(root.row-pos - j)) * root.content-active;
|
||||
// Focus on this row or the one above hides the hairline between them.
|
||||
property <float> f-above: max(0, 1 - abs(root.row-pos - (j - 1))) * root.content-active;
|
||||
property <length> top: root.rows-y + j * root.row-step - root.rows-scroll;
|
||||
property <float> over: max(root.rows-y - self.top, self.top + root.row-h - (root.rows-y + root.rows-view-h)) / root.row-h;
|
||||
property <float> vis: clamp(1 - self.over, 0, 1);
|
||||
@@ -143,17 +147,25 @@ export component SettingsView inherits Rectangle {
|
||||
property <color> ink-dim: self.hot ? (self.danger ? #ffffffd0 : #121317b0) : #ffffff99;
|
||||
property <bool> chevron: row.kind == "choice" || row.kind == "device";
|
||||
property <bool> network: row.kind == "network";
|
||||
x: root.rows-x;
|
||||
x: root.rows-x + root.inset;
|
||||
y: self.top;
|
||||
width: root.rows-w;
|
||||
width: root.rows-w - 2 * root.inset;
|
||||
height: root.row-h;
|
||||
opacity: self.vis;
|
||||
visible: self.vis > 0.01;
|
||||
|
||||
if j > 0: Rectangle {
|
||||
x: root.pad;
|
||||
y: 0;
|
||||
width: parent.width - 2 * root.pad;
|
||||
height: 1.5 * root.u;
|
||||
background: #ffffff1f;
|
||||
opacity: 1 - clamp(max(r.f, r.f-above) * 2, 0, 1);
|
||||
}
|
||||
Text {
|
||||
x: 30 * root.u;
|
||||
y: row.detail == "" ? (parent.height - self.height) / 2 : 15 * root.u;
|
||||
width: parent.width * 0.55;
|
||||
x: root.pad;
|
||||
y: row.detail == "" ? (parent.height - self.height) / 2 : 14 * root.u;
|
||||
width: parent.width * 0.56;
|
||||
text: row.title;
|
||||
font-size: 26 * root.u;
|
||||
font-weight: 600;
|
||||
@@ -161,45 +173,43 @@ export component SettingsView inherits Rectangle {
|
||||
overflow: elide;
|
||||
}
|
||||
if row.detail != "": Text {
|
||||
x: 30 * root.u;
|
||||
y: 51 * root.u;
|
||||
width: parent.width * 0.55;
|
||||
x: root.pad;
|
||||
y: 50 * root.u;
|
||||
width: parent.width * 0.56;
|
||||
text: row.detail;
|
||||
font-size: 19 * root.u;
|
||||
font-size: 21 * root.u;
|
||||
color: r.ink-dim;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
x: parent.width * 0.4;
|
||||
width: parent.width * 0.6 - (r.network ? 124 : r.chevron ? 64 : 32) * root.u;
|
||||
width: parent.width * 0.6 - (r.network ? 120 : r.chevron ? 64 : root.pad / root.u) * root.u;
|
||||
height: parent.height;
|
||||
horizontal-alignment: right;
|
||||
vertical-alignment: center;
|
||||
text: row.value;
|
||||
font-size: row.kind == "option" ? 30 * root.u : 23 * root.u;
|
||||
font-size: row.kind == "option" ? 28 * root.u : 24 * root.u;
|
||||
font-weight: row.kind == "option" ? 700 : 400;
|
||||
color: row.kind == "option" ? (r.hot ? #121317 : #ff9a5c) : r.ink-dim;
|
||||
overflow: elide;
|
||||
}
|
||||
if r.chevron: Text {
|
||||
x: parent.width - 50 * root.u;
|
||||
if r.chevron: ChevronIcon {
|
||||
x: parent.width - root.pad - self.width + 4 * root.u;
|
||||
y: (parent.height - self.height) / 2;
|
||||
width: 24 * root.u;
|
||||
height: parent.height;
|
||||
vertical-alignment: center;
|
||||
text: "›";
|
||||
font-size: 36 * root.u;
|
||||
color: r.ink-dim;
|
||||
height: 24 * root.u;
|
||||
ink: r.ink-dim;
|
||||
}
|
||||
// Wi-Fi network: lock (protected) and signal strength on the right.
|
||||
if r.network && row.lock: LockIcon {
|
||||
x: parent.width - 104 * root.u;
|
||||
x: parent.width - root.pad - 34 * root.u - 16 * root.u - self.width;
|
||||
y: (parent.height - self.height) / 2;
|
||||
width: 24 * root.u;
|
||||
height: 24 * root.u;
|
||||
ink: r.ink-dim;
|
||||
}
|
||||
if r.network: SignalIcon {
|
||||
x: parent.width - 66 * root.u;
|
||||
x: parent.width - root.pad - self.width;
|
||||
y: (parent.height - self.height) / 2;
|
||||
width: 34 * root.u;
|
||||
height: 34 * root.u;
|
||||
|
||||
Reference in New Issue
Block a user