Integrate and verify the native Windows desktop client

- Update pinned Rust, Slint, DSP and WebRTC dependencies, preserving the local vendor patches and source receipts.
- Fix desktop audio scheduling and disconnect handling; include isolated duplex, identity, bookmark and notification checks.
- Record measured differences from TeamSpeak 6.0.0.5232; full visual and server-feature parity remain open.
This commit is contained in:
omar committed 2026-11-26 16:59:05 +03:00
1 parent 05e8d34bcf
commit 57807c184e
530 files changed
+68818 -47940

No files matched your search

+668 -69
View File
@@ -1,12 +1,16 @@
import { ScrollView, ListView, Slider } from "std-widgets.slint";
import { Theme } from "theme.slint";
import { ActionButton, TextField } from "controls.slint";
import { ChatScreen } from "chat.slint";
import { ChatBridge, ChatScreen } from "chat.slint";
import { SettingsScreen } from "settings.slint";
export struct ShellRow { id: string, title: string, subtitle: string, depth: int, selected: bool, expanded: bool, expandable: bool, talking: bool, muted: bool, unread: string }
export struct ShellRow {
id: string, key: string, title: string, subtitle: string, depth: int, selected: bool, expanded: bool, expandable: bool,
talking: bool, muted: bool, unread: string, kind: int, joined: bool, password: bool, full: bool,
moderated: bool, spacer: int, own: bool, contact: bool, deafened: bool, away: bool, recording: bool, streaming: bool,
}
export struct ShellTab { id: string, title: string, selected: bool, microphone-owner: bool, connected: bool, unread: string }
export struct ShellCommand { id: string, label: string, enabled: bool, reason: string, destructive: bool }
export struct ShellCommand { id: string, label: string, enabled: bool, reason: string, destructive: bool, glyph: int, heading: bool }
export struct ShellInfo { label: string, value: string }
export struct ShellStream { id: string, title: string, status: string, frame: image, has-frame: bool, volume: float, actions: [ShellCommand] }
export global ShellBridge {
@@ -15,6 +19,22 @@ export global ShellBridge {
in-out property <[ShellRow]> bookmarks;
in-out property <[ShellRow]> contacts;
in-out property <[ShellRow]> entries;
in-out property <[ShellTab]> sidebar-tabs;
in-out property <[ShellRow]> sidebar-bookmarks;
in-out property <string> sidebar-search;
in-out property <string> bookmark-up-command;
in-out property <bool> can-add-bookmark;
in-out property <string> bookmark-location;
in-out property <string> contact-add-command;
in-out property <string> label-add-contact;
in-out property <string> new-connection-command;
in-out property <string> away-command;
in-out property <string> capture-command;
in-out property <string> create-channel-command;
in-out property <string> save-bookmark-command;
in-out property <string> server-chat-command;
in-out property <string> label-save-bookmark;
in-out property <string> label-server-chat;
in-out property <[ShellInfo]> info;
in-out property <[ShellCommand]> actions;
in-out property <[ShellCommand]> detail-actions;
@@ -34,10 +54,14 @@ export global ShellBridge {
in-out property <bool> detail-loading;
in-out property <bool> menu-visible;
in-out property <string> menu-title;
in-out property <float> menu-x;
in-out property <float> menu-y;
in-out property <int> menu-glyph: -1;
in-out property <bool> has-voice;
in-out property <bool> muted;
in-out property <bool> deafened;
in-out property <bool> transmitting;
in-out property <bool> away;
in-out property <bool> ptt-enabled;
in-out property <string> voice-title;
in-out property <string> voice-status;
@@ -57,6 +81,12 @@ export global ShellBridge {
in-out property <string> label-deafen;
in-out property <string> label-ptt;
in-out property <string> label-bookmarks;
in-out property <string> label-connections;
in-out property <string> label-new-connection;
in-out property <string> label-away;
in-out property <string> label-password;
in-out property <string> label-capture;
in-out property <string> label-create-channel;
in-out property <string> label-search;
in-out property <string> label-next;
in-out property <string> label-previous;
@@ -69,14 +99,18 @@ export global ShellBridge {
callback back();
callback select(string);
callback expand(string);
callback context(string);
callback menu();
callback context(string,float,float);
callback menu(float,float);
callback bookmark-menu(float,float);
callback bookmark-drag-start(string);
callback bookmark-drag-end(string,bool);
callback close-menu();
callback invoke(string);
callback row-press(string,bool);
callback row-press(string,bool,float,float);
callback voice(int);
callback held(bool);
callback search-edited(string);
callback sidebar-search-edited();
callback page(bool);
in-out property <string> fullscreen-stream;
callback stream-volume(string,float);
@@ -85,6 +119,7 @@ export global ShellBridge {
component EntryRow inherits Rectangle {
in property <ShellRow> item;
function context-menu() { ShellBridge.context(root.item.id, (root.absolute-position.x + 20px) / 1px, (root.absolute-position.y + root.height / 2) / 1px); }
height: max(44px, Theme.touch-target);
border-radius: 9px;
background: item.selected ? Theme.contrast : (touch.has-hover ? Theme.bg : transparent);
@@ -108,28 +143,48 @@ component EntryRow inherits Rectangle {
if root.item.subtitle != "": Text { text: root.item.subtitle; color: Theme.muted; font-size: Theme.font-size * 0.86; overflow: elide; }
}
if root.item.unread != "": Text { text: root.item.unread; color: Theme.tint; vertical-alignment: center; }
ActionButton { text: ShellBridge.label-more; width: 70px; clicked => { ShellBridge.context(root.item.id); } }
ActionButton { text: ShellBridge.label-more; width: 70px; clicked => { root.context-menu(); } }
}
focus := FocusScope { key-pressed(e) => { if e.text == "\n" { ShellBridge.select(root.item.id); return accept; } if e.text == Key.F10 && e.modifiers.shift { ShellBridge.context(root.item.id); return accept; } return reject; } }
focus := FocusScope { key-pressed(e) => { if e.text == "\n" { ShellBridge.select(root.item.id); return accept; } if e.text == Key.F10 && e.modifiers.shift { root.context-menu(); return accept; } return reject; } }
// Explicit overflow is always available on touch; right click never selects a row.
touch := TouchArea {
x: root.item.expandable ? 54px + root.item.depth * 14px : 0px;
width: max(0px,parent.width - self.x - 78px);
clicked => { focus.focus(); ShellBridge.select(root.item.id); }
pointer-event(e) => {
if e.button == PointerEventButton.right && e.kind == PointerEventKind.down { ShellBridge.context(root.item.id); }
if e.button == PointerEventButton.left && e.kind == PointerEventKind.down { ShellBridge.row-press(root.item.id,true); }
if e.kind == PointerEventKind.up || e.kind == PointerEventKind.cancel { ShellBridge.row-press(root.item.id,false); }
if e.kind == PointerEventKind.move && (abs((self.mouse-x - self.pressed-x)/1px)>8 || abs((self.mouse-y - self.pressed-y)/1px)>8) { ShellBridge.row-press(root.item.id,false); }
if e.button == PointerEventButton.right && e.kind == PointerEventKind.down { ShellBridge.context(root.item.id, (self.absolute-position.x + self.mouse-x) / 1px, (self.absolute-position.y + self.mouse-y) / 1px); }
if e.button == PointerEventButton.left && e.kind == PointerEventKind.down { ShellBridge.row-press(root.item.id,true,(self.absolute-position.x + self.mouse-x) / 1px,(self.absolute-position.y + self.mouse-y) / 1px); }
if e.kind == PointerEventKind.up || e.kind == PointerEventKind.cancel || (e.kind == PointerEventKind.move && (abs((self.mouse-x - self.pressed-x)/1px)>8 || abs((self.mouse-y - self.pressed-y)/1px)>8)) { ShellBridge.row-press(root.item.id,false,0,0); }
}
}
}
global ShellColors {
out property <color> bar: Theme.dark ? #121a2c : Theme.shaded;
out property <color> sidebar-end: Theme.dark ? #1d2537 : Theme.bg;
out property <color> divider: Theme.dark ? #171c2a : Theme.deviant;
out property <color> strong: Theme.dark ? #0b1124 : Theme.contrast;
out property <color> client: Theme.high-contrast ? Theme.fg : Theme.dark ? #bbd6f3 : #445d77;
out property <color> subtitle: Theme.high-contrast ? Theme.fg : Theme.subtitle;
out property <color> selection-tint: Theme.high-contrast ? Theme.fg : Theme.tint-secondary;
out property <color> tool: Theme.dark || Theme.high-contrast ? Theme.fg : #494949;
out property <color> constructive: Theme.dark ? Theme.toggle-checked : Theme.success;
out property <brush> detail-header: Theme.dark ? Theme.shaded : @linear-gradient(180deg, #f3f3f3, #dcdcdc);
out property <color> popup-disabled: Theme.high-contrast ? Theme.fg : Theme.dark ? #9c9c9c : #888;
out property <color> popup-danger: Theme.dark ? Theme.error-light : #e61919;
out property <color> popup-hover: Theme.dark ? #1c2538d9 : Theme.contrast;
out property <brush> popup: @linear-gradient(180deg, (Theme.dark ? #0b1124 : Theme.contrast).with-alpha(Theme.high-contrast ? 1.0 : 0.8), (Theme.dark ? #222c41 : Theme.contrast).with-alpha(Theme.high-contrast ? 1.0 : 0.8));
out property <brush> tree: @linear-gradient(25deg, Theme.dark ? #252f44 : #e1e3ed 0%, Theme.dark ? #2e374c : Theme.bg 60%);
out property <brush> banner: @linear-gradient(180deg, (Theme.dark ? #0b1124 : Theme.contrast).with-alpha(0.9), (Theme.dark ? #222c41 : Theme.deviant).with-alpha(0.9));
out property <brush> channel: @linear-gradient(90deg, Theme.dark ? #192031 : #a9bee1 50%, Theme.dark ? #1d263a : #8391b3 100%);
}
component CommandList inherits VerticalLayout {
in property <[ShellCommand]> commands;
spacing: 4px;
for command in root.commands: VerticalLayout {
ActionButton { text: command.label; enabled: command.enabled; destructive: command.destructive; clicked => { ShellBridge.invoke(command.id); } }
if command.heading: Text { text: command.label; color: ShellColors.subtitle; }
if !command.heading: ActionButton { text: command.label; enabled: command.enabled; destructive: command.destructive; clicked => { ShellBridge.invoke(command.id); } }
if command.reason != "": Text { text: command.reason; color: Theme.muted; wrap: word-wrap; }
}
}
@@ -155,61 +210,526 @@ component StreamTile inherits Rectangle {
}
}
// Independent line pictograms: server, channel, person, chat, settings, chevrons, tools.
component ShellGlyph inherits Rectangle {
in property <int> glyph;
in property <color> ink: Theme.fg;
width: 22px; height: 22px;
if root.glyph == 2: Rectangle { border-radius: self.width / 2; background: Theme.dark ? #202d31 : #c9d9e5; }
Path {
width: 100%; height: 100%; viewbox-width: 24; viewbox-height: 24;
stroke: root.ink; stroke-width: 1.5px;
fill: root.glyph == 2 ? root.ink : transparent;
commands: root.glyph == 0 ? "M12 2 L21 7 V17 L12 22 L3 17 V7 Z M3 10 L12 15 L21 10 M3 14 L12 19 L21 14 M3 7 L12 12 L21 7" :
root.glyph == 1 ? "M12 2 L21 7 V17 L12 22 L3 17 V7 Z M12 2 V12 L21 17 M12 12 L3 17" :
root.glyph == 2 ? "M12 5 A3 3 0 1 0 12 11 A3 3 0 1 0 12 5 Z M7 17 C7 12 17 12 17 17 C17 21 7 21 7 17 Z" :
root.glyph == 3 ? "M5 4 H19 Q21 4 21 7 V16 Q21 18 19 18 H10 L4 22 V7 Q4 4 5 4 Z" :
root.glyph == 4 ? "M12 8 A4 4 0 1 0 12 16 A4 4 0 1 0 12 8 Z M12 2 V6 M12 18 V22 M2 12 H6 M18 12 H22 M5 5 L8 8 M16 16 L19 19 M5 19 L8 16 M16 8 L19 5" :
root.glyph == 5 ? "M7 10 L12 15 L17 10" :
root.glyph == 6 ? "M10 7 L15 12 L10 17" :
root.glyph == 7 ? "M5 12 L6 12 M11.5 12 L12.5 12 M18 12 L19 12" :
root.glyph == 8 ? "M12 5 V19 M5 12 H19" :
root.glyph == 9 ? "M12 2 A3 3 0 0 1 15 5 V12 A3 3 0 0 1 9 12 V5 A3 3 0 0 1 12 2 Z M5 11 A7 7 0 0 0 19 11 M12 18 V22 M8 22 H16" :
root.glyph == 10 ? "M3 8 H7 L12 4 V20 L7 16 H3 Z M15 8 Q20 12 15 16 M18 5 Q25 12 18 19" :
root.glyph == 11 ? "M12 2 A10 10 0 1 0 12 22 A10 10 0 1 0 12 2 Z M12 6 V12 L16 15" :
root.glyph == 12 ? "M4 3 H20 V17 H4 Z M8 21 H16 M12 17 V21" :
root.glyph == 13 ? "M6 3 H18 V21 L12 16 L6 21 Z" :
root.glyph == 14 ? "M5 10 H19 V21 H5 Z M8 10 V6 A4 4 0 1 1 16 6 V10" :
root.glyph == 18 ? "M10 3 A7 7 0 1 0 10 17 A7 7 0 1 0 10 3 Z M15 15 L21 21" :
root.glyph == 15 ? "M6 6 L18 18 M18 6 L6 18" :
root.glyph == 16 ? "M12 4 A8 8 0 1 0 12 20 A8 8 0 1 0 12 4 Z M12 10 V16 M12 7 V8" :
root.glyph == 19 ? "M12 2 L21 7 V17 L12 22 L3 17 V7 Z M3 7 L12 12 L21 7 M12 12 V22" :
root.glyph == 20 ? "M8 12 V5 A1.5 1.5 0 0 1 11 5 V10 L13 8 L17 9 L19 11 V15 L16 20 H10 L5 14 A2 2 0 0 1 8 12 Z" :
root.glyph == 21 ? "M4 20 V12 H7 V20 Z M10 20 V7 H13 V20 Z M16 20 V3 H19 V20 Z" :
root.glyph == 22 ? "M10 4 H5 V20 H10 M10 12 H20 M16 8 L20 12 L16 16" :
root.glyph == 23 ? "M3 5 H21 V18 H16 M3 5 V18 H8 M12 22 V11 M8 15 L12 11 L16 15" :
root.glyph == 24 ? "M3 4 H21 V19 H3 Z M5 14 L8 8 L11 14 M6 12 H10 M13 14 V8 H17 M13 11 H16 M19 8 V14" :
root.glyph == 25 ? "M9 9 V5 A3 3 0 0 1 15 5 V11 M9 13 A3 3 0 0 0 14 14 M5 11 A7 7 0 0 0 16 17 M12 18 V22 M8 22 H16 M3 3 L21 21" :
root.glyph == 26 ? "M3 8 H7 L12 4 V12 M3 8 V16 H7 L12 20 V16 M15 8 Q20 12 15 16 M3 3 L21 21" :
root.glyph == 27 ? "M12 3 A9 9 0 1 0 12 21 A9 9 0 1 0 12 3 Z M12 7 V17 M7 12 H17" :
root.glyph == 28 ? "M3 5 H9 L11 8 H21 V20 H3 Z" :
root.glyph == 29 ? "M14 6 L8 12 L14 18" :
"M12 4 A8 8 0 1 0 12 20 A8 8 0 1 0 12 4 Z M12 9 A3 3 0 1 0 12 15 A3 3 0 1 0 12 9 Z";
}
}
component DesktopMenuEntry inherits Rectangle {
in property <ShellCommand> command;
property <length> label-height: 30px;
height: root.label-height + (root.command.reason == "" ? 0px : reason.preferred-height + 4px);
accessible-role: button;
accessible-label: root.command.label;
accessible-description: root.command.reason;
accessible-enabled: root.command.enabled;
accessible-action-default => { if root.command.enabled { ShellBridge.invoke(root.command.id); } }
background: pointer.has-hover || keyboard.has-focus ? ShellColors.popup-hover : transparent;
border-width: keyboard.has-focus ? 1px : 0px; border-color: ShellColors.selection-tint;
property <color> ink: !root.command.enabled ? ShellColors.popup-disabled : root.command.destructive ? ShellColors.popup-danger : Theme.fg;
if root.command.glyph >= 0: ShellGlyph { x: 5px; y: 4px; glyph: root.command.glyph; ink: root.ink; }
Text { x: 36px; y: 0px; height: root.label-height; width: max(0px, parent.width - self.x - 8px); text: root.command.label; color: root.ink; font-size: 15px; font-weight: Theme.normal-weight; vertical-alignment: center; overflow: elide; }
reason := Text { x: 36px; y: root.label-height; width: max(0px, parent.width - self.x - 8px); text: root.command.reason; color: ShellColors.subtitle; font-size: 13px; wrap: word-wrap; }
keyboard := FocusScope { enabled: root.command.enabled && !root.command.heading; key-pressed(e) => { if e.text == "\n" || e.text == " " { ShellBridge.invoke(root.command.id); return accept; } return reject; } }
pointer := TouchArea { enabled: root.command.enabled && !root.command.heading; clicked => { ShellBridge.invoke(root.command.id); } }
}
component ChromeButton inherits Rectangle {
in property <string> label;
in property <string> text;
in property <int> glyph: -1;
in property <color> ink: Theme.fg;
in property <bool> active;
in property <bool> center-text: true;
in property <bool> filled;
in property <length> icon-inset: 8px;
in property <length> caption-inset: 35px;
in property <length> caption-end-inset: 5px;
in property <length> button-text-size: 13px;
in property <int> button-weight: 450;
in property <bool> enabled: true;
out property <bool> hovered: touch.has-hover;
callback clicked();
min-width: 0px;
height: 26px; preferred-width: root.text != "" ? caption.preferred-width + (root.glyph >= 0 ? 42px : 24px) : 32px;
out property <length> text-width: caption.preferred-width;
background: root.filled ? Theme.button-fill : (touch.has-hover || focus.has-focus ? Theme.bg : transparent);
border-radius: root.filled ? 100px : 4px;
border-width: focus.has-focus ? 1.5px : 0px; border-color: ShellColors.selection-tint;
accessible-role: button;
accessible-label: root.label != "" ? root.label : root.text;
accessible-item-selectable: root.active;
accessible-item-selected: root.active;
accessible-enabled: root.enabled;
accessible-action-default => { if root.enabled { root.clicked(); } }
if root.enabled && root.text == "" && root.label != "": Tooltip {
Rectangle {
border-radius: 4px; background: Theme.contrast;
HorizontalLayout {
padding-left: 8px; padding-right: 8px; padding-top: 4px; padding-bottom: 4px;
Text { text: root.label; color: Theme.fg; font-size: 13px; }
}
}
}
if root.glyph >= 0: ShellGlyph { glyph: root.glyph; ink: root.active ? Theme.tint : (focus.has-focus && root.ink == transparent ? Theme.fg : root.ink); x: root.text == "" ? (root.width - self.width) / 2 : root.icon-inset; y: (root.height - self.height) / 2; }
caption := Text {
x: root.glyph < 0 ? 5px : root.caption-inset; width: max(0px, root.width - self.x - root.caption-end-inset);
text: root.text; font-size: root.button-text-size; font-weight: root.active ? 600 : root.button-weight;
color: root.active ? Theme.tint : root.ink; vertical-alignment: center; horizontal-alignment: root.center-text ? center : left; overflow: elide;
}
focus := FocusScope { enabled: root.enabled; key-pressed(e) => { if e.text == "\n" || e.text == " " { root.clicked(); return accept; } return reject; } }
touch := TouchArea { enabled: root.enabled; clicked => { focus.focus(); root.clicked(); } }
}
component DesktopTreeRow inherits Rectangle {
in property <ShellRow> item;
in property <bool> active;
in property <length> bookmark-drop-width;
function open-row-menu() { ShellBridge.context(root.item.id, (root.absolute-position.x + root.indent + 31px) / 1px, (root.absolute-position.y + root.height / 2) / 1px); }
property <bool> server: root.item.kind == 0;
property <bool> channel: root.item.kind == 1;
property <bool> client: root.item.kind == 2;
property <bool> spacer: root.item.spacer > 0;
property <length> indent: min(max(0px, self.width - 90px), min(item.depth, 4) * 10px + max(item.depth - 4, 0) * 5px);
property <bool> row-hover: parity-tree-hit.has-hover || more.hovered || (root.item.expandable && arrow.hovered);
property <bool> highlighted: root.active || root.row-hover;
property <length> banner-tools-right: root.width - 27px;
property <bool> has-banner-tools: ShellBridge.save-bookmark-command != "" || ShellBridge.server-chat-command != "";
height: root.server ? 100px : root.channel ? 44px : 40px;
accessible-role: list-item;
accessible-label: root.item.title + (root.item.password ? ", " + ShellBridge.label-password : "") + (root.item.away ? ", " + ShellBridge.label-away : "");
accessible-item-selectable: true;
accessible-item-selected: root.item.selected;
accessible-expandable: root.item.expandable;
accessible-expanded: root.item.expanded;
accessible-action-expand => { if root.item.expandable { ShellBridge.expand(root.item.id); } }
accessible-action-default => { ShellBridge.select(root.item.id); }
Rectangle {
x: root.indent + (root.channel && root.highlighted ? 7px : 10px);
y: root.server ? 18px : root.channel ? (root.highlighted ? 4px : 7px) : 1px;
width: max(0px, root.width - self.x - (root.channel && root.highlighted ? 7px : 10px));
height: root.server ? 74px : root.height - 2 * self.y;
border-radius: root.server ? 10px : root.channel ? 9px : 100px;
background: root.server ? ShellColors.banner : root.spacer ? @linear-gradient(-115deg, Theme.deviant, Theme.dark ? #374263 : Theme.contrast) : root.channel ? ShellColors.channel : transparent;
border-width: root.item.selected || focus.has-focus || (root.highlighted && root.channel) ? (root.server ? 1px : 1.5px) : root.item.full || root.item.password ? 2px : 0px;
border-color: root.item.selected || focus.has-focus ? ShellColors.selection-tint : root.highlighted ? ShellColors.subtitle : root.item.full ? Theme.error : root.item.password ? Theme.warning : ShellColors.subtitle;
}
if root.client && root.highlighted && !root.item.selected && !focus.has-focus: Rectangle {
x: root.indent + 10px; y: 1px; width: min(160px, max(0px, root.width - self.x - 10px)); height: root.height - 2px;
border-radius: 100px; border-width: 1px;
border-color: @linear-gradient(90deg, ShellColors.subtitle, ShellColors.subtitle.with-alpha(0));
}
if !root.spacer: ShellGlyph {
glyph: root.channel ? 19 : root.item.kind;
ink: root.client ? (root.item.talking && !root.item.muted ? Theme.success : root.item.away ? ShellColors.subtitle : Theme.dark ? #a3b4b3 : #445d77) : root.channel ? (root.item.full ? Theme.error : root.item.password ? Theme.warning : Theme.dark ? #dbeaf7 : #445d77) : Theme.fg;
x: root.indent + (root.server ? 30px : root.client ? 25px : 20px);
y: root.server ? 28px : (root.height - self.height) / 2;
width: root.server ? 55px : root.client ? 33px : 22px; height: self.width;
}
title := Text {
x: root.indent + (root.server ? 105px : root.spacer ? 20px : root.client ? 68px : 52px);
y: root.server ? 17px : 0px;
height: root.server ? 74px : root.height;
width: max(0px, (root.server ? root.banner-tools-right - 26px * (1 + (ShellBridge.save-bookmark-command == "" ? 0 : 1) + (ShellBridge.server-chat-command == "" ? 0 : 1)) : status.x) - self.x - 4px);
text: root.item.title; font-size: root.server ? 16px : root.channel && !root.spacer ? 13px : 14px;
font-weight: root.server ? 700 : root.item.own ? 500 : root.item.contact || root.spacer ? 600 : Theme.normal-weight;
color: root.item.own || root.item.contact ? (Theme.high-contrast ? Theme.fg : Theme.tint) : root.client ? ShellColors.client : Theme.fg;
horizontal-alignment: root.item.spacer == 2 ? center : root.item.spacer == 3 ? right : left;
vertical-alignment: center; overflow: elide;
}
status := Rectangle {
property <int> marks: (root.item.password ? 1 : 0) + (root.item.moderated ? 1 : 0) + (root.item.muted ? 1 : 0) + (root.item.deafened ? 1 : 0) + (root.item.away ? 1 : 0) + (root.item.recording ? 1 : 0) + (root.item.streaming ? 1 : 0);
x: max(0px, (root.item.expandable ? arrow.x : root.width - 20px) - self.width - 4px); y: (root.height - self.height) / 2;
width: self.marks > 0 ? 10px + self.marks * 17px + (self.marks - 1) * 4px : 0px; height: 23px;
border-radius: 7px; background: self.marks == 0 ? transparent : (Theme.dark ? #222a3b : Theme.contrast);
HorizontalLayout {
y: (parent.height - self.height) / 2; height: 17px;
padding-left: 5px; padding-right: 5px; spacing: 4px; alignment: start;
if root.item.password: ShellGlyph { glyph: 14; ink: Theme.warning; width: 17px; height: 17px; }
if root.item.moderated: Text { width: 17px; text: "M"; color: Theme.fg; font-size: 13px; vertical-alignment: center; horizontal-alignment: center; }
if root.item.muted: ShellGlyph { glyph: 25; ink: Theme.error; width: 17px; height: 17px; }
if root.item.deafened: ShellGlyph { glyph: 26; ink: Theme.error; width: 17px; height: 17px; }
if root.item.away: ShellGlyph { glyph: 11; ink: Theme.warning; width: 17px; height: 17px; }
if root.item.recording: ShellGlyph { glyph: 17; ink: Theme.error; width: 17px; height: 17px; }
if root.item.streaming: ShellGlyph { glyph: 12; ink: ShellColors.constructive; width: 17px; height: 17px; }
}
}
focus := FocusScope {
key-pressed(e) => {
if e.text == "\n" || e.text == " " { ShellBridge.select(root.item.id); return accept; }
if e.text == Key.F10 && e.modifiers.shift { root.open-row-menu(); return accept; }
if root.item.expandable && ((e.text == Key.RightArrow && !root.item.expanded) || (e.text == Key.LeftArrow && root.item.expanded)) { ShellBridge.expand(root.item.id); return accept; }
return reject;
}
}
parity-tree-hit := TouchArea {
width: max(0px, root.server && root.has-banner-tools ? root.banner-tools-right - 78px : root.item.expandable ? arrow.x : root.width);
clicked => { focus.focus(); ShellBridge.select(root.item.id); }
pointer-event(e) => {
if e.button == PointerEventButton.right && e.kind == PointerEventKind.down { ShellBridge.context(root.item.id,(self.absolute-position.x + self.mouse-x) / 1px,(self.absolute-position.y + self.mouse-y) / 1px); }
if e.button == PointerEventButton.left && e.kind == PointerEventKind.down {
ShellBridge.row-press(root.item.id,true,(self.absolute-position.x + self.mouse-x) / 1px,(self.absolute-position.y + self.mouse-y) / 1px);
if root.channel { ShellBridge.bookmark-drag-start(root.item.id); }
}
if e.kind == PointerEventKind.up || e.kind == PointerEventKind.cancel || (e.kind == PointerEventKind.move && (abs((self.mouse-x - self.pressed-x)/1px)>8 || abs((self.mouse-y - self.pressed-y)/1px)>8)) { ShellBridge.row-press(root.item.id,false,0,0); }
if root.channel && (e.kind == PointerEventKind.up || e.kind == PointerEventKind.cancel) {
ShellBridge.bookmark-drag-end(root.item.id,e.kind == PointerEventKind.up && self.absolute-position.x + self.mouse-x >= 0px && self.absolute-position.x + self.mouse-x < root.bookmark-drop-width);
}
}
}
if root.server && ShellBridge.save-bookmark-command != "": ChromeButton {
x: root.banner-tools-right - 64px; y: 42px; width: 26px;
glyph: 13; label: ShellBridge.label-save-bookmark; ink: ShellColors.subtitle;
clicked => { ShellBridge.invoke(ShellBridge.save-bookmark-command); }
}
if root.server && ShellBridge.server-chat-command != "": ChromeButton {
x: root.banner-tools-right - 37px; y: 42px; width: 26px;
glyph: 3; label: ShellBridge.label-server-chat; ink: ShellColors.selection-tint;
clicked => { ShellBridge.invoke(ShellBridge.server-chat-command); }
}
more := ChromeButton {
x: max(0px, root.server ? root.banner-tools-right - 12px : root.width - (root.item.expandable ? 63px : 44px)); width: 24px;
y: root.server ? 42px : (root.height - self.height) / 2;
glyph: 7; label: ShellBridge.label-more;
ink: root.row-hover || focus.has-focus || (root.server && !root.has-banner-tools) ? Theme.fg : transparent;
clicked => { root.open-row-menu(); }
}
arrow := ChromeButton {
x: max(0px, root.width - 37px); width: 22px;
y: (root.height - self.height) / 2;
glyph: root.item.expanded ? 5 : 6;
ink: root.item.expanded ? Theme.fg : Theme.tint;
label: root.item.expanded ? ShellBridge.label-close : ShellBridge.label-more;
visible: root.item.expandable; enabled: root.item.expandable;
clicked => { ShellBridge.expand(root.item.id); }
}
}
component SidebarActivity inherits Rectangle {
in property <string> label;
in property <string> subtitle;
in property <string> row-id;
in property <string> unread;
function context-menu() { ShellBridge.context(root.row-id,(root.absolute-position.x + 31px) / 1px,(root.absolute-position.y + root.height / 2) / 1px); }
in property <int> glyph;
in property <bool> selected;
in property <bool> connected;
in property <bool> rail;
height: 44px;
accessible-role: list-item;
accessible-label: root.label + (root.subtitle == "" ? "" : ", " + root.subtitle) + (root.unread == "" ? "" : ", " + root.unread);
accessible-item-selectable: true;
accessible-item-selected: root.selected;
accessible-action-default => { ShellBridge.select(root.row-id); }
Rectangle {
x: 10px; y: 2px; width: parent.width - 20px; height: 40px; border-radius: 8px;
background: touch.has-hover ? Theme.bg : Theme.deviant;
border-width: focus.has-focus ? 1.5px : 0px; border-color: ShellColors.selection-tint;
}
ShellGlyph { glyph: root.glyph; x: 20px; y: 11px; ink: root.selected ? Theme.fg : ShellColors.client; }
if root.connected: Rectangle { x: 16px; y: 18px; width: 3px; height: 8px; border-radius: 4px; background: Theme.success; }
if !root.rail: Text {
x: 52px; y: root.subtitle == "" ? 2px : 4px; width: max(0px, overflow-button.x - self.x - (root.unread == "" ? 0px : 30px)); height: root.subtitle == "" ? 40px : 19px;
text: root.label; color: Theme.fg; font-size: 15px; font-weight: root.selected ? 600 : 450; vertical-alignment: center; overflow: elide;
}
if !root.rail && root.subtitle != "": Text { x: 52px; y: 22px; width: max(0px, overflow-button.x - self.x); height: 16px; text: root.subtitle; color: ShellColors.client; font-size: 13px; vertical-alignment: center; overflow: elide; }
if root.unread != "": Text { x: root.rail ? 31px : max(52px, overflow-button.x - 30px); y: root.rail ? 3px : 2px; width: 21px; height: root.rail ? 16px : 40px; text: root.unread; color: Theme.tint; font-size: 13px; horizontal-alignment: center; vertical-alignment: center; overflow: elide; }
focus := FocusScope {
key-pressed(e) => {
if e.text == "\n" || e.text == " " { ShellBridge.select(root.row-id); return accept; }
if e.text == Key.F10 && e.modifiers.shift { root.context-menu(); return accept; }
return reject;
}
}
touch := TouchArea {
x: 10px; y: 2px; width: max(0px, (root.rail ? root.width - 10px : overflow-button.x) - self.x); height: 40px;
clicked => { focus.focus(); ShellBridge.select(root.row-id); }
pointer-event(e) => {
if e.button == PointerEventButton.right && e.kind == PointerEventKind.down { ShellBridge.context(root.row-id,(self.absolute-position.x + self.mouse-x) / 1px,(self.absolute-position.y + self.mouse-y) / 1px); }
if e.button == PointerEventButton.left && e.kind == PointerEventKind.down { ShellBridge.row-press(root.row-id,true,(self.absolute-position.x + self.mouse-x) / 1px,(self.absolute-position.y + self.mouse-y) / 1px); }
if e.kind == PointerEventKind.up || e.kind == PointerEventKind.cancel || (e.kind == PointerEventKind.move && (abs((self.mouse-x - self.pressed-x)/1px)>8 || abs((self.mouse-y - self.pressed-y)/1px)>8)) { ShellBridge.row-press(root.row-id,false,0,0); }
}
}
overflow-button := ChromeButton {
visible: !root.rail; enabled: !root.rail; x: max(0px, root.width - 44px); y: 9px; width: 26px;
glyph: 7; label: ShellBridge.label-more; ink: ShellColors.client;
clicked => { root.context-menu(); }
}
}
component DesktopSidebar inherits Rectangle {
property <bool> rail: self.width < 200px;
background: @linear-gradient(180deg, ShellColors.bar, ShellColors.sidebar-end);
clip: true;
VerticalLayout {
spacing: 0px;
parity-sidebar-brand := Rectangle {
height: 71px; background: ShellColors.bar;
Image { source: @image-url("../resources/icon.png"); width: 28px; height: 28px; x: root.rail ? (root.width - self.width) / 2 : 20px; y: (parent.height - self.height) / 2; image-fit: contain; }
if !root.rail: Text { x: 56px; width: max(0px, parent.width - 66px); text: "TeamsPeach"; font-size: 20px; color: Theme.fg; font-weight: 700; vertical-alignment: center; overflow: elide; }
}
Rectangle {
height: 36px;
if !root.rail: parity-sidebar-search := Rectangle {
x: 10px; y: 5px; width: parent.width - 20px; height: 26px;
border-radius: 100px; background: Theme.deviant;
border-width: search.has-focus ? 1.5px : 0px; border-color: Theme.tint;
if ShellBridge.sidebar-search == "" && search.preedit-text == "": Text { x: 10px; width: parent.width - 20px; text: ShellBridge.label-search; color: ShellColors.subtitle; font-size: 13px; vertical-alignment: center; overflow: elide; }
search := TextInput {
x: 10px; width: parent.width - 20px; font-size: 13px; color: Theme.fg; vertical-alignment: center; single-line: true;
text <=> ShellBridge.sidebar-search; accessible-label: ShellBridge.label-search;
edited => { ShellBridge.sidebar-search-edited(); }
}
}
if root.rail: ChromeButton { width: 32px; glyph: 7; label: ShellBridge.label-more; clicked => { ShellBridge.menu(self.absolute-position.x / 1px,(self.absolute-position.y + self.height) / 1px); } }
}
ScrollView {
VerticalLayout {
spacing: 4px; padding-top: 13px;
parity-sidebar-servers := VerticalLayout {
spacing: 4px;
if !root.rail: Rectangle {
height: 19px;
ChromeButton {
x: 15px; y: 0px; height: 19px; width: max(0px, parent.width - 30px);
text: ShellBridge.label-connections; ink: ShellColors.subtitle; center-text: false;
clicked => { ShellBridge.navigate(0); }
}
}
for tab in ShellBridge.sidebar-tabs: SidebarActivity {
row-id: tab.id; label: tab.title; unread: tab.unread; selected: tab.selected; connected: tab.connected; glyph: 0; rail: root.rail;
}
}
if ShellBridge.new-connection-command != "": Rectangle {
height: 34px;
ChromeButton {
x: root.rail ? 12px : 20px; y: 4px; width: root.rail ? 38px : max(0px, parent.width - 40px); height: 30px;
text: root.rail ? "" : ShellBridge.label-new-connection; label: ShellBridge.label-new-connection; glyph: 8; filled: true; ink: ShellColors.tool; button-weight: 600;
clicked => { ShellBridge.invoke(ShellBridge.new-connection-command); }
}
}
if !root.rail: Rectangle { height: 1px; }
parity-sidebar-bookmarks := VerticalLayout {
spacing: 4px;
if !root.rail: Rectangle {
height: 38px;
Rectangle {
x: 10px; y: 8px; width: parent.width - 20px; height: 26px; border-radius: 4px; background: Theme.bg;
if ShellBridge.bookmark-up-command == "": ShellGlyph { glyph: 13; ink: ShellColors.client; x: 9px; y: 4px; width: 18px; height: 18px; }
if ShellBridge.bookmark-up-command != "": ChromeButton { x: 2px; y: 0px; width: 28px; glyph: 29; label: ShellBridge.label-back; clicked => { ShellBridge.invoke(ShellBridge.bookmark-up-command); } }
Text { x: 36px; width: max(0px, parent.width - 72px); text: ShellBridge.bookmark-location == "" ? ShellBridge.label-bookmarks : ShellBridge.bookmark-location; color: ShellColors.client; font-size: 13px; vertical-alignment: center; overflow: elide; }
if ShellBridge.can-add-bookmark: ChromeButton { x: parent.width - 30px; y: 0px; width: 28px; glyph: 8; label: ShellBridge.label-bookmarks; clicked => { ShellBridge.bookmark-menu(self.absolute-position.x / 1px,(self.absolute-position.y + self.height) / 1px); } }
}
}
if root.rail && ShellBridge.bookmark-up-command != "": ChromeButton { width: 32px; glyph: 29; label: ShellBridge.label-back; clicked => { ShellBridge.invoke(ShellBridge.bookmark-up-command); } }
for item in ShellBridge.sidebar-bookmarks: SidebarActivity { row-id: item.id; label: item.title; subtitle: item.subtitle; glyph: item.kind == 3 ? 28 : 13; rail: root.rail; }
if !root.rail && ShellBridge.sidebar-bookmarks.length == 0: Text { height: 28px; text: ShellBridge.label-empty; color: ShellColors.client; font-size: 13px; horizontal-alignment: center; vertical-alignment: center; }
}
for index in [0, 1, 2]: Rectangle {
visible: index != 0 || root.rail;
height: self.visible ? 34px : 0px;
ChromeButton {
x: 10px; y: 4px; width: parent.width - 20px; height: 26px;
glyph: index == 0 ? 0 : index == 1 ? 3 : 2;
label: ShellBridge.destinations[index]; text: root.rail ? "" : self.label; active: ShellBridge.destination == index;
enabled: index != 0 || root.rail; center-text: false;
clicked => { ShellBridge.navigate(index); }
}
}
}
}
parity-sidebar-footer := Rectangle {
height: 55px; background: ShellColors.sidebar-end;
Rectangle { x: root.rail ? 10px : 20px; y: 0px; width: max(0px, parent.width - 2 * self.x); height: 3px; background: ShellColors.divider; }
if !root.rail && ShellBridge.has-voice: Text {
x: 20px; width: max(0px, parent.width - 66px); text: ShellBridge.voice-title; color: ShellColors.client; font-size: 13px; vertical-alignment: center; overflow: elide;
}
ChromeButton { x: parent.width - 47px; y: (parent.height - self.height) / 2; width: 32px; glyph: 4; ink: ShellColors.subtitle; label: ShellBridge.destinations[3]; active: ShellBridge.destination == 3; clicked => { ShellBridge.navigate(3); } }
}
}
}
component DesktopVoiceTools inherits HorizontalLayout {
padding-left: 56px; padding-top: 9px; padding-bottom: 9px; spacing: 13px; alignment: start;
if ShellBridge.away-command != "": ChromeButton { glyph: 24; label: ShellBridge.label-away; ink: ShellBridge.away ? Theme.warning : ShellColors.tool; width: 36px; clicked => { ShellBridge.invoke(ShellBridge.away-command); } }
if ShellBridge.has-voice: Rectangle {
width: 85px; height: 26px; border-radius: 100px; background: Theme.bg;
ChromeButton { x: 5px; y: 0px; width: 31px; glyph: ShellBridge.muted ? 25 : 9; label: ShellBridge.label-mute; ink: ShellBridge.muted ? Theme.error : (ShellBridge.transmitting ? Theme.success : ShellColors.tool); clicked => { ShellBridge.voice(0); } }
Rectangle { x: 36px; y: 2px; width: 1px; height: 22px; background: ShellColors.strong; }
ChromeButton { x: 37px; y: 0px; width: 32px; glyph: ShellBridge.deafened ? 26 : 10; label: ShellBridge.label-deafen; ink: ShellBridge.deafened ? Theme.error : ShellColors.tool; clicked => { ShellBridge.voice(1); } }
}
}
component HoldButton inherits Rectangle {
min-height: Theme.touch-target; background: ptt.pressed ? Theme.tint : Theme.bg; border-radius: 4px;
accessible-role: button; accessible-label: ShellBridge.label-ptt; accessible-enabled: ShellBridge.ptt-enabled;
Text { text: ShellBridge.label-ptt; color: Theme.fg; vertical-alignment: center; horizontal-alignment: center; wrap: word-wrap; }
ptt := TouchArea { enabled: ShellBridge.ptt-enabled; pointer-event(e) => { if e.kind == PointerEventKind.down { ShellBridge.held(true); } else if e.kind == PointerEventKind.up || e.kind == PointerEventKind.cancel { ShellBridge.held(false); } } }
}
component DesktopServerPane inherits Rectangle {
in property <bool> chat-visible;
in property <length> bookmark-drop-width;
property <bool> compressed: root.width < 440px;
VerticalLayout {
spacing: 0px;
parity-tree := Rectangle {
vertical-stretch: 1;
background: ShellColors.tree;
if ShellBridge.tree.length > 0: HorizontalLayout {
padding-left: root.compressed ? 10px : 9px; padding-right: root.compressed ? 10px : 9px;
ListView { for item in ShellBridge.tree: parity-tree-row := DesktopTreeRow {
bookmark-drop-width: root.bookmark-drop-width;
item: item; active: root.chat-visible && item.key == ChatBridge.active-tree-key;
} }
}
if ShellBridge.tree.length == 0: Text { x: 20px; y: 18px; width: max(0px, parent.width - 40px); height: parent.height - 18px; text: ShellBridge.label-tree-empty; color: ShellColors.client; wrap: word-wrap; }
}
if ShellBridge.create-channel-command != "" || ShellBridge.capture-command != "" || (ShellBridge.has-voice && ShellBridge.ptt-enabled): parity-tree-status := Rectangle {
height: 55px; background: Theme.bg;
property <length> side-inset: root.compressed ? 10px : 40px;
property <length> hold-width: min(105px, root.width / 3);
Rectangle { y: 0px; width: parent.width; height: 3px; background: Theme.shaded; }
HorizontalLayout {
padding-left: parity-tree-status.side-inset; padding-right: parity-tree-status.side-inset; spacing: 4px;
padding-top: 12.5px; padding-bottom: 12.5px;
if ShellBridge.create-channel-command != "": ChromeButton { height: 30px; preferred-width: max(120px, self.text-width + 53px); glyph: 27; filled: true; ink: Theme.dark ? #fff : Theme.fg; text: ShellBridge.label-create-channel; icon-inset: 10px; caption-inset: 42px; caption-end-inset: 10px; center-text: false; button-weight: 600; clicked => { ShellBridge.invoke(ShellBridge.create-channel-command); } }
if ShellBridge.capture-command != "": ChromeButton { height: 30px; preferred-width: self.text == "" ? 32px : self.text-width + 38px; glyph: 23; ink: ShellColors.constructive; label: ShellBridge.label-capture; text: root.width >= 330px ? ShellBridge.label-capture : ""; icon-inset: 0px; caption-inset: 32px; center-text: false; button-weight: 600; clicked => { ShellBridge.invoke(ShellBridge.capture-command); } }
Rectangle { horizontal-stretch: 1; }
if ShellBridge.has-voice && ShellBridge.ptt-enabled: Rectangle { width: parity-tree-status.hold-width; }
}
if ShellBridge.has-voice && ShellBridge.ptt-enabled: Rectangle {
x: parent.width - parity-tree-status.side-inset - self.width;
y: (parent.height - self.height) / 2;
width: parity-tree-status.hold-width; height: Theme.touch-target;
HoldButton { }
}
}
}
Path {
x: 0px; y: 0px; width: 10px; height: 10px;
viewbox-width: 10; viewbox-height: 10;
commands: "M0 0 H10 A10 10 0 0 0 0 10 Z"; fill: ShellColors.bar;
}
}
export component ShellScreen inherits Rectangle {
background: Theme.shaded;
min-width: 0px; min-height: 0px;
preferred-width: 100%; preferred-height: 100%;
property <bool> compact: self.width < 600px;
property <bool> desktop: self.width >= 1024px;
property <bool> desktop: self.width >= 900px;
property <length> sidebar-width <=> ShellBridge.sidebar-width;
property <length> server-width <=> ShellBridge.server-width;
property <length> actual-sidebar: desktop ? min(sidebar-width, max(62px,self.width - 515px)) : 0px;
property <length> actual-server: desktop ? min(server-width,max(220px,self.width - actual-sidebar - 295px)) : min(300px,self.width * 0.4);
property <length> main-width: max(0px, self.width - actual-sidebar - (desktop ? 4px : 0px));
property <length> detail-width: max(0px, main-width - (ShellBridge.destination == 0 && !compact ? actual-server + (desktop ? 4px : 0px) : 0px));
VerticalLayout {
property <length> actual-sidebar: desktop ? min(clamp(sidebar-width, 62px, 420px), max(62px,self.width - 515px)) : 0px;
property <length> actual-server: desktop ? min(max(220px, server-width),max(220px,self.width - actual-sidebar - 295px)) : min(300px,self.width * 0.4);
property <length> main-width: max(0px, self.width - actual-sidebar);
property <length> detail-width: max(0px, main-width - (root.desktop-tree || (!compact && ShellBridge.destination == 0) ? actual-server : 0px));
property <bool> desktop-tree: desktop && (ShellBridge.destination == 0 || (ShellBridge.destination == 1 && ShellBridge.tree.length > 0));
property <bool> chat-open: ShellBridge.destination == 1 || ShellBridge.stage == 1;
HorizontalLayout {
spacing: 0px;
Rectangle {
height: 44px; background: Theme.header;
HorizontalLayout {
padding-left: 10px; padding-right: 10px; spacing: 8px;
if !root.desktop: ActionButton { text: ShellBridge.label-back; enabled: ShellBridge.depth > 0 || ShellBridge.destination != 0; clicked => { ShellBridge.back(); } }
Text { text: "TeamsPeach"; color: Theme.fg; font-weight: 600; vertical-alignment: center; }
Rectangle { horizontal-stretch: 1; }
if !root.compact && !root.desktop: HorizontalLayout {
spacing: 8px;
for label[index] in ShellBridge.destinations: ActionButton { text: label; primary: ShellBridge.destination == index; clicked => { ShellBridge.navigate(index); } }
}
ActionButton { text: ShellBridge.label-more; clicked => { ShellBridge.menu(); } }
}
}
if ShellBridge.error != "": Text { text: ShellBridge.error; color: Theme.error; wrap: word-wrap; }
if ShellBridge.loading: Text { text: ShellBridge.label-loading; color: Theme.muted; }
HorizontalLayout {
if root.desktop: DesktopSidebar { width: root.actual-sidebar; }
VerticalLayout {
spacing: 0px;
if root.desktop: Rectangle {
width: root.actual-sidebar; background: Theme.header;
VerticalLayout {
padding: 10px; spacing: 4px;
for label[index] in ShellBridge.destinations: ActionButton { text: label; primary: ShellBridge.destination == index; clicked => { ShellBridge.navigate(index); } }
Text { text: ShellBridge.label-bookmarks; color: Theme.muted; font-size: Theme.font-size * 0.86; }
ListView { for item in ShellBridge.bookmarks: EntryRow { item: item; } }
CommandList { commands: ShellBridge.actions; }
Rectangle {
height: 44px; background: root.desktop ? ShellColors.bar : Theme.header;
if root.desktop: HorizontalLayout {
spacing: 0px;
if root.desktop-tree: parity-tree-toolbar := Rectangle {
width: root.actual-server;
DesktopVoiceTools { }
}
if root.desktop-tree: parity-detail-toolbar := Rectangle {
horizontal-stretch: 1;
ChromeButton{ x: max(0px, parent.width - 42px); y: 9px; glyph: 7; label: ShellBridge.label-more; clicked => { ShellBridge.menu((self.absolute-position.x + self.width) / 1px,(self.absolute-position.y + self.height) / 1px); } }
}
if !root.desktop-tree: HorizontalLayout {
spacing: 0px; padding-right: 10px;
DesktopVoiceTools { width: 192px; }
Rectangle { horizontal-stretch: 1; }
VerticalLayout { alignment: center; if ShellBridge.has-voice && ShellBridge.ptt-enabled: HoldButton { width: 105px; } }
VerticalLayout { alignment: center; ChromeButton { glyph: 7; label: ShellBridge.label-more; clicked => { ShellBridge.menu((self.absolute-position.x + self.width) / 1px,(self.absolute-position.y + self.height) / 1px); } } }
}
}
if !root.desktop: HorizontalLayout {
padding-left: 10px; padding-right: 10px; spacing: 8px;
ActionButton { text: ShellBridge.label-back; enabled: ShellBridge.depth > 0 || ShellBridge.destination != 0; clicked => { ShellBridge.back(); } }
Text { text: "TeamsPeach"; color: Theme.fg; font-weight: 600; vertical-alignment: center; }
Rectangle { horizontal-stretch: 1; }
if !root.compact: HorizontalLayout {
spacing: 8px;
for label[index] in ShellBridge.destinations: ActionButton { text: label; primary: ShellBridge.destination == index; clicked => { ShellBridge.navigate(index); } }
}
ActionButton { text: ShellBridge.label-more; clicked => { ShellBridge.menu(self.absolute-position.x / 1px,(self.absolute-position.y + self.height) / 1px); } }
}
}
if root.desktop: Rectangle {
width: 4px; background: split1.pressed ? Theme.tint : Theme.contrast;
accessible-role: slider; accessible-label: ShellBridge.label-resize;
split1 := TouchArea { mouse-cursor: ew-resize; moved => { if self.pressed { root.sidebar-width = clamp(root.sidebar-width + self.mouse-x - self.pressed-x,62px,420px); } } pointer-event(e) => { if e.kind == PointerEventKind.up { if root.sidebar-width < 200px { root.sidebar-width = 62px; } ShellBridge.resized(root.sidebar-width/1px,root.server-width/1px); } } }
}
if ShellBridge.destination == 3: SettingsScreen { width: root.main-width; }
if ShellBridge.error != "": Text { text: ShellBridge.error; color: Theme.error; wrap: word-wrap; }
if ShellBridge.loading: Text { text: ShellBridge.label-loading; color: Theme.muted; }
HorizontalLayout {
spacing: 0px;
vertical-stretch: 1;
if ShellBridge.destination == 3: SettingsScreen { width: root.main-width; window-width: root.width; settings-label: ShellBridge.destinations[3]; }
if ShellBridge.destination == 2: Rectangle {
background: Theme.shaded;
VerticalLayout { padding: 12px; Text { text: ShellBridge.destinations[2]; color: Theme.fg; font-size: Theme.font-size * 1.6; font-weight: 700; } ListView { for item in ShellBridge.contacts: EntryRow { item: item; } } if ShellBridge.contacts.length == 0: Text { text: ShellBridge.label-empty; color: Theme.muted; } }
VerticalLayout {
padding: 12px; spacing: 4px;
HorizontalLayout {
Text { text: ShellBridge.destinations[2]; color: Theme.fg; font-size: Theme.font-size * 1.6; font-weight: 700; overflow: elide; horizontal-stretch: 1; }
if ShellBridge.contact-add-command != "": ChromeButton { glyph: 8; label: ShellBridge.label-add-contact; clicked => { ShellBridge.invoke(ShellBridge.contact-add-command); } }
}
ListView {
for item in ShellBridge.contacts: Rectangle {
height: item.kind == 4 ? 30px : max(44px, Theme.touch-target);
if item.kind == 4: Text { x: 10px; text: item.title; color: ShellColors.subtitle; font-size: 13px; vertical-alignment: center; }
if item.kind != 4: EntryRow { item: item; }
}
}
if ShellBridge.contacts.length == 0: Text { text: ShellBridge.label-empty; color: Theme.muted; }
}
}
if ShellBridge.destination == 0 || ShellBridge.destination == 1: HorizontalLayout {
spacing: 0px;
if ShellBridge.destination == 0 && (!root.compact || ShellBridge.depth == 0): Rectangle {
if root.desktop-tree: DesktopServerPane { width: root.actual-server; chat-visible: root.chat-open; bookmark-drop-width: root.actual-sidebar; }
if !root.desktop && ShellBridge.destination == 0 && (!root.compact || ShellBridge.depth == 0): Rectangle {
width: root.compact ? root.width : root.actual-server;
background: Theme.bg;
VerticalLayout {
@@ -221,20 +741,50 @@ export component ShellScreen inherits Rectangle {
if !root.desktop: CommandList { commands: ShellBridge.actions; }
}
}
if root.desktop && ShellBridge.destination == 0: Rectangle {
width: 4px; background: split2.pressed ? Theme.tint : Theme.contrast;
accessible-role: slider; accessible-label: ShellBridge.label-resize;
split2 := TouchArea { mouse-cursor: ew-resize; moved => { if self.pressed { root.server-width = clamp(root.server-width + self.mouse-x - self.pressed-x,220px,max(220px,root.width - root.actual-sidebar - 295px)); } } pointer-event(e) => { if e.kind == PointerEventKind.up { ShellBridge.resized(root.sidebar-width/1px,root.server-width/1px); } } }
}
if !root.compact || ShellBridge.depth > 0 || ShellBridge.destination == 1: Rectangle {
if !root.compact || ShellBridge.depth > 0 || ShellBridge.destination == 1: parity-detail-pane := Rectangle {
background: Theme.shaded;
VerticalLayout {
spacing: 4px;
Rectangle { min-height: 71px; background: Theme.shaded;
spacing: root.desktop ? 0px : 4px;
if root.desktop: parity-detail-header := Rectangle {
height: 71px; background: ShellColors.detail-header;
HorizontalLayout {
padding-left: 15px; padding-right: 10px; spacing: 10px;
if (root.chat-open ? ChatBridge.title : ShellBridge.title) != "": VerticalLayout {
width: 38px; alignment: center;
ShellGlyph { glyph: root.chat-open && ChatBridge.can-info ? 2 : 19; width: 38px; height: 38px; ink: root.chat-open && ChatBridge.can-info ? (Theme.dark ? #a3b4b3 : #445d77) : (Theme.dark ? #dbeaf7 : #445d77); }
}
VerticalLayout {
min-width: 0px; alignment: center;
Text { text: root.chat-open && ChatBridge.title != "" ? ChatBridge.title : ShellBridge.title; color: Theme.fg; font-size: 24px; font-weight: 700; overflow: elide; }
if !root.chat-open && ShellBridge.subtitle != "": Text { text: ShellBridge.subtitle; color: Theme.muted; font-size: 13px; overflow: elide; }
}
if ShellBridge.destination != 1: VerticalLayout {
width: min(106px, root.detail-width * 0.38); alignment: center;
Rectangle {
height: 26px; border-radius: 100px; background: Theme.bg;
HorizontalLayout {
padding-left: 3px; padding-right: 3px; spacing: 1px;
for name[index] in ShellBridge.stages: ChromeButton {
horizontal-stretch: 1; glyph: index == 0 ? 16 : index == 1 ? 3 : 12;
label: name; active: ShellBridge.stage == index;
clicked => { ShellBridge.stage = index; }
}
}
}
}
if root.chat-open && ChatBridge.can-info: VerticalLayout { width: 30px; alignment: center; ChromeButton { glyph: 16; width: 30px; label: ChatBridge.tr("admin.info"); clicked => { ChatBridge.client-info(); } } }
if root.chat-open: VerticalLayout { width: 30px; alignment: center; ChromeButton { glyph: 18; width: 30px; label: ChatBridge.tr("admin.search"); clicked => { ChatBridge.toggle-search(); } } }
}
}
if root.desktop: Rectangle {
height: 4px;
Rectangle { x: 20px; width: max(0px, parent.width - 40px); height: 4px; border-radius: 4px; background: Theme.header; }
}
if !root.desktop: Rectangle { min-height: 71px; background: Theme.shaded;
VerticalLayout { padding: 12px; Text { text: ShellBridge.title; color: Theme.fg; font-size: Theme.font-size * 1.6; font-weight: 700; overflow: elide; } Text { text: ShellBridge.subtitle; color: Theme.muted; overflow: elide; } }
}
HorizontalLayout { for name[index] in ShellBridge.stages: ActionButton { text: name; primary: ShellBridge.stage == index; clicked => { ShellBridge.stage = index; } } }
if ShellBridge.stage == 1 || ShellBridge.destination == 1: ChatScreen { width: root.detail-width; }
if !root.desktop: HorizontalLayout { for name[index] in ShellBridge.stages: ActionButton { text: name; primary: ShellBridge.stage == index; clicked => { ShellBridge.stage = index; } } }
if root.chat-open: ChatScreen { width: root.detail-width; embedded-header: root.desktop; }
if ShellBridge.stage == 2 && ShellBridge.destination != 1: ScrollView {
VerticalLayout { padding: 10px; spacing: 10px;
if ShellBridge.streams.length == 0: Text { text: ShellBridge.label-stream-empty; color: Theme.muted; wrap: word-wrap; }
@@ -261,7 +811,7 @@ export component ShellScreen inherits Rectangle {
}
}
}
if ShellBridge.has-voice: Rectangle {
if !root.desktop && ShellBridge.has-voice: Rectangle {
min-height: Theme.touch-target + 12px; background: Theme.contrast;
VerticalLayout {
Text { text: ShellBridge.voice-title + " · " + ShellBridge.voice-status; color: ShellBridge.transmitting ? Theme.success : Theme.fg; overflow: elide; }
@@ -269,15 +819,31 @@ export component ShellScreen inherits Rectangle {
spacing: 4px;
ActionButton { min-width: 0px; horizontal-stretch: 1; text: ShellBridge.label-mute; destructive: ShellBridge.muted; clicked => { ShellBridge.voice(0); } }
ActionButton { min-width: 0px; horizontal-stretch: 1; text: ShellBridge.label-deafen; destructive: ShellBridge.deafened; clicked => { ShellBridge.voice(1); } }
Rectangle { min-height: Theme.touch-target; background: ptt.pressed ? Theme.tint : Theme.bg; border-radius: 4px; accessible-role: button; accessible-label: ShellBridge.label-ptt;
Text { text: ShellBridge.label-ptt; color: Theme.fg; vertical-alignment: center; horizontal-alignment: center; wrap: word-wrap; }
ptt := TouchArea { enabled: ShellBridge.ptt-enabled; pointer-event(e) => { if e.kind == PointerEventKind.down { ShellBridge.held(true); } else if e.kind == PointerEventKind.up || e.kind == PointerEventKind.cancel { ShellBridge.held(false); } } }
}
HoldButton { }
}
}
}
if ShellBridge.status != "": Text { text: ShellBridge.status; color: Theme.muted; overflow: elide; }
if root.compact: HorizontalLayout { for label[index] in ShellBridge.destinations: ActionButton { min-width: 0px; horizontal-stretch: 1; text: label; primary: ShellBridge.destination == index; clicked => { ShellBridge.navigate(index); } } }
if root.compact: HorizontalLayout {
height: max(48px, Theme.touch-target);
for label[index] in ShellBridge.destinations: ActionButton {
min-width: 0px; horizontal-stretch: 1; text: label; primary: ShellBridge.destination == index;
clicked => { ShellBridge.navigate(index); }
}
}
}
}
if root.desktop: Rectangle {
x: root.actual-sidebar - 4.5px; y: 44px; width: 9px; height: max(0px, root.height - self.y);
background: split1.pressed ? Theme.tint.with-alpha(0.5) : transparent;
accessible-role: slider; accessible-label: ShellBridge.label-resize;
split1 := TouchArea { mouse-cursor: ew-resize; moved => { if self.pressed { root.sidebar-width = clamp(root.actual-sidebar + self.mouse-x - self.pressed-x,62px,min(420px,max(62px,root.width - 515px))); } } pointer-event(e) => { if e.kind == PointerEventKind.up { if root.sidebar-width < 200px { root.sidebar-width = 62px; } ShellBridge.resized(root.sidebar-width/1px,root.server-width/1px); } } }
}
if root.desktop-tree: Rectangle {
x: root.actual-sidebar + root.actual-server - 4.5px; y: 44px; width: 9px; height: max(0px, root.height - self.y);
background: split2.pressed ? Theme.tint.with-alpha(0.5) : transparent;
accessible-role: slider; accessible-label: ShellBridge.label-resize;
split2 := TouchArea { mouse-cursor: ew-resize; moved => { if self.pressed { root.server-width = clamp(root.actual-server + self.mouse-x - self.pressed-x,220px,max(220px,root.width - root.actual-sidebar - 295px)); } } pointer-event(e) => { if e.kind == PointerEventKind.up { ShellBridge.resized(root.sidebar-width/1px,root.server-width/1px); } } }
}
if ShellBridge.fullscreen-stream != "": Rectangle {
background: Theme.contrast;
@@ -286,7 +852,40 @@ export component ShellScreen inherits Rectangle {
for stream in ShellBridge.streams: StreamTile { visible: stream.id == ShellBridge.fullscreen-stream; height: self.visible ? parent.height - Theme.touch-target : 0px; item: stream; }
}
}
if ShellBridge.menu-visible: Rectangle {
if ShellBridge.menu-visible && root.desktop: Rectangle {
property <length> inset: 8px;
TouchArea {
clicked => { if self.mouse-x < parity-context-menu.x || self.mouse-x >= parity-context-menu.x + parity-context-menu.width || self.mouse-y < parity-context-menu.y || self.mouse-y >= parity-context-menu.y + parity-context-menu.height { ShellBridge.close-menu(); } }
pointer-event(e) => { if e.button == PointerEventButton.right && e.kind == PointerEventKind.down && (self.mouse-x < parity-context-menu.x || self.mouse-x >= parity-context-menu.x + parity-context-menu.width || self.mouse-y < parity-context-menu.y || self.mouse-y >= parity-context-menu.y + parity-context-menu.height) { ShellBridge.close-menu(); } }
}
parity-context-menu := Rectangle {
width: min(236px, max(0px, parent.width - 2 * parent.inset));
height: min(450px, min(max(0px, parent.height - 2 * parent.inset), 30px + menu-rows.preferred-height));
x: clamp(ShellBridge.menu-x * 1px - root.absolute-position.x, parent.inset, parent.width - self.width - parent.inset);
y: clamp(ShellBridge.menu-y * 1px - root.absolute-position.y, parent.inset, parent.height - self.height - parent.inset);
background: ShellColors.popup; border-radius: 8px; clip: true;
border-width: Theme.dark ? 0px : 1px; border-color: #e6eef3;
drop-shadow-offset-x: 1px; drop-shadow-offset-y: 1px; drop-shadow-blur: 2px; drop-shadow-color: #0003;
accessible-role: list; accessible-label: ShellBridge.menu-title;
FocusScope { init => { self.focus(); } }
if ShellBridge.menu-glyph >= 0: ShellGlyph { x: 5px; y: 4px; glyph: ShellBridge.menu-glyph; ink: ShellColors.popup-disabled; }
Text { x: 36px; y: 0px; width: max(0px, parent.width - self.x - 8px); height: 30px; text: ShellBridge.menu-title; color: ShellColors.popup-disabled; font-size: 15px; font-weight: 500; vertical-alignment: center; overflow: elide; }
ScrollView {
x: 0px; y: 30px; width: parent.width; height: max(0px, parent.height - self.y);
menu-rows := VerticalLayout {
spacing: 0px;
for command in ShellBridge.menu-actions: VerticalLayout {
if command.heading: Rectangle {
height: 22px;
Text { x: 10px; width: max(0px, parent.width - 20px); text: command.label; color: ShellColors.subtitle; font-size: 13px; vertical-alignment: center; overflow: elide; }
}
if !command.heading: DesktopMenuEntry { command: command; }
}
}
}
}
}
if ShellBridge.menu-visible && !root.desktop: Rectangle {
background: Theme.contrast.with-alpha(0.7);
TouchArea { clicked => { ShellBridge.close-menu(); } }
Rectangle {