Brings in the Share button's menu (Share screen / Stream Studio) and the removal of the separate Stream Studio button from the headers, the codecs every TeamSpeak client decodes ahead of H.264, the portal fix and person segmentation. The phone header keeps this branch's voice-channel button and hides the bell on the voice screen, and loses the Stream Studio button as the development branch wants. The studio's test table takes the segmentation rows and the Android camera row. MediaCodec follows the new codec order with no code change (Codecs orders every hardware factory's codecs); its description and docs/media.md now say so, including what that means on a phone without a hardware VP8, VP9 or AV1 encoder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
265 lines
9.8 KiB
Plaintext
265 lines
9.8 KiB
Plaintext
// Pages of the narrow (phone) layout that the desktop shows elsewhere:
|
|
// the server list with the channels, activity, the "You" page, and the
|
|
// pins, topics and members over the page.
|
|
|
|
import { Theme } from "../theme.slint";
|
|
import { Icons } from "../icons.slint";
|
|
import { Bridge } from "../bridge.slint";
|
|
import { Nav, Page, SettingsSection } from "../nav.slint";
|
|
import { Icon, Button, ButtonKind, IconButton, Avatar, Status, CountBadge, LiveBadge, NavItem, ListItem, SectionHeader, Card, Banner, ScrollView, ActionButton } from "../components/index.slint";
|
|
import { ServerHeader, ConnectActions, ChannelTree } from "channels.slint";
|
|
import { StreamsPanel } from "streams.slint";
|
|
import { PinsDrawer, TopicsDrawer } from "drawers.slint";
|
|
import { MembersPanel } from "members.slint";
|
|
import { VoiceCard, VoiceButtons } from "../shells/common.slint";
|
|
import { StudioBridge } from "../studio-bridge.slint";
|
|
import { ShareMenu } from "../share-menu.slint";
|
|
|
|
// Servers as a horizontal strip, the current server, its channels.
|
|
export component MobileServers inherits VerticalLayout {
|
|
padding: Theme.space-3;
|
|
spacing: Theme.space-3;
|
|
ScrollView {
|
|
height: 64px;
|
|
vertical-stretch: 0;
|
|
HorizontalLayout {
|
|
spacing: Theme.space-3;
|
|
alignment: start;
|
|
for server in Bridge.servers: Rectangle {
|
|
width: 56px;
|
|
height: 56px;
|
|
accessible-role: AccessibleRole.list-item;
|
|
accessible-label: server.name;
|
|
accessible-item-selectable: true;
|
|
accessible-item-selected: Bridge.current-server == server.id;
|
|
accessible-action-default => { Nav.select-server(server.id); }
|
|
if Bridge.current-server == server.id: Rectangle {
|
|
width: 56px;
|
|
height: 56px;
|
|
border-radius: Theme.radius-lg + 3px;
|
|
border-width: 2px;
|
|
border-color: Theme.accent;
|
|
}
|
|
Avatar {
|
|
size: 46px;
|
|
square: true;
|
|
initials: server.initials;
|
|
tint: server.tint;
|
|
status: server.status == "connected" ? Status.online : server.status == "observing" ? Status.info : Status.none;
|
|
}
|
|
if server.unread > 0: CountBadge {
|
|
x: parent.width - self.width;
|
|
y: 0;
|
|
count: server.unread;
|
|
}
|
|
TouchArea {
|
|
clicked => { Nav.select-server(server.id); }
|
|
double-clicked => { Nav.edit-server(server.id); }
|
|
}
|
|
}
|
|
IconButton {
|
|
icon: Icons.plus;
|
|
label: @tr("Add server");
|
|
round: true;
|
|
filled: true;
|
|
size: 46px;
|
|
tint: Theme.success;
|
|
y: 5px;
|
|
clicked => { Nav.add-server(); }
|
|
}
|
|
}
|
|
}
|
|
ServerHeader { }
|
|
if !Bridge.voice-connected && !Bridge.voice-connecting: ConnectActions { }
|
|
if Bridge.voice-connected || Bridge.voice-connecting: VoiceCard { }
|
|
ChannelTree {
|
|
vertical-stretch: 1;
|
|
}
|
|
}
|
|
|
|
// Streams, requests and the app's status.
|
|
export component ActivityPage inherits VerticalLayout {
|
|
spacing: Theme.space-3;
|
|
if Bridge.crash-notice != "": HorizontalLayout {
|
|
padding: Theme.space-3;
|
|
Banner {
|
|
text: Bridge.crash-notice;
|
|
IconButton {
|
|
icon: Icons.x;
|
|
label: @tr("Dismiss");
|
|
size: 28px;
|
|
y: (parent.height - self.height) / 2;
|
|
clicked => { Bridge.dismiss-crash-notice(); }
|
|
}
|
|
}
|
|
}
|
|
if Bridge.status-text != "": HorizontalLayout {
|
|
padding-left: Theme.space-4;
|
|
padding-right: Theme.space-4;
|
|
spacing: Theme.space-3;
|
|
Icon {
|
|
source: Icons.info;
|
|
size: Theme.icon-sm;
|
|
tint: Theme.accent-text;
|
|
y: (parent.height - self.height) / 2;
|
|
}
|
|
Text {
|
|
text: Bridge.status-text;
|
|
color: Theme.text-secondary;
|
|
font-size: Theme.font-sm;
|
|
wrap: word-wrap;
|
|
horizontal-stretch: 1;
|
|
}
|
|
}
|
|
StreamsPanel {
|
|
vertical-stretch: 1;
|
|
}
|
|
}
|
|
|
|
// Profile, voice controls, settings and About.
|
|
export component YouPage inherits ScrollView {
|
|
VerticalLayout {
|
|
width: root.visible-width;
|
|
padding: Theme.space-4;
|
|
spacing: Theme.space-4;
|
|
alignment: start;
|
|
Card {
|
|
HorizontalLayout {
|
|
spacing: Theme.space-4;
|
|
Avatar {
|
|
size: 56px;
|
|
initials: "";
|
|
tint: Theme.accent;
|
|
status: Bridge.voice-connected ? Status.online : Bridge.observing ? Status.info : Status.offline;
|
|
Icon {
|
|
source: Icons.user;
|
|
size: 28px;
|
|
tint: #ffffff;
|
|
}
|
|
}
|
|
VerticalLayout {
|
|
alignment: center;
|
|
horizontal-stretch: 1;
|
|
Text {
|
|
text: Bridge.nickname != "" ? Bridge.nickname : Bridge.app-name;
|
|
color: Theme.text;
|
|
font-size: Theme.font-lg;
|
|
font-weight: Theme.weight-semibold;
|
|
}
|
|
Text {
|
|
text: Bridge.voice-connected ? Bridge.server-title : @tr("Offline");
|
|
color: Theme.text-muted;
|
|
font-size: Theme.font-sm;
|
|
}
|
|
}
|
|
}
|
|
HorizontalLayout {
|
|
alignment: space-around;
|
|
ActionButton {
|
|
icon: Bridge.input-muted ? Icons.mic-off : Icons.mic;
|
|
text: Bridge.input-muted ? @tr("Unmute") : @tr("Mute");
|
|
checked: Bridge.input-muted;
|
|
danger: true;
|
|
enabled: Bridge.voice-connected;
|
|
clicked => { Bridge.set-input-muted(!Bridge.input-muted); }
|
|
}
|
|
ActionButton {
|
|
icon: Bridge.output-muted ? Icons.headphone-off : Icons.headphones;
|
|
text: Bridge.output-muted ? @tr("Undeafen") : @tr("Deafen");
|
|
checked: Bridge.output-muted;
|
|
danger: true;
|
|
enabled: Bridge.voice-connected;
|
|
clicked => { Bridge.set-output-muted(!Bridge.output-muted); }
|
|
}
|
|
// A screen or the Stream Studio (ShareMenu).
|
|
if Bridge.streams-available && Bridge.can-share: VerticalLayout {
|
|
live := ActionButton {
|
|
icon: Icons.radio;
|
|
text: Bridge.share-state == "live" || StudioBridge.status.live ? @tr("Live") : @tr("Go Live");
|
|
checked: Bridge.share-state == "live" || StudioBridge.status.live;
|
|
clicked => { share-menu.open(0, - live.height - share-menu.menu-height - 4px); }
|
|
}
|
|
share-menu := ShareMenu { }
|
|
}
|
|
ActionButton {
|
|
icon: Icons.phone-off;
|
|
text: @tr("Leave");
|
|
danger: true;
|
|
checked: Bridge.voice-connected;
|
|
enabled: Bridge.voice-connected;
|
|
clicked => { Bridge.disconnect-voice(); }
|
|
}
|
|
}
|
|
}
|
|
SectionHeader {
|
|
text: @tr("Settings");
|
|
small: true;
|
|
}
|
|
NavItem {
|
|
icon: Icons.mic;
|
|
text: @tr("Voice & Video");
|
|
chevron: true;
|
|
clicked => { Nav.open-settings(SettingsSection.voice); }
|
|
}
|
|
NavItem {
|
|
icon: Icons.keyboard;
|
|
text: @tr("Keybinds");
|
|
chevron: true;
|
|
clicked => { Nav.open-settings(SettingsSection.keybinds); }
|
|
}
|
|
NavItem {
|
|
icon: Icons.radio;
|
|
text: @tr("Streaming");
|
|
chevron: true;
|
|
clicked => { Nav.open-settings(SettingsSection.streaming); }
|
|
}
|
|
NavItem {
|
|
icon: Icons.shield;
|
|
text: @tr("Privacy & Safety");
|
|
chevron: true;
|
|
clicked => { Nav.open-settings(SettingsSection.privacy); }
|
|
}
|
|
NavItem {
|
|
icon: Icons.palette;
|
|
text: @tr("Appearance");
|
|
chevron: true;
|
|
clicked => { Nav.open-settings(SettingsSection.appearance); }
|
|
}
|
|
NavItem {
|
|
icon: Icons.info;
|
|
text: @tr("About {}", Bridge.app-name);
|
|
chevron: true;
|
|
clicked => { Nav.open-about(); }
|
|
}
|
|
}
|
|
}
|
|
|
|
// The pins, the topics or the server's members as a page over the current
|
|
// one (the desktop shows them beside the chat).
|
|
export component PhoneSheet inherits Rectangle {
|
|
background: Theme.bg-app;
|
|
// Nothing below takes clicks while it is shown.
|
|
TouchArea { }
|
|
if Nav.pins-open: PinsDrawer { }
|
|
if Nav.topics-open && !Nav.pins-open: TopicsDrawer { }
|
|
if Nav.members-open && !Nav.pins-open && !Nav.topics-open: VerticalLayout {
|
|
HorizontalLayout {
|
|
padding-left: Theme.space-3;
|
|
padding-top: Theme.space-3;
|
|
spacing: Theme.space-2;
|
|
alignment: start;
|
|
IconButton {
|
|
icon: Icons.arrow-left;
|
|
label: @tr("Back");
|
|
round: true;
|
|
filled: true;
|
|
size: 36px;
|
|
clicked => { Nav.members-open = false; }
|
|
}
|
|
}
|
|
MembersPanel {
|
|
vertical-stretch: 1;
|
|
}
|
|
}
|
|
}
|