Both sides kept. From the development branch: the share dialog's portal
rows ("Same as last time" restores the portal's last choice), the Share
button's menu with the Stream Studio in it instead of a button of its
own in the desktop top bar and the phone header, the codec order,
person segmentation for the studio, and streams of every channel.
The phone header keeps this wave's search button next to the bell; the
studio button goes as on the development branch. video.rs keeps the
development branch's imports without EncoderReport, which the
Integrations page now asks the codecs for itself. The Devices page
lists the capture sources without the restore row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
288 lines
9.6 KiB
Plaintext
288 lines
9.6 KiB
Plaintext
// The desktop frame: the server rail at the far left, the top bar, and the
|
|
// page's panels (@children: a sidebar, the main area, a right panel). The
|
|
// window keeps its native decorations.
|
|
|
|
import { Theme } from "../theme.slint";
|
|
import { Icons } from "../icons.slint";
|
|
import { Bridge, ServerItem } from "../bridge.slint";
|
|
import { Nav, Page, SettingsSection } from "../nav.slint";
|
|
import { Icon, IconButton, Avatar, Status, CountBadge, SearchBox, ScrollView, Tooltip } from "../components/index.slint";
|
|
import { Panel, VoiceCard, UserCard } from "common.slint";
|
|
|
|
// A server in the rail: its icon (initials), the selection pill, state and
|
|
// unread marks.
|
|
component RailServer inherits Rectangle {
|
|
in property <ServerItem> server;
|
|
in property <bool> selected;
|
|
callback clicked();
|
|
callback edit();
|
|
width: Theme.rail-width;
|
|
height: 56px;
|
|
accessible-role: AccessibleRole.list-item;
|
|
accessible-label: server.name;
|
|
accessible-description: server.address;
|
|
accessible-item-selectable: true;
|
|
accessible-item-selected: selected;
|
|
accessible-action-default => { clicked(); }
|
|
// Selection pill.
|
|
Rectangle {
|
|
x: 0;
|
|
width: 4px;
|
|
height: selected ? 36px : touch.has-hover ? 18px : 0px;
|
|
border-radius: 2px;
|
|
background: Theme.text;
|
|
animate height { duration: Theme.fast; }
|
|
}
|
|
// Ring of the selected server.
|
|
if selected: Rectangle {
|
|
width: 52px;
|
|
height: 52px;
|
|
border-radius: Theme.radius-lg + 2px;
|
|
border-width: 2px;
|
|
border-color: Theme.accent;
|
|
background: Theme.glow.transparentize(0.6);
|
|
}
|
|
Avatar {
|
|
size: 46px;
|
|
square: true;
|
|
initials: server.initials;
|
|
tint: server.tint;
|
|
label: server.name;
|
|
status: server.status == "connected" ? Status.online : server.status == "observing" ? Status.info : server.status == "connecting" ? Status.idle : Status.none;
|
|
}
|
|
if server.unread > 0: CountBadge {
|
|
x: min(parent.width - self.width - 4px, 50px);
|
|
y: 0px;
|
|
count: server.unread;
|
|
}
|
|
if server.live && server.unread == 0: Rectangle {
|
|
x: parent.width - 20px;
|
|
y: 4px;
|
|
width: 12px;
|
|
height: 12px;
|
|
border-radius: 6px;
|
|
background: Theme.live;
|
|
border-width: 2px;
|
|
border-color: Theme.bg-rail;
|
|
}
|
|
touch := TouchArea {
|
|
mouse-cursor: MouseCursor.pointer;
|
|
clicked => { root.clicked(); }
|
|
double-clicked => { root.edit(); }
|
|
}
|
|
}
|
|
|
|
// The column of servers.
|
|
export component ServerRail inherits Rectangle {
|
|
width: Theme.rail-width;
|
|
background: Theme.bg-rail.transparentize(0.1);
|
|
accessible-role: AccessibleRole.list;
|
|
accessible-label: @tr("Servers");
|
|
Rectangle {
|
|
x: parent.width - 1px;
|
|
width: 1px;
|
|
background: Theme.border;
|
|
}
|
|
VerticalLayout {
|
|
padding-top: Theme.space-3;
|
|
padding-bottom: Theme.space-3;
|
|
spacing: Theme.space-2;
|
|
// App mark: home.
|
|
HorizontalLayout {
|
|
alignment: center;
|
|
Rectangle {
|
|
width: 48px;
|
|
height: 48px;
|
|
border-radius: Theme.radius-lg;
|
|
background: Nav.page == Page.home ? Theme.accent-soft : logo-touch.has-hover ? Theme.surface-3 : Theme.surface-2;
|
|
border-width: 1px;
|
|
border-color: Nav.page == Page.home ? Theme.accent : Theme.border;
|
|
accessible-role: AccessibleRole.button;
|
|
accessible-label: @tr("Home");
|
|
accessible-action-default => { Nav.show(Page.home); }
|
|
Image {
|
|
width: 30px;
|
|
height: 30px;
|
|
source: Icons.logo;
|
|
}
|
|
logo-touch := TouchArea {
|
|
mouse-cursor: MouseCursor.pointer;
|
|
clicked => { Nav.show(Page.home); }
|
|
}
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
alignment: center;
|
|
padding-top: Theme.space-2;
|
|
padding-bottom: Theme.space-2;
|
|
Rectangle {
|
|
width: 32px;
|
|
height: 2px;
|
|
border-radius: 1px;
|
|
background: Theme.border-strong;
|
|
}
|
|
}
|
|
ScrollView {
|
|
vertical-stretch: 1;
|
|
VerticalLayout {
|
|
alignment: start;
|
|
spacing: Theme.space-2;
|
|
for server in Bridge.servers: RailServer {
|
|
server: server;
|
|
selected: Nav.page == Page.server && Bridge.current-server == server.id;
|
|
clicked => { Nav.select-server(server.id); }
|
|
edit => { Nav.edit-server(server.id); }
|
|
}
|
|
HorizontalLayout {
|
|
alignment: center;
|
|
padding-top: Theme.space-2;
|
|
IconButton {
|
|
icon: Icons.plus;
|
|
label: @tr("Add server");
|
|
round: true;
|
|
filled: true;
|
|
size: 46px;
|
|
tint: Theme.success;
|
|
clicked => { Nav.add-server(); }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
alignment: center;
|
|
IconButton {
|
|
icon: Icons.settings;
|
|
label: @tr("Settings");
|
|
round: true;
|
|
size: 46px;
|
|
checked: Nav.page == Page.settings;
|
|
clicked => { Nav.open-settings(SettingsSection.voice); }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// The bar at the top: the app name and page, search, notifications.
|
|
export component TopBar inherits Rectangle {
|
|
in property <string> context;
|
|
height: Theme.topbar-height;
|
|
accessible-role: AccessibleRole.banner;
|
|
HorizontalLayout {
|
|
padding-left: Theme.space-4;
|
|
padding-right: Theme.space-4;
|
|
spacing: Theme.space-4;
|
|
HorizontalLayout {
|
|
width: Theme.sidebar-width - Theme.space-4;
|
|
spacing: Theme.space-3;
|
|
Image {
|
|
width: 30px;
|
|
height: 30px;
|
|
y: (parent.height - self.height) / 2;
|
|
source: Icons.logo;
|
|
}
|
|
Text {
|
|
text: Bridge.app-name;
|
|
color: Theme.text;
|
|
font-size: Theme.font-xl;
|
|
font-weight: Theme.weight-semibold;
|
|
vertical-alignment: center;
|
|
}
|
|
if root.context != "": Text {
|
|
text: root.context;
|
|
color: Theme.accent-text;
|
|
font-size: Theme.font-md;
|
|
vertical-alignment: center;
|
|
overflow: elide;
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
horizontal-stretch: 1;
|
|
alignment: center;
|
|
// Opens the search (Ctrl+K does too).
|
|
Rectangle {
|
|
max-width: 680px;
|
|
height: 40px;
|
|
y: (parent.height - self.height) / 2;
|
|
SearchBox {
|
|
read-only: true;
|
|
placeholder: @tr("Search servers, channels, people or settings…");
|
|
label: @tr("Search");
|
|
}
|
|
TouchArea {
|
|
mouse-cursor: MouseCursor.text;
|
|
clicked => { Nav.open-search(""); }
|
|
}
|
|
}
|
|
}
|
|
IconButton {
|
|
icon: Icons.bell;
|
|
label: Bridge.notifications-unread > 0 ? @tr("{} new notifications", Bridge.notifications-unread) : @tr("Notifications");
|
|
dot: Bridge.notifications-unread > 0 || Bridge.share-requests > 0 || Bridge.crash-notice != "";
|
|
checked: Nav.notifications-open;
|
|
y: (parent.height - self.height) / 2;
|
|
clicked => { Nav.notifications-open = !Nav.notifications-open; }
|
|
}
|
|
IconButton {
|
|
icon: Icons.users;
|
|
label: @tr("Members");
|
|
checked: Nav.right-panel-open && !Nav.pins-open && !Nav.topics-open && Nav.page == Page.server;
|
|
y: (parent.height - self.height) / 2;
|
|
clicked => {
|
|
Nav.show(Page.server);
|
|
Nav.toggle-members();
|
|
}
|
|
}
|
|
Rectangle {
|
|
width: 1px;
|
|
height: 24px;
|
|
y: (parent.height - self.height) / 2;
|
|
background: Theme.border-strong;
|
|
}
|
|
IconButton {
|
|
icon: Icons.help;
|
|
label: @tr("About {}", Bridge.app-name);
|
|
y: (parent.height - self.height) / 2;
|
|
clicked => { Nav.open-about(); }
|
|
}
|
|
}
|
|
}
|
|
|
|
// A sidebar panel: the page's navigation (@children) above the voice card
|
|
// and the user card.
|
|
export component Sidebar inherits Panel {
|
|
width: Theme.sidebar-width;
|
|
horizontal-stretch: 0;
|
|
VerticalLayout {
|
|
padding: Theme.space-3;
|
|
spacing: Theme.space-3;
|
|
VerticalLayout {
|
|
vertical-stretch: 1;
|
|
spacing: Theme.space-3;
|
|
@children
|
|
}
|
|
if Bridge.voice-connected || Bridge.voice-connecting: VoiceCard { }
|
|
UserCard { }
|
|
}
|
|
}
|
|
|
|
// The frame: rail | (top bar / panels).
|
|
export component DesktopShell inherits Rectangle {
|
|
in property <string> context;
|
|
background: Theme.backdrop;
|
|
HorizontalLayout {
|
|
ServerRail { }
|
|
VerticalLayout {
|
|
TopBar {
|
|
context: root.context;
|
|
}
|
|
HorizontalLayout {
|
|
padding-left: Theme.space-3;
|
|
padding-right: Theme.space-3;
|
|
padding-bottom: Theme.space-3;
|
|
spacing: Theme.space-3;
|
|
@children
|
|
}
|
|
}
|
|
}
|
|
}
|