Merge branch 'claude/gifted-lovelace-1crlx2' into worktree-agent-a5ecbed1e5dd55ddc
This commit is contained in:
commit
608bd2fbf2
22 files changed
+614
-84
No files matched your search
@@ -534,24 +534,24 @@ pub fn run(options: RunOptions) -> Result<()> {
|
||||
let prefs = open_settings(&dir, &options.setting_overrides);
|
||||
let switches = crate::dev::Switches::from_env();
|
||||
// New identities of the official TeamSpeak clients, on every start (not
|
||||
// with the sample data of VOELIN_DEMO_UI); with none of our own yet, the
|
||||
// client's default identity becomes ours.
|
||||
let had_identity = !store.identities()?.is_empty();
|
||||
// with the sample data of VOELIN_DEMO_UI); the client's default
|
||||
// identity becomes ours while we have none the user chose.
|
||||
let imported = if prefs.get(&IDENTITY_IMPORT) && !switches.demo_ui {
|
||||
voelin_core::identity::import_new(&store, &voelin_core::identity::discover())
|
||||
.unwrap_or_else(|e| {
|
||||
warn!(%e, "could not import TeamSpeak identities");
|
||||
Vec::new()
|
||||
Default::default()
|
||||
})
|
||||
} else {
|
||||
Vec::new()
|
||||
Default::default()
|
||||
};
|
||||
let identity = match store.identities()?.first() {
|
||||
let identity = match store.default_identity()? {
|
||||
Some(entry) => store.identity(entry.id)?,
|
||||
None => {
|
||||
// Creating an identity takes a moment (security level 8).
|
||||
let identity = tsclientlib::Identity::create();
|
||||
store.add_identity(crate::servers::CREATED_IDENTITY, &identity)?;
|
||||
let origin = voelin_store::IdentityOrigin::Created;
|
||||
store.add_identity(crate::servers::CREATED_IDENTITY, &identity, origin)?;
|
||||
identity
|
||||
}
|
||||
};
|
||||
@@ -636,7 +636,7 @@ pub fn run(options: RunOptions) -> Result<()> {
|
||||
if app.demo {
|
||||
app.start_demo();
|
||||
}
|
||||
if let Some(text) = crate::servers::imported_status(&imported, had_identity) {
|
||||
if let Some(text) = crate::servers::imported_status(&imported) {
|
||||
app.set_status(text);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -52,4 +52,10 @@ pub(super) fn wire(ui: &MainWindow) {
|
||||
bridge.on_open_about(|| {
|
||||
with_app(|app| app.load_notices());
|
||||
});
|
||||
bridge.on_use_identity(|id| {
|
||||
with_app(|app| app.use_identity(id as i64));
|
||||
});
|
||||
bridge.on_set_identity_import(|on| {
|
||||
with_app(|app| app.set_identity_import(on));
|
||||
});
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
//! - `VOELIN_DEMO_STREAM=1`: a local test stream in the viewer.
|
||||
//! - `VOELIN_OPEN=<what>[,<what>...]`: open screens on start: `home`,
|
||||
//! `server`, `settings[:<section>]` (voice, keybinds, streaming, privacy,
|
||||
//! appearance, or 0-4), `about`, `share`, `bookmark` (add a server;
|
||||
//! appearance, identities, or 0-5), `about`, `share`, `bookmark` (add a server;
|
||||
//! `bookmark:edit` the current one, Advanced open),
|
||||
//! `emoji` (the picker), `client` (the volume dialog of the first other
|
||||
//! client once connected), `panel` / `no-panel` (the members panel),
|
||||
@@ -108,6 +108,7 @@ fn section(name: &str) -> SettingsSection {
|
||||
"2" | "streaming" => SettingsSection::Streaming,
|
||||
"3" | "privacy" => SettingsSection::Privacy,
|
||||
"4" | "appearance" => SettingsSection::Appearance,
|
||||
"5" | "identities" => SettingsSection::Identities,
|
||||
_ => SettingsSection::Voice,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
//! Settings → Identities: the stored identities, which one servers see us
|
||||
//! as (the default), and the import of the official clients' identities on
|
||||
//! start (`voelin_core::identity::import_new`, app.rs).
|
||||
|
||||
use slint::ComponentHandle;
|
||||
use tracing::warn;
|
||||
use voelin_core::settings::IDENTITY_IMPORT;
|
||||
use voelin_store::{IdentityEntry, IdentityOrigin};
|
||||
|
||||
use crate::app::{App, Bridge, IdentityItem, model};
|
||||
use crate::vm::avatar;
|
||||
|
||||
/// A row of the identities card.
|
||||
fn item(entry: &IdentityEntry) -> IdentityItem {
|
||||
let origin = match entry.origin {
|
||||
IdentityOrigin::Imported => "From TeamSpeak",
|
||||
IdentityOrigin::Created | IdentityOrigin::User => "Made in Voelin",
|
||||
};
|
||||
IdentityItem {
|
||||
id: entry.id as i32,
|
||||
name: entry.name.clone().into(),
|
||||
detail: format!("{origin} · level {}", entry.level).into(),
|
||||
uid: entry.uid.clone().into(),
|
||||
initials: avatar::initials(&entry.name).into(),
|
||||
tint: avatar::tint(&entry.name),
|
||||
is_default: entry.is_default,
|
||||
}
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub(crate) fn refresh_identities(&self) {
|
||||
let Some(ui) = self.ui.upgrade() else { return };
|
||||
let bridge = ui.global::<Bridge>();
|
||||
let mut entries = self.store.identities().unwrap_or_default();
|
||||
// A store from before defaults were marked: the first one.
|
||||
let default = self.store.default_identity().ok().flatten().map(|e| e.id);
|
||||
for entry in &mut entries {
|
||||
entry.is_default = Some(entry.id) == default;
|
||||
}
|
||||
bridge.set_identities(model(entries.iter().map(item).collect()));
|
||||
bridge.set_identity_import(self.prefs.get(&IDENTITY_IMPORT));
|
||||
}
|
||||
|
||||
/// The user's choice of the identity servers see us as, from the next
|
||||
/// connection on; no import replaces it.
|
||||
pub(crate) fn use_identity(&mut self, id: i64) {
|
||||
let result =
|
||||
self.store.set_default_identity(id, true).and_then(|()| self.store.identity(id));
|
||||
match result {
|
||||
Ok(identity) => {
|
||||
self.identity = identity;
|
||||
let name = self
|
||||
.store
|
||||
.identities()
|
||||
.ok()
|
||||
.and_then(|all| all.into_iter().find(|e| e.id == id))
|
||||
.map(|e| e.name)
|
||||
.unwrap_or_default();
|
||||
self.set_status(format!(
|
||||
"Servers see you as \u{201c}{name}\u{201d} from your next connection"
|
||||
));
|
||||
}
|
||||
Err(e) => self.set_status(format!("Could not change the identity: {e}")),
|
||||
}
|
||||
self.refresh_identities();
|
||||
}
|
||||
|
||||
pub(crate) fn set_identity_import(&mut self, on: bool) {
|
||||
if let Err(e) = self.prefs.set(&IDENTITY_IMPORT, on) {
|
||||
warn!(%e, "could not store the setting");
|
||||
}
|
||||
self.refresh_identities();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn rows_say_where_an_identity_came_from() {
|
||||
let entry = |origin, is_default| IdentityEntry {
|
||||
id: 3,
|
||||
name: "Main Nick".into(),
|
||||
uid: "uid=".into(),
|
||||
level: 8,
|
||||
origin,
|
||||
is_default,
|
||||
};
|
||||
let row = item(&entry(IdentityOrigin::Imported, true));
|
||||
assert_eq!((row.id, row.name.as_str(), row.uid.as_str()), (3, "Main Nick", "uid="));
|
||||
assert_eq!(row.detail, "From TeamSpeak · level 8");
|
||||
assert!(row.is_default);
|
||||
assert_eq!(row.initials, avatar::initials("Main Nick"));
|
||||
for origin in [IdentityOrigin::Created, IdentityOrigin::User] {
|
||||
let row = item(&entry(origin, false));
|
||||
assert_eq!(row.detail, "Made in Voelin · level 8");
|
||||
assert!(!row.is_default);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ mod chat;
|
||||
mod dev;
|
||||
mod emoji;
|
||||
mod hotkey;
|
||||
mod identities;
|
||||
mod images;
|
||||
mod inbox;
|
||||
mod members;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
use slint::{ComponentHandle, SharedString};
|
||||
use tracing::warn;
|
||||
use voelin_core::identity::Found;
|
||||
use voelin_core::identity::LaunchImport;
|
||||
use voelin_core::{Command, ObserveState, Source, VoiceOptions, VoiceState};
|
||||
use voelin_store::{Bookmark, QueryConfig, QueryTransport};
|
||||
|
||||
@@ -14,20 +14,20 @@ use crate::vm;
|
||||
pub(crate) const CREATED_IDENTITY: &str = "Default";
|
||||
|
||||
/// What to tell the user about the identities imported from the official
|
||||
/// clients at start ([`voelin_core::identity::import_new`]), if any.
|
||||
/// `had_identity`: we had one before, so it stays the default.
|
||||
pub(crate) fn imported_status(imported: &[Found], had_identity: bool) -> Option<String> {
|
||||
let first = imported.first()?;
|
||||
let n = imported.len();
|
||||
let names = imported.iter().map(|f| f.nickname.as_str()).collect::<Vec<_>>().join(", ");
|
||||
Some(match (had_identity, n) {
|
||||
(true, 1) => format!("Imported the identity \u{201c}{names}\u{201d} from TeamSpeak"),
|
||||
(true, _) => format!("Imported {n} identities from TeamSpeak: {names}"),
|
||||
(false, 1) => format!("Using your TeamSpeak identity \u{201c}{names}\u{201d}"),
|
||||
(false, _) => format!(
|
||||
"Using your TeamSpeak identity \u{201c}{}\u{201d} ({n} imported: {names})",
|
||||
first.nickname
|
||||
/// clients at start ([`voelin_core::identity::import_new`]), if anything.
|
||||
pub(crate) fn imported_status(report: &LaunchImport) -> Option<String> {
|
||||
let n = report.added.len();
|
||||
let names = report.added.iter().map(|f| f.nickname.as_str()).collect::<Vec<_>>().join(", ");
|
||||
let more = if n > 1 { format!(" ({n} imported: {names})") } else { String::new() };
|
||||
Some(match &report.default {
|
||||
Some(f) if report.replaced => format!(
|
||||
"You now use your TeamSpeak identity \u{201c}{}\u{201d}; your previous one is kept{more}",
|
||||
f.nickname
|
||||
),
|
||||
Some(f) => format!("Using your TeamSpeak identity \u{201c}{}\u{201d}{more}", f.nickname),
|
||||
None if n == 1 => format!("Imported the identity \u{201c}{names}\u{201d} from TeamSpeak"),
|
||||
None if n > 1 => format!("Imported {n} identities from TeamSpeak: {names}"),
|
||||
None => return None,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -104,9 +104,9 @@ impl App {
|
||||
/// from TeamSpeak keeps the nickname used there), else the system user's.
|
||||
pub(crate) fn default_nickname(&self) -> String {
|
||||
self.store
|
||||
.identities()
|
||||
.default_identity()
|
||||
.ok()
|
||||
.and_then(|identities| identities.into_iter().next())
|
||||
.flatten()
|
||||
.map(|identity| identity.name)
|
||||
.filter(|name| {
|
||||
![CREATED_IDENTITY, voelin_core::identity::DEFAULT_NICKNAME]
|
||||
@@ -470,6 +470,8 @@ impl App {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use voelin_core::identity::Found;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
@@ -536,14 +538,24 @@ mod tests {
|
||||
source: "settings.db".into(),
|
||||
selected: false,
|
||||
};
|
||||
assert_eq!(imported_status(&[], false), None);
|
||||
let report = |added: &[&str], default: Option<&str>, replaced| LaunchImport {
|
||||
added: added.iter().map(|n| found(n)).collect(),
|
||||
default: default.map(found),
|
||||
replaced,
|
||||
};
|
||||
assert_eq!(imported_status(&report(&[], None, false)), None);
|
||||
assert_eq!(
|
||||
imported_status(&[found("Main")], false).unwrap(),
|
||||
imported_status(&report(&["Main"], Some("Main"), false)).unwrap(),
|
||||
"Using your TeamSpeak identity \u{201c}Main\u{201d}"
|
||||
);
|
||||
assert_eq!(
|
||||
imported_status(&[found("Main"), found("Alt")], true).unwrap(),
|
||||
imported_status(&report(&["Main", "Alt"], None, false)).unwrap(),
|
||||
"Imported 2 identities from TeamSpeak: Main, Alt"
|
||||
);
|
||||
// Imported earlier, now ours instead of the one the app made.
|
||||
assert_eq!(
|
||||
imported_status(&report(&[], Some("Main"), true)).unwrap(),
|
||||
"You now use your TeamSpeak identity \u{201c}Main\u{201d}; your previous one is kept"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ impl App {
|
||||
bridge.set_h264_enabled(self.settings.openh264);
|
||||
bridge.set_image_cache_usage(crate::images::usage_text().into());
|
||||
self.refresh_h264();
|
||||
self.refresh_identities();
|
||||
}
|
||||
|
||||
pub(crate) fn close_settings(&mut self) {
|
||||
|
||||
@@ -212,6 +212,7 @@ export component MainWindow inherits Window {
|
||||
x: (parent.width - self.width) / 2;
|
||||
y: parent.height - self.height - (Nav.narrow ? 140px : 96px);
|
||||
text: Bridge.status-text;
|
||||
widest: min(560px, parent.width - 32px);
|
||||
}
|
||||
|
||||
// The member card of the members panel, over everything.
|
||||
|
||||
@@ -276,6 +276,19 @@ export struct ShareForm {
|
||||
auto-accept: bool,
|
||||
}
|
||||
|
||||
// An identity in Settings → Identities.
|
||||
export struct IdentityItem {
|
||||
id: int,
|
||||
name: string,
|
||||
// "From TeamSpeak · level 8"
|
||||
detail: string,
|
||||
// The unique id servers know it by (TeamSpeak 3 form).
|
||||
uid: string,
|
||||
initials: string,
|
||||
tint: color,
|
||||
is-default: bool,
|
||||
}
|
||||
|
||||
export struct AudioForm {
|
||||
// 0 = system default, then the devices.
|
||||
input-index: int,
|
||||
@@ -448,6 +461,12 @@ export global Bridge {
|
||||
in property <string> crash-notice;
|
||||
// Third-party notices, one entry per line, for the About page.
|
||||
in property <[string]> notices;
|
||||
// Settings → Identities: who servers see us as, and the import of the
|
||||
// official clients' identities on start (identity.import_from_teamspeak).
|
||||
in property <[IdentityItem]> identities;
|
||||
in-out property <bool> identity-import;
|
||||
callback use-identity(int);
|
||||
callback set-identity-import(bool);
|
||||
|
||||
callback select-server(int);
|
||||
// The search field of the top bar: filters the channel tree.
|
||||
|
||||
@@ -234,8 +234,10 @@ export component Toast inherits Rectangle {
|
||||
in property <image> icon: Icons.info;
|
||||
in property <duration> timeout: 5s;
|
||||
in-out property <bool> shown;
|
||||
// The widest it gets (e.g. the window less a margin); longer text wraps.
|
||||
in property <length> widest: 560px;
|
||||
height: shown ? row.preferred-height + 16px : 0px;
|
||||
width: min(row.preferred-width + 24px, 560px);
|
||||
width: min(row.preferred-width + 24px, widest);
|
||||
visible: shown;
|
||||
border-radius: Theme.radius-lg;
|
||||
background: Theme.surface-3;
|
||||
@@ -266,7 +268,7 @@ export component Toast inherits Rectangle {
|
||||
text: root.text;
|
||||
color: Theme.text;
|
||||
vertical-alignment: center;
|
||||
overflow: elide;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ export enum SettingsSection {
|
||||
streaming,
|
||||
privacy,
|
||||
appearance,
|
||||
identities,
|
||||
}
|
||||
|
||||
// Tabs of the bottom navigation in the narrow (mobile) layout.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Theme } from "../theme.slint";
|
||||
import { Icons } from "../icons.slint";
|
||||
import { Bridge } from "../bridge.slint";
|
||||
import { Nav, SettingsSection } from "../nav.slint";
|
||||
import { Icon, Button, ButtonKind, TextField, Field, Select, Toggle, ToggleRow, Slider, SegmentedTabs, Card, Meter, NavItem, Divider, ScrollView } from "../components/index.slint";
|
||||
import { Icon, Button, ButtonKind, TextField, Field, Select, Toggle, ToggleRow, Slider, SegmentedTabs, Card, Meter, NavItem, Divider, ScrollView, Avatar, Chip } from "../components/index.slint";
|
||||
|
||||
// A label, a control (@children) and a value at the right.
|
||||
component SliderRow inherits HorizontalLayout {
|
||||
@@ -89,6 +89,13 @@ export component SettingsNav inherits VerticalLayout {
|
||||
selected: Nav.settings-section == SettingsSection.appearance;
|
||||
clicked => { Nav.open-settings(SettingsSection.appearance); }
|
||||
}
|
||||
NavItem {
|
||||
icon: Icons.user;
|
||||
text: @tr("Identities");
|
||||
subtitle: @tr("Who servers see you as");
|
||||
selected: Nav.settings-section == SettingsSection.identities;
|
||||
clicked => { Nav.open-settings(SettingsSection.identities); }
|
||||
}
|
||||
Divider { }
|
||||
NavItem {
|
||||
icon: Icons.info;
|
||||
@@ -450,6 +457,77 @@ component AppearanceSection inherits VerticalLayout {
|
||||
}
|
||||
}
|
||||
|
||||
// The identities (key pairs; servers know us by their unique ids) and which
|
||||
// one is used.
|
||||
component IdentitiesSection inherits VerticalLayout {
|
||||
alignment: start;
|
||||
spacing: Theme.space-5;
|
||||
Card {
|
||||
title: @tr("Your identities");
|
||||
icon: Icons.user;
|
||||
for identity in Bridge.identities: HorizontalLayout {
|
||||
spacing: Theme.space-4;
|
||||
Avatar {
|
||||
initials: identity.initials;
|
||||
tint: identity.tint;
|
||||
label: identity.name;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
Text {
|
||||
text: identity.name;
|
||||
color: Theme.text;
|
||||
font-weight: Theme.weight-semibold;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: identity.detail;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: identity.uid;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
if identity.is-default: Chip {
|
||||
text: @tr("Default");
|
||||
icon: Icons.check;
|
||||
tint: Theme.accent-text;
|
||||
fill: Theme.accent-soft;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
if !identity.is-default: Button {
|
||||
small: true;
|
||||
text: @tr("Use as default");
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.use-identity(identity.id); }
|
||||
}
|
||||
}
|
||||
Hint {
|
||||
text: @tr("Servers know you by the default identity's unique id, from the next connection on. An identity is a key: whoever has a copy can be you on every server.");
|
||||
}
|
||||
}
|
||||
Card {
|
||||
title: @tr("TeamSpeak");
|
||||
icon: Icons.download;
|
||||
ToggleRow {
|
||||
text: @tr("Import identities from TeamSpeak on start");
|
||||
description: @tr("Reads the official clients' identities, never changes them");
|
||||
checked <=> Bridge.identity-import;
|
||||
toggled => { Bridge.set-identity-import(Bridge.identity-import); }
|
||||
}
|
||||
Hint {
|
||||
text: @tr("While you use the identity Voelin made for you, the one TeamSpeak uses becomes your default, once.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The page of the selected section.
|
||||
export component SettingsPage inherits Rectangle {
|
||||
// Show the section navigation above the content (narrow windows).
|
||||
@@ -457,15 +535,18 @@ export component SettingsPage inherits Rectangle {
|
||||
property <image> section-icon: Nav.settings-section == SettingsSection.voice ? Icons.mic
|
||||
: Nav.settings-section == SettingsSection.keybinds ? Icons.keyboard
|
||||
: Nav.settings-section == SettingsSection.streaming ? Icons.radio
|
||||
: Nav.settings-section == SettingsSection.privacy ? Icons.shield : Icons.palette;
|
||||
: Nav.settings-section == SettingsSection.privacy ? Icons.shield
|
||||
: Nav.settings-section == SettingsSection.identities ? Icons.user : Icons.palette;
|
||||
property <string> section-title: Nav.settings-section == SettingsSection.voice ? @tr("Voice & Video")
|
||||
: Nav.settings-section == SettingsSection.keybinds ? @tr("Keybinds")
|
||||
: Nav.settings-section == SettingsSection.streaming ? @tr("Streaming")
|
||||
: Nav.settings-section == SettingsSection.privacy ? @tr("Privacy & Safety") : @tr("Appearance");
|
||||
: Nav.settings-section == SettingsSection.privacy ? @tr("Privacy & Safety")
|
||||
: Nav.settings-section == SettingsSection.identities ? @tr("Identities") : @tr("Appearance");
|
||||
property <string> section-subtitle: Nav.settings-section == SettingsSection.voice ? @tr("Set up your microphone, speakers and voice processing.")
|
||||
: Nav.settings-section == SettingsSection.keybinds ? @tr("Talk with a key, even while other windows have focus.")
|
||||
: Nav.settings-section == SettingsSection.streaming ? @tr("Codecs for watching streams.")
|
||||
: Nav.settings-section == SettingsSection.privacy ? @tr("What the app keeps on this device.") : @tr("Theme, text size and layout. Changes apply at once.");
|
||||
: Nav.settings-section == SettingsSection.privacy ? @tr("What the app keeps on this device.")
|
||||
: Nav.settings-section == SettingsSection.identities ? @tr("Who servers see you as.") : @tr("Theme, text size and layout. Changes apply at once.");
|
||||
accessible-role: AccessibleRole.groupbox;
|
||||
accessible-label: section-title;
|
||||
sv := ScrollView {
|
||||
@@ -475,11 +556,11 @@ export component SettingsPage inherits Rectangle {
|
||||
spacing: Theme.space-5;
|
||||
alignment: start;
|
||||
if root.compact: SegmentedTabs {
|
||||
model: [@tr("Voice"), @tr("Keys"), @tr("Streams"), @tr("Privacy"), @tr("Look")];
|
||||
current-index: Nav.settings-section == SettingsSection.voice ? 0 : Nav.settings-section == SettingsSection.keybinds ? 1 : Nav.settings-section == SettingsSection.streaming ? 2 : Nav.settings-section == SettingsSection.privacy ? 3 : 4;
|
||||
model: [@tr("Voice"), @tr("Keys"), @tr("Streams"), @tr("Privacy"), @tr("Look"), @tr("ID")];
|
||||
current-index: Nav.settings-section == SettingsSection.voice ? 0 : Nav.settings-section == SettingsSection.keybinds ? 1 : Nav.settings-section == SettingsSection.streaming ? 2 : Nav.settings-section == SettingsSection.privacy ? 3 : Nav.settings-section == SettingsSection.identities ? 5 : 4;
|
||||
label: @tr("Settings sections");
|
||||
selected(i) => {
|
||||
Nav.open-settings(i == 0 ? SettingsSection.voice : i == 1 ? SettingsSection.keybinds : i == 2 ? SettingsSection.streaming : i == 3 ? SettingsSection.privacy : SettingsSection.appearance);
|
||||
Nav.open-settings(i == 0 ? SettingsSection.voice : i == 1 ? SettingsSection.keybinds : i == 2 ? SettingsSection.streaming : i == 3 ? SettingsSection.privacy : i == 5 ? SettingsSection.identities : SettingsSection.appearance);
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
@@ -510,6 +591,7 @@ export component SettingsPage inherits Rectangle {
|
||||
if Nav.settings-section == SettingsSection.streaming: StreamingSection { }
|
||||
if Nav.settings-section == SettingsSection.privacy: PrivacySection { }
|
||||
if Nav.settings-section == SettingsSection.appearance: AppearanceSection { }
|
||||
if Nav.settings-section == SettingsSection.identities: IdentitiesSection { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user