Home, friends, direct messages, the bell, search, events and settings pages
The screens of design mockups 01, 02, 03 (server sidebar links) and 11 on the existing pattern (Bridge models synced row by row, view models in vm/, callbacks in bind/), mapped onto what TeamSpeak has: - Home: a banner with Voelin and each server, friends online from the sessions' presence, live streams of our servers (our channel, the gateways' directories, clients flagged streaming), the servers with Join, the latest chats across servers (history store), friend activity, quick actions (add, join by address, find friends) and what is happening (gateway events, scheduled streams, server news). The Library lists the Stream Studio's recordings and clips. - Friends: contacts with where they are, message, poke, join, watch, relation, note, volume and mute. - Direct messages: private chats of every server and of the store, pokes among the messages, a clear state when the peer cannot be reached, TS3/TS6 offline messages (list, read, send, delete). - The bell (mentions, pokes, messages, event reminders, friends coming online; a setting per kind, desktop notifications), the Ctrl+K search (servers, channels, people, settings pages; keyboard). - A server's events page (RSVP, attendees, create/edit/delete, scheduled streams) and the Events/Members entries above the tree. - Inline pictures in chat (downloaded into memory up to ui.image_preview_kb, decoded once into the image cache). - Settings: My Account, Profiles (identities: default, rename, delete, export, import from the official clients, security level on every core, identity per bookmark), Appearance, Voice & Video (camera preview with blur, video and stream quality, streaming permissions), Streaming (defaults, simulcast layers, audio sources), Devices, Notifications, Privacy & Safety, Keybinds, Integrations (gateways, gateway administration, encoders) and Advanced (SRTP order, history, cache, every setting as JSON). The top bar's field now opens the search instead of filtering the channel tree; the search finds channels of every server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No files matched your search
@@ -24,7 +24,11 @@ import { MemberCardPopup, MembersPanel } from "screens/members.slint";
|
||||
import { VoiceView } from "screens/voice.slint";
|
||||
import { StreamViewer } from "screens/streams.slint";
|
||||
import { SettingsNav, SettingsPage } from "screens/settings.slint";
|
||||
import { HomeNav, HomePage } from "screens/home.slint";
|
||||
import { HomeNav, HomePage, HomeAside, LibraryPage } from "screens/home.slint";
|
||||
import { FriendsPage, ContactPanel } from "screens/friends.slint";
|
||||
import { MessagesPage, ConversationList, Conversation, DmProfile, OfflineDialog } from "screens/messages.slint";
|
||||
import { ServerLinks, EventsPage, EventDialog } from "screens/events.slint";
|
||||
import { NotificationsPanel, SearchPalette, Lightbox } from "screens/overlays.slint";
|
||||
import { MobileServers, ActivityPage, YouPage } from "screens/mobile.slint";
|
||||
import { BookmarkDialog, ShareDialog, ClientAudioDialog, AboutDialog } from "screens/dialogs.slint";
|
||||
|
||||
@@ -46,10 +50,14 @@ export component MainWindow inherits Window {
|
||||
// Set from change handlers: a binding on `width` would loop through the
|
||||
// layout.
|
||||
property <length> breakpoint: Nav.narrow-breakpoint;
|
||||
changed width => { Nav.narrow = self.width < Nav.narrow-breakpoint; }
|
||||
changed width => {
|
||||
Nav.narrow = self.width < Nav.narrow-breakpoint;
|
||||
Nav.wide = self.width > 1180px;
|
||||
}
|
||||
changed breakpoint => { Nav.narrow = self.width < Nav.narrow-breakpoint; }
|
||||
init => {
|
||||
Nav.narrow = self.width < Nav.narrow-breakpoint;
|
||||
Nav.wide = self.width > 1180px;
|
||||
Theme.system-dark = Palette.color-scheme != ColorScheme.light;
|
||||
}
|
||||
// Android: the space under the on-screen keyboard (the window is not
|
||||
@@ -98,8 +106,8 @@ export component MainWindow inherits Window {
|
||||
keys := FocusScope {
|
||||
// Ctrl+K: search.
|
||||
capture-key-pressed(event) => {
|
||||
if event.modifiers.control && (event.text == "k" || event.text == "K") && !Nav.narrow && root.chrome {
|
||||
Nav.search-requests += 1;
|
||||
if event.modifiers.control && (event.text == "k" || event.text == "K") && root.chrome {
|
||||
Nav.open-search("");
|
||||
return accept;
|
||||
}
|
||||
reject
|
||||
@@ -123,8 +131,41 @@ export component MainWindow inherits Window {
|
||||
horizontal-stretch: 1;
|
||||
HomePage { }
|
||||
}
|
||||
if Nav.page == Page.server: Sidebar {
|
||||
if Nav.page == Page.home && Nav.wide: Panel {
|
||||
width: 300px;
|
||||
horizontal-stretch: 0;
|
||||
HomeAside { }
|
||||
}
|
||||
// Friends, direct messages and the Library share the home
|
||||
// sidebar.
|
||||
if Nav.page == Page.friends || Nav.page == Page.messages || Nav.page == Page.library: Sidebar {
|
||||
HomeNav { }
|
||||
}
|
||||
if Nav.page == Page.friends: Panel {
|
||||
horizontal-stretch: 1;
|
||||
FriendsPage { }
|
||||
}
|
||||
if Nav.page == Page.friends && Bridge.contact.uid != "": Panel {
|
||||
width: 320px;
|
||||
horizontal-stretch: 0;
|
||||
ContactPanel { }
|
||||
}
|
||||
if Nav.page == Page.messages: Panel {
|
||||
horizontal-stretch: 1;
|
||||
MessagesPage { }
|
||||
}
|
||||
if Nav.page == Page.messages && Bridge.dm.open && !Bridge.dm.mail && Nav.wide: Panel {
|
||||
width: 300px;
|
||||
horizontal-stretch: 0;
|
||||
DmProfile { }
|
||||
}
|
||||
if Nav.page == Page.library: Panel {
|
||||
horizontal-stretch: 1;
|
||||
LibraryPage { }
|
||||
}
|
||||
if Nav.page == Page.server || Nav.page == Page.events: Sidebar {
|
||||
ServerHeader { }
|
||||
ServerLinks { }
|
||||
if !Bridge.voice-connected && !Bridge.voice-connecting: ConnectActions { }
|
||||
ChannelTree {
|
||||
vertical-stretch: 1;
|
||||
@@ -151,9 +192,12 @@ export component MainWindow inherits Window {
|
||||
if Nav.topics-open && !Nav.pins-open: TopicsDrawer { }
|
||||
if !Nav.pins-open && !Nav.topics-open: MembersPanel { }
|
||||
}
|
||||
if Nav.page == Page.events: Panel {
|
||||
horizontal-stretch: 1;
|
||||
EventsPage { }
|
||||
}
|
||||
if Nav.page == Page.settings: Sidebar {
|
||||
SettingsNav { }
|
||||
Rectangle { vertical-stretch: 1; }
|
||||
}
|
||||
if Nav.page == Page.settings: Panel {
|
||||
horizontal-stretch: 1;
|
||||
@@ -163,18 +207,44 @@ export component MainWindow inherits Window {
|
||||
|
||||
if Nav.narrow && root.chrome: MobileShell {
|
||||
title: Nav.page == Page.settings ? @tr("Settings")
|
||||
: Nav.page == Page.friends ? @tr("Friends")
|
||||
: Nav.page == Page.messages ? @tr("Messages")
|
||||
: Nav.page == Page.library ? @tr("Library")
|
||||
: Nav.page == Page.events ? @tr("Events")
|
||||
: Nav.mobile-tab == MobileTab.home ? Bridge.app-name
|
||||
: Nav.mobile-tab == MobileTab.you ? @tr("You")
|
||||
: Nav.mobile-tab == MobileTab.activity ? @tr("Activity")
|
||||
: Bridge.server-title;
|
||||
subtitle: Nav.page == Page.settings ? "" : Nav.mobile-tab == MobileTab.chat && Bridge.current-tab >= 0 && Bridge.current-tab < Bridge.tabs.length ? Bridge.tabs[Bridge.current-tab].title : Nav.mobile-tab == MobileTab.servers ? Bridge.server-stats : "";
|
||||
back: Nav.page == Page.settings;
|
||||
back: Nav.page == Page.settings || Nav.page == Page.friends || Nav.page == Page.messages || Nav.page == Page.library || Nav.page == Page.events;
|
||||
unread: Bridge.unread-total;
|
||||
go-back => { Nav.show(Page.server); }
|
||||
go-back => {
|
||||
if Nav.page == Page.messages && Bridge.dm.open {
|
||||
Bridge.open-conversation(-1);
|
||||
} else if Nav.page == Page.events || Nav.page == Page.settings {
|
||||
Nav.show(Page.server);
|
||||
} else {
|
||||
Nav.show(Page.home);
|
||||
Nav.mobile-tab = MobileTab.home;
|
||||
}
|
||||
}
|
||||
if Nav.page == Page.settings: SettingsPage {
|
||||
compact: true;
|
||||
}
|
||||
if Nav.page != Page.settings && (Nav.page == Page.home || Nav.mobile-tab == MobileTab.home): HomePage { }
|
||||
if Nav.page == Page.home || (Nav.page == Page.server && Nav.mobile-tab == MobileTab.home): HomePage {
|
||||
compact: true;
|
||||
}
|
||||
if Nav.page == Page.friends: FriendsPage {
|
||||
compact: true;
|
||||
}
|
||||
if Nav.page == Page.messages && !Bridge.dm.open: ConversationList { }
|
||||
if Nav.page == Page.messages && Bridge.dm.open: Conversation {
|
||||
compact: true;
|
||||
}
|
||||
if Nav.page == Page.library: LibraryPage { }
|
||||
if Nav.page == Page.events: EventsPage {
|
||||
compact: true;
|
||||
}
|
||||
if Nav.page == Page.server && Nav.mobile-tab == MobileTab.servers: MobileServers { }
|
||||
if Nav.page == Page.server && Nav.mobile-tab == MobileTab.chat && Bridge.viewer-open: StreamViewer { }
|
||||
if Nav.page == Page.server && Nav.mobile-tab == MobileTab.chat && !Bridge.viewer-open: ChatView {
|
||||
@@ -228,12 +298,39 @@ export component MainWindow inherits Window {
|
||||
}
|
||||
}
|
||||
|
||||
// The bell's panel, under the bell (the phone: the whole width).
|
||||
if Nav.notifications-open: Rectangle {
|
||||
TouchArea {
|
||||
clicked => { Nav.notifications-open = false; }
|
||||
}
|
||||
NotificationsPanel {
|
||||
x: Nav.narrow ? 8px : parent.width - self.width - 100px;
|
||||
y: Nav.narrow ? 64px : Theme.topbar-height;
|
||||
width: Nav.narrow ? parent.width - 16px : 400px;
|
||||
height: min(parent.height - self.y - 16px, 560px);
|
||||
}
|
||||
}
|
||||
|
||||
if Nav.search-open: SearchPalette { }
|
||||
|
||||
if Nav.lightbox-open: Lightbox { }
|
||||
|
||||
if Nav.event-form-open: EventDialog {
|
||||
form <=> Nav.event-form;
|
||||
done => { Nav.event-form-open = false; }
|
||||
}
|
||||
|
||||
if Nav.offline-form-open: OfflineDialog {
|
||||
done => { Nav.offline-form-open = false; }
|
||||
}
|
||||
|
||||
if Nav.topic-form-open: TopicDialog {
|
||||
done => { Nav.topic-form-open = false; }
|
||||
}
|
||||
|
||||
if Nav.bookmark-open: BookmarkDialog {
|
||||
form <=> Nav.bookmark-form;
|
||||
join: Nav.join-open;
|
||||
done => { Nav.bookmark-open = false; }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-arrow-down"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M12 5v14" />
|
||||
<path d="m19 12-7 7-7-7" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 343 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-arrow-up"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m5 12 7-7 7 7" />
|
||||
<path d="M12 19V5" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 340 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-ban"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M4.929 4.929 19.07 19.071" />
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 359 B |
@@ -0,0 +1,17 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-bell-ring"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
|
||||
<path d="M22 8c0-2.3-.8-4.3-2-6" />
|
||||
<path d="M4 2C2.8 3.7 2 5.7 2 8" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 408 B |
@@ -0,0 +1,24 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-calendar-days"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M8 2v4" />
|
||||
<path d="M16 2v4" />
|
||||
<rect width="18" height="18" x="3" y="4" rx="2" />
|
||||
<path d="M3 10h18" />
|
||||
<path d="M8 14h.01" />
|
||||
<path d="M12 14h.01" />
|
||||
<path d="M16 14h.01" />
|
||||
<path d="M8 18h.01" />
|
||||
<path d="M12 18h.01" />
|
||||
<path d="M16 18h.01" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 568 B |
@@ -0,0 +1,20 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-calendar-plus"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M16 19h6" />
|
||||
<path d="M16 2v4" />
|
||||
<path d="M19 16v6" />
|
||||
<path d="M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5" />
|
||||
<path d="M3 10h18" />
|
||||
<path d="M8 2v4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 488 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-circle-check"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<path d="m9 12 2 2 4-4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 356 B |
@@ -0,0 +1,17 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-circle-x"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<path d="m15 9-6 6" />
|
||||
<path d="m9 9 6 6" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 372 B |
@@ -0,0 +1,17 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-clapperboard"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m6.2 5.3 3.1 3.9" />
|
||||
<path d="m12.4 3.4 3.1 4" />
|
||||
<path d="M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 411 B |
@@ -0,0 +1,28 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-cpu"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M12 20v2" />
|
||||
<path d="M12 2v2" />
|
||||
<path d="M17 20v2" />
|
||||
<path d="M17 2v2" />
|
||||
<path d="M2 12h2" />
|
||||
<path d="M2 17h2" />
|
||||
<path d="M2 7h2" />
|
||||
<path d="M20 12h2" />
|
||||
<path d="M20 17h2" />
|
||||
<path d="M20 7h2" />
|
||||
<path d="M7 20v2" />
|
||||
<path d="M7 2v2" />
|
||||
<rect x="4" y="4" width="16" height="16" rx="2" />
|
||||
<rect x="8" y="8" width="8" height="8" rx="1" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 664 B |
@@ -0,0 +1,22 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-film"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect width="18" height="18" x="3" y="3" rx="2" />
|
||||
<path d="M7 3v18" />
|
||||
<path d="M3 7.5h4" />
|
||||
<path d="M3 12h18" />
|
||||
<path d="M3 16.5h4" />
|
||||
<path d="M17 3v18" />
|
||||
<path d="M17 7.5h4" />
|
||||
<path d="M17 16.5h4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 507 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-flask-conical"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M6.453 15h11.094" />
|
||||
<path d="M8.5 2h7" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 348 B |
@@ -0,0 +1,15 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-folder"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 286 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-gauge"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m12 14 4-4" />
|
||||
<path d="M3.34 19a10 10 0 1 1 17.32 0" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 354 B |
@@ -0,0 +1,19 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-id-card"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M16 10h2" />
|
||||
<path d="M16 14h2" />
|
||||
<path d="M6.17 15a3 3 0 0 1 5.66 0" />
|
||||
<circle cx="9" cy="11" r="2" />
|
||||
<rect x="2" y="5" width="20" height="14" rx="2" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 462 B |
@@ -0,0 +1,15 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-inbox"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<polyline points="22 12 16 12 14 15 10 15 8 12 2 12" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 342 B |
@@ -0,0 +1,15 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-key-round"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="16.5" cy="7.5" r=".5" fill="currentColor" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 347 B |
@@ -0,0 +1,15 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-layers"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 286 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-mail"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" />
|
||||
<rect x="2" y="4" width="20" height="16" rx="2" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 391 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-megaphone"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14" />
|
||||
<path d="M8 6v8" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 385 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-message-square-plus"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M12 8v6" />
|
||||
<path d="M9 11h6" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 344 B |
@@ -0,0 +1,17 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-plug"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M12 22v-5" />
|
||||
<path d="M15 8V2" />
|
||||
<path d="M9 8V2" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 353 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-rotate-ccw"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" />
|
||||
<path d="M3 3v5h5" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 378 B |
@@ -0,0 +1,17 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-scroll-text"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M15 12h-5" />
|
||||
<path d="M15 8h-5" />
|
||||
<path d="M19 17V5a2 2 0 0 0-2-2H4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 379 B |
@@ -0,0 +1,17 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-upload"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M12 3v12" />
|
||||
<path d="m17 8-5-5-5 5" />
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 395 B |
@@ -0,0 +1,17 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-user-check"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m16 11 2 2 4-4" />
|
||||
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
|
||||
<circle cx="9" cy="7" r="4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 409 B |
@@ -0,0 +1,25 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-user-cog"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M10 15H6a4 4 0 0 0-4 4v2" />
|
||||
<path d="m14.305 16.53.923-.382" />
|
||||
<path d="m15.228 13.852-.923-.383" />
|
||||
<path d="m16.852 12.228-.383-.923" />
|
||||
<path d="m16.852 17.772-.383.924" />
|
||||
<path d="m19.148 12.228.383-.923" />
|
||||
<path d="m19.53 18.696-.382-.924" />
|
||||
<path d="m20.772 13.852.924-.383" />
|
||||
<path d="m20.772 16.148.924.383" />
|
||||
<circle cx="18" cy="15" r="3" />
|
||||
<circle cx="9" cy="7" r="4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 707 B |
@@ -0,0 +1,16 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-user-round"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="12" cy="8" r="5" />
|
||||
<path d="M20 21a8 8 0 0 0-16 0" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 360 B |
@@ -0,0 +1,18 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-user-x"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
|
||||
<circle cx="9" cy="7" r="4" />
|
||||
<line x1="17" x2="22" y1="8" y2="13" />
|
||||
<line x1="22" x2="17" y1="8" y2="13" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 459 B |
@@ -0,0 +1,21 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-wand-sparkles"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m14 7 3 3" />
|
||||
<path d="M5 6v4" />
|
||||
<path d="M19 14v4" />
|
||||
<path d="M10 2v2" />
|
||||
<path d="M7 8H3" />
|
||||
<path d="M21 16h-4" />
|
||||
<path d="M11 3H9" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 456 B |
@@ -0,0 +1,15 @@
|
||||
<!-- @license lucide-react v0.563.0 - ISC -->
|
||||
<svg
|
||||
class="lucide lucide-zap"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 283 B |
@@ -15,6 +15,12 @@ export struct ServerItem {
|
||||
unread: int,
|
||||
// Someone streams in our channel there.
|
||||
live: bool,
|
||||
// "9 online · 7 channels" while its presence is known, else the address.
|
||||
detail: string,
|
||||
// "TeamSpeak 6", "TeamSpeak 3", "" before it was reached.
|
||||
flavor: string,
|
||||
// Gateway or query credentials: presence without joining.
|
||||
gateway: bool,
|
||||
}
|
||||
|
||||
export struct TreeItem {
|
||||
@@ -150,6 +156,8 @@ export struct FileItem {
|
||||
progress: float,
|
||||
// A picture, so the icon differs.
|
||||
picture: bool,
|
||||
// The picture itself, once downloaded: shown inline instead of the card.
|
||||
preview: image,
|
||||
}
|
||||
|
||||
export struct ChatLine {
|
||||
@@ -305,6 +313,427 @@ export struct AppearanceForm {
|
||||
image-cache-mb: float,
|
||||
}
|
||||
|
||||
// Home, friends, direct messages, notifications, search, events and the
|
||||
// settings pages (docs/ui.md). Lists are models Rust syncs row by row.
|
||||
|
||||
// A contact (friend, blocked or neutral) and where they are now.
|
||||
export struct ContactItem {
|
||||
uid: string,
|
||||
name: string,
|
||||
initials: string,
|
||||
tint: color,
|
||||
avatar: image,
|
||||
// "friend", "blocked" or "neutral"
|
||||
relation: string,
|
||||
online: bool,
|
||||
away: bool,
|
||||
streaming: bool,
|
||||
// What they do: "In Chill Zone", "Streaming", "Away: brb", "Offline".
|
||||
status: string,
|
||||
// Where: the server of the first session that sees them, or "Last seen
|
||||
// 2 h ago on Nightfall Guild".
|
||||
place: string,
|
||||
// "12m ago": online since (this run), else when last seen.
|
||||
when: string,
|
||||
note: string,
|
||||
// Local playback in percent.
|
||||
volume: float,
|
||||
muted: bool,
|
||||
// "Contact since 14 Jan 2022".
|
||||
since: string,
|
||||
// Every session that sees them: "Nightfall Guild · #Chill Zone".
|
||||
spots: [string],
|
||||
// A voice connection sees them: they can be messaged, poked, joined.
|
||||
reachable: bool,
|
||||
selected: bool,
|
||||
}
|
||||
|
||||
// A live stream on one of our servers (home page).
|
||||
export struct LiveItem {
|
||||
// The session (bookmark id) and the stream (directory or stream id).
|
||||
session: int,
|
||||
id: string,
|
||||
title: string,
|
||||
streamer: string,
|
||||
initials: string,
|
||||
tint: color,
|
||||
avatar: image,
|
||||
server: string,
|
||||
channel: string,
|
||||
// 0: unknown.
|
||||
viewers: int,
|
||||
// "Screen", "Camera", ...
|
||||
kind: string,
|
||||
// The server's colour, for the card's picture.
|
||||
backdrop: color,
|
||||
// In our voice channel: it can be watched at once.
|
||||
watchable: bool,
|
||||
}
|
||||
|
||||
// A chat in the recent chats and in the direct messages list.
|
||||
export struct ConversationItem {
|
||||
// Index in Rust's list (what `open-conversation` takes).
|
||||
key: int,
|
||||
// 0 server chat, 1 channel chat, 2 private chat, 3 offline message.
|
||||
kind: int,
|
||||
title: string,
|
||||
// The server's name.
|
||||
server: string,
|
||||
// "You: That works!", "Sent a file".
|
||||
preview: string,
|
||||
// "11:42", "Yesterday", "Mon", "12 Mar".
|
||||
time: string,
|
||||
// "10m ago".
|
||||
ago: string,
|
||||
unread: int,
|
||||
initials: string,
|
||||
tint: color,
|
||||
avatar: image,
|
||||
online: bool,
|
||||
selected: bool,
|
||||
}
|
||||
|
||||
// A notification of the bell.
|
||||
export struct NoticeItem {
|
||||
key: int,
|
||||
// "mention", "poke", "message", "event", "friend"
|
||||
kind: string,
|
||||
title: string,
|
||||
body: string,
|
||||
// "3 min ago"
|
||||
time: string,
|
||||
unread: bool,
|
||||
initials: string,
|
||||
tint: color,
|
||||
avatar: image,
|
||||
}
|
||||
|
||||
// A result of the search (Ctrl+K).
|
||||
export struct SearchItem {
|
||||
// "server", "channel", "person", "contact", "setting"
|
||||
kind: string,
|
||||
title: string,
|
||||
subtitle: string,
|
||||
initials: string,
|
||||
tint: color,
|
||||
avatar: image,
|
||||
// The first result of a group names it ("Servers", "People", ...).
|
||||
header: string,
|
||||
}
|
||||
|
||||
// Something on our servers: an event, a scheduled stream or server news.
|
||||
export struct HappeningItem {
|
||||
// "event", "stream", "news"
|
||||
kind: string,
|
||||
title: string,
|
||||
subtitle: string,
|
||||
// "Sat 26 Apr · 19:00"
|
||||
when: string,
|
||||
session: int,
|
||||
id: int,
|
||||
live: bool,
|
||||
}
|
||||
|
||||
// A scheduled event of a server's gateway.
|
||||
export struct EventItem {
|
||||
id: int,
|
||||
title: string,
|
||||
description: string,
|
||||
// The date block: "SAT", "26", "APR".
|
||||
weekday: string,
|
||||
day: string,
|
||||
month: string,
|
||||
// "Sat 26 Apr, 19:00 – 21:00"
|
||||
when: string,
|
||||
// "#Raid Night" or "Server-wide".
|
||||
place: string,
|
||||
// A scheduled stream: "Exploring the Lands Between · Elden Ring".
|
||||
stream: string,
|
||||
live: bool,
|
||||
going: int,
|
||||
maybe: int,
|
||||
not-going: int,
|
||||
// "going", "maybe", "not_going" or "".
|
||||
rsvp: string,
|
||||
creator: string,
|
||||
// We may edit and delete it (ours, or we moderate).
|
||||
editable: bool,
|
||||
// "Starts in 15 min", "Started 5 min ago", "".
|
||||
soon: string,
|
||||
// "Nova (going)", ...; filled once the event was opened.
|
||||
attendees: [string],
|
||||
expanded: bool,
|
||||
}
|
||||
|
||||
// The event form (create or edit).
|
||||
export struct EventForm {
|
||||
// -1: a new event.
|
||||
id: int,
|
||||
title: string,
|
||||
description: string,
|
||||
// "2026-10-04 19:00", local time.
|
||||
start: string,
|
||||
// Empty: no end.
|
||||
end: string,
|
||||
// Index into `event-channels` (0: server-wide).
|
||||
channel: int,
|
||||
stream: bool,
|
||||
stream-title: string,
|
||||
game: string,
|
||||
}
|
||||
|
||||
// An offline message to write (mail the server keeps).
|
||||
export struct OfflineForm {
|
||||
// The peer's unique id and name.
|
||||
uid: string,
|
||||
to: string,
|
||||
subject: string,
|
||||
text: string,
|
||||
}
|
||||
|
||||
// The open direct message: who, and what can be done.
|
||||
export struct DmPeer {
|
||||
open: bool,
|
||||
uid: string,
|
||||
name: string,
|
||||
initials: string,
|
||||
tint: color,
|
||||
avatar: image,
|
||||
online: bool,
|
||||
// "Online · Nightfall Guild · #Chill Zone", "Offline · last seen 2 h ago".
|
||||
status: string,
|
||||
description: string,
|
||||
groups: [string],
|
||||
note: string,
|
||||
since: string,
|
||||
// Where they are now, or where they were last seen.
|
||||
servers: [string],
|
||||
// Files linked in the conversation: "name · 2.4 MB".
|
||||
files: [string],
|
||||
friend: bool,
|
||||
blocked: bool,
|
||||
volume: float,
|
||||
muted: bool,
|
||||
// Messages can be sent now (a voice connection that sees them).
|
||||
can-send: bool,
|
||||
// Why not: "Kairo is offline.", "Connect to Nightfall Guild to send."
|
||||
notice: string,
|
||||
// The server keeps offline messages: offer one.
|
||||
offline: bool,
|
||||
// Connect with voice to the server of this conversation.
|
||||
can-connect: bool,
|
||||
// The messages come from the store, without a session: read-only.
|
||||
stored: bool,
|
||||
// An offline message is shown instead of the conversation.
|
||||
mail: bool,
|
||||
mail-subject: string,
|
||||
mail-text: string,
|
||||
mail-time: string,
|
||||
}
|
||||
|
||||
// An identity (Profiles page); never its key.
|
||||
export struct IdentityItem {
|
||||
id: int,
|
||||
name: string,
|
||||
// Unique ids on TeamSpeak 3 and TeamSpeak 6 servers.
|
||||
uid: string,
|
||||
uid6: string,
|
||||
level: int,
|
||||
default: bool,
|
||||
// Raising its level: the level aimed at and the best one reached (0: no).
|
||||
improving: int,
|
||||
reached: int,
|
||||
// The bookmarks that use it.
|
||||
used-by: string,
|
||||
}
|
||||
|
||||
// An identity found in another client's files (import).
|
||||
export struct FoundIdentity {
|
||||
name: string,
|
||||
uid: string,
|
||||
level: int,
|
||||
source: string,
|
||||
// Already in our identities.
|
||||
known: bool,
|
||||
picked: bool,
|
||||
}
|
||||
|
||||
// A bookmark and the identity it connects with (Profiles page).
|
||||
export struct BookmarkIdentity {
|
||||
id: int,
|
||||
name: string,
|
||||
// Index into `identity-names` (0: the default identity).
|
||||
identity: int,
|
||||
}
|
||||
|
||||
// Camera, video and stream quality (Voice & Video page).
|
||||
export struct VideoForm {
|
||||
// Index into `cameras`.
|
||||
camera: int,
|
||||
// 0 none, 1 blur.
|
||||
background: int,
|
||||
// "auto", "1280x720", ...
|
||||
resolution: string,
|
||||
// `stream.fps` as typed.
|
||||
fps: string,
|
||||
// auto, vp8, vp9, h264, av1.
|
||||
codec: int,
|
||||
hardware: bool,
|
||||
mirror: bool,
|
||||
// everyone, friends, channel, nobody.
|
||||
permissions: int,
|
||||
// 0 auto, 1 720p, 2 1080p, 3 1440p, -1 other layers.
|
||||
quality: int,
|
||||
// kbit/s.
|
||||
bitrate: float,
|
||||
// The camera preview runs.
|
||||
preview: bool,
|
||||
}
|
||||
|
||||
// A simulcast layer of our stream (Streaming page); numbers as typed.
|
||||
export struct LayerItem {
|
||||
// "1920x1080", or a scale like "0.5".
|
||||
size: string,
|
||||
// Frames per second; "" no cap.
|
||||
fps: string,
|
||||
// kbit/s.
|
||||
bitrate: string,
|
||||
min-bitrate: string,
|
||||
max-bitrate: string,
|
||||
}
|
||||
|
||||
// An audio source mixed into our stream.
|
||||
export struct AudioSourceItem {
|
||||
// "desktop", "app", "window", "microphone", "synthetic"
|
||||
kind: string,
|
||||
name: string,
|
||||
detail: string,
|
||||
// Percent.
|
||||
gain: float,
|
||||
muted: bool,
|
||||
}
|
||||
|
||||
// Stream defaults (Streaming page).
|
||||
export struct StreamingForm {
|
||||
fps: string,
|
||||
bitrate: string,
|
||||
// auto, vp8, vp9, h264, av1.
|
||||
codec: int,
|
||||
// auto, portal, wlroots, x11.
|
||||
capture: int,
|
||||
replay-seconds: string,
|
||||
replay-memory: string,
|
||||
recording-dir: string,
|
||||
}
|
||||
|
||||
// Notification kinds: 0 off, 1 in the app, 2 also on the desktop.
|
||||
export struct NotifyForm {
|
||||
mentions: int,
|
||||
pokes: int,
|
||||
messages: int,
|
||||
events: int,
|
||||
friends: int,
|
||||
}
|
||||
|
||||
// Privacy & Safety.
|
||||
export struct PrivacyForm {
|
||||
// 0 hide, 1 show flagged.
|
||||
block-mode: int,
|
||||
// everyone, friends, nobody.
|
||||
messages: int,
|
||||
pokes: int,
|
||||
}
|
||||
|
||||
// A server's gateway (Integrations page).
|
||||
export struct GatewayItem {
|
||||
session: int,
|
||||
server: string,
|
||||
url: string,
|
||||
// "connected", "connecting", "off"
|
||||
status: string,
|
||||
features: [string],
|
||||
admin: bool,
|
||||
}
|
||||
|
||||
// A gateway configuration key (gateway administration).
|
||||
export struct ConfigItem {
|
||||
key: string,
|
||||
// JSON.
|
||||
value: string,
|
||||
source: string,
|
||||
description: string,
|
||||
kind: string,
|
||||
bootstrap: bool,
|
||||
}
|
||||
|
||||
// A gateway permission rule.
|
||||
export struct PermItem {
|
||||
action: string,
|
||||
// "Everyone", "Server groups 6, 7", "Default: server admins".
|
||||
rule: string,
|
||||
source: string,
|
||||
everyone: bool,
|
||||
server-groups: string,
|
||||
channel-groups: string,
|
||||
}
|
||||
|
||||
// A video encoder backend (Integrations page).
|
||||
export struct EncoderItem {
|
||||
name: string,
|
||||
api: string,
|
||||
codec: string,
|
||||
hardware: bool,
|
||||
ok: bool,
|
||||
// Why it does not work, or "used first".
|
||||
status: string,
|
||||
}
|
||||
|
||||
// Any registered setting (Advanced page).
|
||||
export struct SettingItem {
|
||||
key: string,
|
||||
doc: string,
|
||||
// JSON.
|
||||
value: string,
|
||||
// "set here", "command line", "config file", "default".
|
||||
source: string,
|
||||
}
|
||||
|
||||
// A recording or clip of the Stream Studio (Library).
|
||||
export struct RecordingItem {
|
||||
name: string,
|
||||
// "12.3 MB · 3 Oct 18:04".
|
||||
detail: string,
|
||||
clip: bool,
|
||||
path: string,
|
||||
}
|
||||
|
||||
// Encoders, chat history, cache and logs (Advanced page); numbers as typed.
|
||||
export struct AdvancedForm {
|
||||
encoder: string,
|
||||
hardware: bool,
|
||||
store-history: bool,
|
||||
history-page: string,
|
||||
dedupe-ms: string,
|
||||
retention-days: string,
|
||||
cache-mb: string,
|
||||
fetch-images: bool,
|
||||
progress-ms: string,
|
||||
// `ui.image_preview_kb`.
|
||||
preview-kb: string,
|
||||
logs: string,
|
||||
crash-dir: string,
|
||||
}
|
||||
|
||||
// Who we are (My Account page).
|
||||
export struct AccountForm {
|
||||
nickname: string,
|
||||
identity: string,
|
||||
uid: string,
|
||||
uid6: string,
|
||||
level: int,
|
||||
server: string,
|
||||
}
|
||||
|
||||
export global Bridge {
|
||||
in property <[ServerItem]> servers;
|
||||
in-out property <int> current-server: -1;
|
||||
@@ -508,6 +937,166 @@ export global Bridge {
|
||||
callback delete-crash-reports();
|
||||
callback dismiss-crash-notice();
|
||||
callback open-about();
|
||||
|
||||
// Home, friends, direct messages, notifications, search, events and
|
||||
// the settings pages.
|
||||
|
||||
// Home: friends online first, live streams on our servers, the latest
|
||||
// chats, what friends do, events and server news, the Library.
|
||||
in property <[ContactItem]> friends-online;
|
||||
in property <[LiveItem]> live-rooms;
|
||||
in property <[ConversationItem]> recent-chats;
|
||||
in property <[ContactItem]> friend-activity;
|
||||
in property <[HappeningItem]> happenings;
|
||||
in property <[RecordingItem]> recordings;
|
||||
in property <string> recordings-dir;
|
||||
callback open-conversation(int);
|
||||
// The messages page and the Library were opened.
|
||||
callback open-messages();
|
||||
callback open-library();
|
||||
callback watch-live(int, string);
|
||||
callback open-happening(int);
|
||||
callback open-recording(string);
|
||||
callback open-recordings-folder();
|
||||
// Connect a bookmark with voice (the Join buttons).
|
||||
callback connect-server(int);
|
||||
|
||||
// Friends: the contacts (friends, then the others), the selected one.
|
||||
in property <[ContactItem]> contacts;
|
||||
in property <ContactItem> contact;
|
||||
in property <int> contacts-online;
|
||||
in property <int> contacts-all;
|
||||
in property <int> contacts-blocked;
|
||||
callback friends-tab(int);
|
||||
callback search-contacts(string);
|
||||
callback select-contact(string);
|
||||
// "message", "poke", "join", "watch", "friend", "block", "neutral",
|
||||
// "remove", "mute".
|
||||
callback contact-action(string, string);
|
||||
callback contact-note(string, string);
|
||||
callback contact-volume(string, float);
|
||||
|
||||
// Direct messages: the conversations, the open one (its messages are
|
||||
// `messages` while a session holds it, else `dm-messages`).
|
||||
in property <[ConversationItem]> conversations;
|
||||
in property <int> dm-unread;
|
||||
in property <int> inbox-unread;
|
||||
in property <DmPeer> dm;
|
||||
in property <[ChatLine]> dm-messages;
|
||||
callback dm-tab(int);
|
||||
callback search-conversations(string);
|
||||
// "poke", "join", "friend", "block", "mute", "connect", "delete-mail",
|
||||
// "unread-mail".
|
||||
callback dm-action(string);
|
||||
callback dm-volume(float);
|
||||
callback send-offline(OfflineForm);
|
||||
|
||||
// The bell.
|
||||
in property <[NoticeItem]> notifications;
|
||||
in property <int> notifications-unread;
|
||||
callback open-notice(int);
|
||||
callback mark-notices-read();
|
||||
callback clear-notices();
|
||||
|
||||
// The search (Ctrl+K): `search` fills the results.
|
||||
in property <[SearchItem]> search-results;
|
||||
callback search-activate(int);
|
||||
|
||||
// A server's events (gateway `events`).
|
||||
in property <bool> has-events;
|
||||
in property <[EventItem]> events;
|
||||
in property <bool> events-loading;
|
||||
in property <bool> can-create-events;
|
||||
in property <[string]> event-channels;
|
||||
callback open-events();
|
||||
callback rsvp(int, string);
|
||||
callback toggle-event(int);
|
||||
callback edit-event(int) -> EventForm;
|
||||
callback save-event(EventForm) -> string;
|
||||
callback delete-event(int);
|
||||
callback watch-event(int);
|
||||
|
||||
// A picture linked in chat, opened larger: the message and the link.
|
||||
callback open-preview(int, int) -> image;
|
||||
|
||||
// Settings pages: a section was shown (its data is loaded then).
|
||||
callback settings-section(int);
|
||||
in property <AccountForm> account;
|
||||
in property <[IdentityItem]> identities;
|
||||
in property <[string]> identity-names;
|
||||
in property <[BookmarkIdentity]> bookmark-identities;
|
||||
in property <[FoundIdentity]> found-identities;
|
||||
in property <string> identity-status;
|
||||
// "default", "delete", "export", "improve", "stop".
|
||||
callback identity-action(int, string);
|
||||
callback rename-identity(int, string);
|
||||
callback improve-target(int, int);
|
||||
callback find-identities();
|
||||
callback pick-found(int, bool);
|
||||
callback import-identities();
|
||||
callback bookmark-identity(int, int);
|
||||
|
||||
in-out property <VideoForm> video;
|
||||
in property <[string]> cameras;
|
||||
in property <image> camera-frame;
|
||||
in property <string> camera-status;
|
||||
callback video-changed(VideoForm);
|
||||
callback toggle-camera-preview();
|
||||
callback test-sound();
|
||||
|
||||
in-out property <StreamingForm> streaming;
|
||||
in property <[LayerItem]> layers;
|
||||
in property <[AudioSourceItem]> audio-sources;
|
||||
// Applications that play audio now (for an app source).
|
||||
in property <[string]> audio-apps;
|
||||
in property <bool> has-studio;
|
||||
callback streaming-changed(StreamingForm);
|
||||
callback layer-changed(int, LayerItem);
|
||||
callback add-layer();
|
||||
callback remove-layer(int);
|
||||
callback audio-source-changed(int, AudioSourceItem);
|
||||
callback add-audio-source(string, string);
|
||||
callback remove-audio-source(int);
|
||||
|
||||
in-out property <NotifyForm> notify;
|
||||
callback notify-changed(NotifyForm);
|
||||
callback test-notification();
|
||||
|
||||
in-out property <PrivacyForm> privacy;
|
||||
in property <[ContactItem]> blocked;
|
||||
callback privacy-changed(PrivacyForm);
|
||||
|
||||
in property <[GatewayItem]> gateways;
|
||||
// The gateway being administered (-1: none) and its keys and rules.
|
||||
in property <int> admin-session: -1;
|
||||
in property <[ConfigItem]> gateway-config;
|
||||
in property <[PermItem]> gateway-perms;
|
||||
in property <string> ffmpeg-status;
|
||||
in property <string> zero-copy-status;
|
||||
in property <[EncoderItem]> encoders;
|
||||
in property <bool> encoders-loading;
|
||||
callback gateway-admin(int);
|
||||
callback config-set(string, string);
|
||||
callback config-reset(string);
|
||||
callback config-reload();
|
||||
callback perm-set(string, bool, string, string);
|
||||
callback perm-reset(string);
|
||||
callback refresh-encoders();
|
||||
|
||||
in-out property <AdvancedForm> advanced;
|
||||
// `stream.srtp_profiles` in order, and those left out.
|
||||
in property <[string]> srtp-profiles;
|
||||
in property <[string]> srtp-unused;
|
||||
in property <[SettingItem]> all-settings;
|
||||
in property <[string]> capture-sources;
|
||||
callback advanced-changed(AdvancedForm);
|
||||
callback srtp-move(int, int);
|
||||
callback srtp-toggle(string);
|
||||
// A key's JSON value: "" when taken, else why not.
|
||||
callback setting-set(string, string) -> string;
|
||||
callback setting-reset(string);
|
||||
callback search-settings(string);
|
||||
callback open-logs();
|
||||
}
|
||||
|
||||
// Decoded images by key, from Rust's image cache (src/images.rs): each is
|
||||
|
||||
@@ -115,6 +115,39 @@ export global Icons {
|
||||
out property <image> volume-2: @image-url("assets/icons/volume-2.svg");
|
||||
out property <image> volume-x: @image-url("assets/icons/volume-x.svg");
|
||||
out property <image> x: @image-url("assets/icons/x.svg");
|
||||
// Home, friends, messages, events and the settings pages (from
|
||||
// lucide-react 0.563.0, the same ISC icons).
|
||||
out property <image> arrow-down: @image-url("assets/icons/arrow-down.svg");
|
||||
out property <image> arrow-up: @image-url("assets/icons/arrow-up.svg");
|
||||
out property <image> ban: @image-url("assets/icons/ban.svg");
|
||||
out property <image> bell-ring: @image-url("assets/icons/bell-ring.svg");
|
||||
out property <image> calendar-days: @image-url("assets/icons/calendar-days.svg");
|
||||
out property <image> calendar-plus: @image-url("assets/icons/calendar-plus.svg");
|
||||
out property <image> circle-check: @image-url("assets/icons/circle-check.svg");
|
||||
out property <image> circle-x: @image-url("assets/icons/circle-x.svg");
|
||||
out property <image> clapperboard: @image-url("assets/icons/clapperboard.svg");
|
||||
out property <image> cpu: @image-url("assets/icons/cpu.svg");
|
||||
out property <image> film: @image-url("assets/icons/film.svg");
|
||||
out property <image> flask-conical: @image-url("assets/icons/flask-conical.svg");
|
||||
out property <image> folder: @image-url("assets/icons/folder.svg");
|
||||
out property <image> gauge: @image-url("assets/icons/gauge.svg");
|
||||
out property <image> id-card: @image-url("assets/icons/id-card.svg");
|
||||
out property <image> inbox: @image-url("assets/icons/inbox.svg");
|
||||
out property <image> key-round: @image-url("assets/icons/key-round.svg");
|
||||
out property <image> layers: @image-url("assets/icons/layers.svg");
|
||||
out property <image> mail: @image-url("assets/icons/mail.svg");
|
||||
out property <image> megaphone: @image-url("assets/icons/megaphone.svg");
|
||||
out property <image> message-square-plus: @image-url("assets/icons/message-square-plus.svg");
|
||||
out property <image> plug: @image-url("assets/icons/plug.svg");
|
||||
out property <image> rotate-ccw: @image-url("assets/icons/rotate-ccw.svg");
|
||||
out property <image> scroll-text: @image-url("assets/icons/scroll-text.svg");
|
||||
out property <image> upload: @image-url("assets/icons/upload.svg");
|
||||
out property <image> user-check: @image-url("assets/icons/user-check.svg");
|
||||
out property <image> user-cog: @image-url("assets/icons/user-cog.svg");
|
||||
out property <image> user-round: @image-url("assets/icons/user-round.svg");
|
||||
out property <image> user-x: @image-url("assets/icons/user-x.svg");
|
||||
out property <image> wand-sparkles: @image-url("assets/icons/wand-sparkles.svg");
|
||||
out property <image> zap: @image-url("assets/icons/zap.svg");
|
||||
// The app mark (full colour, not for colorize).
|
||||
out property <image> logo: @image-url("assets/logo.svg");
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
// navigate through these functions; Rust sets the same properties for the
|
||||
// development switch VOELIN_OPEN (src/dev.rs).
|
||||
|
||||
import { Bridge, BookmarkForm, ShareForm } from "bridge.slint";
|
||||
import { Bridge, BookmarkForm, ShareForm, EventForm, OfflineForm } from "bridge.slint";
|
||||
|
||||
export enum Page {
|
||||
// Welcome page: servers at a glance.
|
||||
@@ -10,15 +10,29 @@ export enum Page {
|
||||
// A server: channels, chat or the stream viewer, members and streams.
|
||||
server,
|
||||
settings,
|
||||
// Contacts and where they are.
|
||||
friends,
|
||||
// Direct messages across servers.
|
||||
messages,
|
||||
// Recordings and clips.
|
||||
library,
|
||||
// A server's scheduled events (gateway `events`).
|
||||
events,
|
||||
}
|
||||
|
||||
// Sections of the settings page, in the order of its navigation.
|
||||
// Sections of the settings page (`settings-section` takes these numbers).
|
||||
export enum SettingsSection {
|
||||
voice,
|
||||
keybinds,
|
||||
streaming,
|
||||
privacy,
|
||||
appearance,
|
||||
account,
|
||||
profiles,
|
||||
devices,
|
||||
notifications,
|
||||
integrations,
|
||||
advanced,
|
||||
}
|
||||
|
||||
// Tabs of the bottom navigation in the narrow (mobile) layout.
|
||||
@@ -38,10 +52,10 @@ export global Nav {
|
||||
// `ui.narrow_breakpoint`.
|
||||
in-out property <bool> narrow: false;
|
||||
in-out property <length> narrow-breakpoint: 800px;
|
||||
// Wide enough for a third column (home, direct messages).
|
||||
in-out property <bool> wide: true;
|
||||
in-out property <bool> right-panel-open: true;
|
||||
in-out property <length> right-panel-width: 280px;
|
||||
// Incremented to focus the search field (Ctrl+K).
|
||||
in-out property <int> search-requests;
|
||||
// The voice channel we are in (people, streams, its chat) instead of
|
||||
// the plain chat.
|
||||
in-out property <bool> voice-view: false;
|
||||
@@ -66,6 +80,25 @@ export global Nav {
|
||||
in-out property <BookmarkForm> bookmark-form;
|
||||
in-out property <ShareForm> share-form;
|
||||
|
||||
// The bell's panel, the search (Ctrl+K) and its selected result, a
|
||||
// picture opened from the chat, the event and offline message forms,
|
||||
// the friends page's tab, the direct messages' tab, the add-server
|
||||
// dialog in "join" mode (connect once saved).
|
||||
in-out property <bool> notifications-open;
|
||||
in-out property <bool> search-open;
|
||||
in-out property <string> search-text;
|
||||
in-out property <int> search-index;
|
||||
in-out property <bool> lightbox-open;
|
||||
in-out property <image> lightbox;
|
||||
in-out property <bool> event-form-open;
|
||||
in-out property <EventForm> event-form;
|
||||
in-out property <string> event-error;
|
||||
in-out property <bool> offline-form-open;
|
||||
in-out property <OfflineForm> offline-form;
|
||||
in-out property <int> friends-tab;
|
||||
in-out property <int> dm-tab;
|
||||
in-out property <bool> join-open;
|
||||
|
||||
// Settings were opened (so leaving them tells Rust).
|
||||
property <bool> settings-active;
|
||||
|
||||
@@ -75,6 +108,16 @@ export global Nav {
|
||||
Bridge.close-settings();
|
||||
}
|
||||
page = p;
|
||||
notifications-open = false;
|
||||
if p == Page.events {
|
||||
Bridge.open-events();
|
||||
}
|
||||
if p == Page.messages {
|
||||
Bridge.open-messages();
|
||||
}
|
||||
if p == Page.library {
|
||||
Bridge.open-library();
|
||||
}
|
||||
}
|
||||
|
||||
public function open-settings(section: SettingsSection) {
|
||||
@@ -84,6 +127,66 @@ export global Nav {
|
||||
}
|
||||
settings-section = section;
|
||||
page = Page.settings;
|
||||
notifications-open = false;
|
||||
Bridge.settings-section(section == SettingsSection.voice ? 0
|
||||
: section == SettingsSection.keybinds ? 1
|
||||
: section == SettingsSection.streaming ? 2
|
||||
: section == SettingsSection.privacy ? 3
|
||||
: section == SettingsSection.appearance ? 4
|
||||
: section == SettingsSection.account ? 5
|
||||
: section == SettingsSection.profiles ? 6
|
||||
: section == SettingsSection.devices ? 7
|
||||
: section == SettingsSection.notifications ? 8
|
||||
: section == SettingsSection.integrations ? 9 : 10);
|
||||
}
|
||||
|
||||
public function open-search(text: string) {
|
||||
search-text = text;
|
||||
search-index = 0;
|
||||
search-open = true;
|
||||
notifications-open = false;
|
||||
Bridge.search(text);
|
||||
}
|
||||
|
||||
public function close-search() {
|
||||
search-open = false;
|
||||
search-text = "";
|
||||
}
|
||||
|
||||
public function open-picture(key: int, index: int) {
|
||||
lightbox = Bridge.open-preview(key, index);
|
||||
lightbox-open = true;
|
||||
}
|
||||
|
||||
public function create-event() {
|
||||
event-form = Bridge.edit-event(-1);
|
||||
event-error = "";
|
||||
event-form-open = true;
|
||||
}
|
||||
|
||||
public function edit-event(id: int) {
|
||||
event-form = Bridge.edit-event(id);
|
||||
event-error = "";
|
||||
event-form-open = true;
|
||||
}
|
||||
|
||||
public function write-offline(uid: string, to: string) {
|
||||
offline-form = { uid: uid, to: to, subject: "", text: "" };
|
||||
offline-form-open = true;
|
||||
}
|
||||
|
||||
public function join-server() {
|
||||
bookmark-form = Bridge.edit-bookmark(-1);
|
||||
join-open = true;
|
||||
bookmark-open = true;
|
||||
}
|
||||
|
||||
// The members panel of the current server.
|
||||
public function show-members() {
|
||||
show(Page.server);
|
||||
pins-open = false;
|
||||
topics-open = false;
|
||||
right-panel-open = true;
|
||||
}
|
||||
|
||||
public function close-settings() {
|
||||
@@ -102,11 +205,13 @@ export global Nav {
|
||||
|
||||
public function add-server() {
|
||||
bookmark-form = Bridge.edit-bookmark(-1);
|
||||
join-open = false;
|
||||
bookmark-open = true;
|
||||
}
|
||||
|
||||
public function edit-server(id: int) {
|
||||
bookmark-form = Bridge.edit-bookmark(id);
|
||||
join-open = false;
|
||||
bookmark-open = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -457,12 +457,15 @@ export component MessageList inherits VerticalLayout {
|
||||
export component Composer inherits HorizontalLayout {
|
||||
in property <string> placeholder;
|
||||
in property <bool> topic;
|
||||
// Files can be attached (channel chats).
|
||||
in property <bool> attach: true;
|
||||
in property <bool> enabled: true;
|
||||
padding: Theme.space-4;
|
||||
padding-left: Theme.space-5;
|
||||
padding-right: Theme.space-5;
|
||||
spacing: Theme.space-3;
|
||||
// Files go to the channel's file browser and a link into the chat.
|
||||
if !root.topic: IconButton {
|
||||
if !root.topic && root.attach: IconButton {
|
||||
icon: Icons.plus;
|
||||
label: @tr("Attach a file");
|
||||
round: true;
|
||||
@@ -485,6 +488,7 @@ export component Composer inherits HorizontalLayout {
|
||||
input := TextField {
|
||||
text <=> Nav.draft;
|
||||
bare: true;
|
||||
enabled: root.enabled;
|
||||
placeholder: root.placeholder;
|
||||
label: @tr("Message");
|
||||
accepted(text) => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Theme } from "../theme.slint";
|
||||
import { Icons } from "../icons.slint";
|
||||
import { Bridge, BookmarkForm, ShareForm } from "../bridge.slint";
|
||||
import { Nav } from "../nav.slint";
|
||||
import { Nav, Page } from "../nav.slint";
|
||||
import { Icon, Button, ButtonKind, IconButton, TextField, Field, Select, Toggle, ToggleRow, Slider, Modal, Card, Chip, Banner, Avatar, Status, ListView, ScrollView } from "../components/index.slint";
|
||||
import { AboutSlint } from "std-widgets.slint";
|
||||
|
||||
@@ -15,8 +15,10 @@ component Footer inherits HorizontalLayout {
|
||||
|
||||
export component BookmarkDialog inherits Modal {
|
||||
in-out property <BookmarkForm> form;
|
||||
// Join by address: connect once saved.
|
||||
in property <bool> join;
|
||||
callback done();
|
||||
title: form.id < 0 ? @tr("Add server") : @tr("Edit server");
|
||||
title: join ? @tr("Join a server") : form.id < 0 ? @tr("Add server") : @tr("Edit server");
|
||||
subtitle: @tr("TeamSpeak 3 or 6 server address and your nickname there.");
|
||||
icon: Icons.server;
|
||||
card-width: 560px;
|
||||
@@ -102,10 +104,15 @@ export component BookmarkDialog inherits Modal {
|
||||
}
|
||||
Button {
|
||||
kind: ButtonKind.primary;
|
||||
text: @tr("Save");
|
||||
icon: root.join ? Icons.log-in : Icons.check;
|
||||
text: root.join ? @tr("Save and connect") : @tr("Save");
|
||||
enabled: form.address != "" && form.nickname != "";
|
||||
clicked => {
|
||||
Bridge.save-bookmark(form);
|
||||
if root.join {
|
||||
Bridge.connect-voice();
|
||||
Nav.show(Page.server);
|
||||
}
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,444 @@
|
||||
// A server's scheduled events (gateway `events`): the list with answers
|
||||
// (going, maybe, not going), who answered, reminders, scheduled streams;
|
||||
// creating, editing and deleting them. Also the entries above the channel
|
||||
// tree that lead here and to the members (design mockup 03).
|
||||
|
||||
import { Theme } from "../theme.slint";
|
||||
import { Icons } from "../icons.slint";
|
||||
import { Bridge, EventItem, EventForm } from "../bridge.slint";
|
||||
import { Nav, Page } from "../nav.slint";
|
||||
import { Icon, Button, ButtonKind, IconButton, Chip, LiveBadge, NavItem, TextField, Field, Select, Toggle, ToggleRow, Modal, Divider, Banner, ScrollView } from "../components/index.slint";
|
||||
|
||||
// Events and Members above the channel tree.
|
||||
export component ServerLinks inherits VerticalLayout {
|
||||
spacing: Theme.space-1;
|
||||
if Bridge.has-events: NavItem {
|
||||
icon: Icons.calendar-days;
|
||||
text: @tr("Events");
|
||||
selected: Nav.page == Page.events;
|
||||
clicked => { Nav.show(Page.events); }
|
||||
}
|
||||
NavItem {
|
||||
icon: Icons.users;
|
||||
text: @tr("Members");
|
||||
selected: Nav.page == Page.server && Nav.right-panel-open && !Nav.pins-open && !Nav.topics-open;
|
||||
clicked => { Nav.show-members(); }
|
||||
}
|
||||
}
|
||||
|
||||
// One answer button: "Going · 12".
|
||||
component RsvpButton inherits Rectangle {
|
||||
in property <string> text;
|
||||
in property <int> count;
|
||||
in property <bool> chosen;
|
||||
in property <color> tone: Theme.accent;
|
||||
callback clicked();
|
||||
height: 32px;
|
||||
width: row.preferred-width + 24px;
|
||||
border-radius: Theme.radius-pill;
|
||||
background: chosen ? tone.transparentize(0.7) : touch.has-hover ? Theme.surface-3 : Theme.surface-2;
|
||||
border-width: 1px;
|
||||
border-color: chosen ? tone : Theme.border-strong;
|
||||
accessible-role: AccessibleRole.button;
|
||||
accessible-label: text;
|
||||
accessible-checkable: true;
|
||||
accessible-checked: chosen;
|
||||
accessible-action-default => { clicked(); }
|
||||
touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => { root.clicked(); }
|
||||
}
|
||||
row := HorizontalLayout {
|
||||
alignment: center;
|
||||
spacing: Theme.space-2;
|
||||
if root.chosen: Icon {
|
||||
source: Icons.check;
|
||||
size: 14px;
|
||||
tint: root.tone;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: root.text;
|
||||
color: root.chosen ? Theme.text : Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
font-weight: Theme.weight-medium;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
Text {
|
||||
text: root.count;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// One event as a card.
|
||||
component EventCard inherits Rectangle {
|
||||
in property <EventItem> event;
|
||||
border-radius: Theme.radius-lg;
|
||||
background: Theme.surface-2.transparentize(0.25);
|
||||
border-width: 1px;
|
||||
border-color: event.live ? Theme.live : event.expanded ? Theme.accent : Theme.border;
|
||||
accessible-role: AccessibleRole.groupbox;
|
||||
accessible-label: event.title;
|
||||
HorizontalLayout {
|
||||
padding: Theme.space-4;
|
||||
spacing: Theme.space-4;
|
||||
// The date block.
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
Rectangle {
|
||||
width: 64px;
|
||||
height: 72px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: Theme.accent-soft;
|
||||
border-width: 1px;
|
||||
border-color: Theme.accent.transparentize(0.5);
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Text {
|
||||
text: root.event.weekday;
|
||||
color: Theme.accent-text;
|
||||
font-size: Theme.font-xs;
|
||||
font-weight: Theme.weight-semibold;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
Text {
|
||||
text: root.event.day;
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-2xl;
|
||||
font-weight: Theme.weight-bold;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
Text {
|
||||
text: root.event.month;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-xs;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
horizontal-stretch: 1;
|
||||
spacing: Theme.space-2;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
alignment: start;
|
||||
Text {
|
||||
text: root.event.title;
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-lg;
|
||||
font-weight: Theme.weight-semibold;
|
||||
overflow: elide;
|
||||
}
|
||||
if root.event.live: LiveBadge {
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
if root.event.stream != "" && !root.event.live: Chip {
|
||||
text: @tr("Stream");
|
||||
icon: Icons.radio;
|
||||
tint: Theme.live;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
if root.event.soon != "": Chip {
|
||||
text: root.event.soon;
|
||||
icon: Icons.clock;
|
||||
tint: Theme.warning;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-4;
|
||||
alignment: start;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Icon {
|
||||
source: Icons.clock;
|
||||
size: 14px;
|
||||
tint: Theme.text-muted;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: root.event.when;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Icon {
|
||||
source: Icons.hash;
|
||||
size: 14px;
|
||||
tint: Theme.text-muted;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: root.event.place;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
}
|
||||
}
|
||||
}
|
||||
if root.event.stream != "": HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Icon {
|
||||
source: Icons.monitor;
|
||||
size: 14px;
|
||||
tint: Theme.live;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: root.event.stream;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
if root.event.description != "": Text {
|
||||
text: root.event.description;
|
||||
color: Theme.text-secondary;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
alignment: start;
|
||||
RsvpButton {
|
||||
text: @tr("Going");
|
||||
count: root.event.going;
|
||||
chosen: root.event.rsvp == "going";
|
||||
tone: Theme.success;
|
||||
clicked => { Bridge.rsvp(root.event.id, root.event.rsvp == "going" ? "" : "going"); }
|
||||
}
|
||||
RsvpButton {
|
||||
text: @tr("Maybe");
|
||||
count: root.event.maybe;
|
||||
chosen: root.event.rsvp == "maybe";
|
||||
tone: Theme.warning;
|
||||
clicked => { Bridge.rsvp(root.event.id, root.event.rsvp == "maybe" ? "" : "maybe"); }
|
||||
}
|
||||
RsvpButton {
|
||||
text: @tr("Not going");
|
||||
count: root.event.not-going;
|
||||
chosen: root.event.rsvp == "not_going";
|
||||
tone: Theme.danger;
|
||||
clicked => { Bridge.rsvp(root.event.id, root.event.rsvp == "not_going" ? "" : "not_going"); }
|
||||
}
|
||||
Rectangle {
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
if root.event.live: Button {
|
||||
small: true;
|
||||
kind: ButtonKind.primary;
|
||||
icon: Icons.monitor;
|
||||
text: @tr("Watch");
|
||||
clicked => { Bridge.watch-event(root.event.id); }
|
||||
}
|
||||
Button {
|
||||
small: true;
|
||||
kind: ButtonKind.ghost;
|
||||
icon: root.event.expanded ? Icons.chevron-up : Icons.users;
|
||||
text: root.event.expanded ? @tr("Hide") : @tr("Who answered");
|
||||
clicked => { Bridge.toggle-event(root.event.id); }
|
||||
}
|
||||
if root.event.editable: IconButton {
|
||||
icon: Icons.pencil;
|
||||
label: @tr("Edit {}", root.event.title);
|
||||
size: 30px;
|
||||
icon-size: Theme.icon-sm;
|
||||
clicked => { Nav.edit-event(root.event.id); }
|
||||
}
|
||||
if root.event.editable: IconButton {
|
||||
icon: Icons.trash-2;
|
||||
label: @tr("Delete {}", root.event.title);
|
||||
size: 30px;
|
||||
icon-size: Theme.icon-sm;
|
||||
tint: Theme.danger;
|
||||
clicked => { Bridge.delete-event(root.event.id); }
|
||||
}
|
||||
}
|
||||
if root.event.expanded: VerticalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Divider { }
|
||||
Text {
|
||||
text: root.event.attendees.length == 0 ? @tr("No answers yet.") : @tr("Answers");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
}
|
||||
FlexboxLayout {
|
||||
spacing: Theme.space-2;
|
||||
for person in root.event.attendees: Chip {
|
||||
text: person;
|
||||
icon: Icons.user;
|
||||
outlined: true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: @tr("Created by {}", root.event.creator);
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The events of the current server.
|
||||
export component EventsPage inherits VerticalLayout {
|
||||
in property <bool> compact;
|
||||
padding: compact ? Theme.space-4 : Theme.space-6;
|
||||
spacing: Theme.space-4;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-4;
|
||||
Icon {
|
||||
source: Icons.calendar-days;
|
||||
size: 30px;
|
||||
tint: Theme.accent-text;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
Text {
|
||||
text: @tr("Events");
|
||||
font-size: Theme.font-2xl;
|
||||
font-weight: Theme.weight-bold;
|
||||
color: Theme.text;
|
||||
}
|
||||
Text {
|
||||
text: @tr("Scheduled on {}", Bridge.server-title);
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
if Bridge.can-create-events: Button {
|
||||
kind: ButtonKind.primary;
|
||||
icon: Icons.calendar-plus;
|
||||
text: @tr("Create Event");
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.create-event(); }
|
||||
}
|
||||
}
|
||||
if !Bridge.has-events: Banner {
|
||||
text: @tr("This server's gateway does not keep events (or there is no gateway).");
|
||||
icon: Icons.info;
|
||||
tone: Theme.info;
|
||||
}
|
||||
if Bridge.has-events && Bridge.events.length == 0: Text {
|
||||
text: Bridge.events-loading ? @tr("Loading events…") : @tr("Nothing scheduled. Create an event to invite people, or schedule a stream.");
|
||||
color: Theme.text-muted;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
sv := ScrollView {
|
||||
vertical-stretch: 1;
|
||||
VerticalLayout {
|
||||
width: sv.visible-width - Theme.space-2;
|
||||
spacing: Theme.space-3;
|
||||
alignment: start;
|
||||
for event in Bridge.events: EventCard {
|
||||
event: event;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create or edit an event.
|
||||
export component EventDialog inherits Modal {
|
||||
in-out property <EventForm> form;
|
||||
callback done();
|
||||
title: form.id < 0 ? @tr("Create Event") : @tr("Edit Event");
|
||||
subtitle: @tr("Everyone on {} can see it and answer.", Bridge.server-title);
|
||||
icon: Icons.calendar-plus;
|
||||
card-width: 560px;
|
||||
card-height: 660px;
|
||||
dismissed => { done(); }
|
||||
ScrollView {
|
||||
vertical-stretch: 1;
|
||||
VerticalLayout {
|
||||
spacing: Theme.space-4;
|
||||
padding-right: Theme.space-3;
|
||||
Field {
|
||||
label: @tr("Title");
|
||||
TextField { text <=> form.title; placeholder: @tr("Raid night"); label: @tr("Title"); }
|
||||
}
|
||||
Field {
|
||||
label: @tr("Description");
|
||||
TextField { text <=> form.description; placeholder: @tr("What happens, what to bring"); label: @tr("Description"); }
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-4;
|
||||
Field {
|
||||
label: @tr("Starts");
|
||||
hint: @tr("YYYY-MM-DD HH:MM, local time");
|
||||
TextField { text <=> form.start; placeholder: "2026-10-04 19:00"; icon: Icons.calendar; label: @tr("Starts"); }
|
||||
}
|
||||
Field {
|
||||
label: @tr("Ends (optional)");
|
||||
TextField { text <=> form.end; placeholder: "2026-10-04 21:00"; icon: Icons.clock; label: @tr("Ends"); }
|
||||
}
|
||||
}
|
||||
Field {
|
||||
label: @tr("Where");
|
||||
Select {
|
||||
model: Bridge.event-channels;
|
||||
current-index <=> form.channel;
|
||||
icon: Icons.hash;
|
||||
label: @tr("Channel");
|
||||
}
|
||||
}
|
||||
ToggleRow {
|
||||
icon: Icons.radio;
|
||||
text: @tr("A scheduled stream");
|
||||
description: @tr("Linked to the stream directory once the host goes live.");
|
||||
checked <=> form.stream;
|
||||
}
|
||||
if form.stream: HorizontalLayout {
|
||||
spacing: Theme.space-4;
|
||||
Field {
|
||||
label: @tr("Stream title");
|
||||
TextField { text <=> form.stream-title; label: @tr("Stream title"); }
|
||||
}
|
||||
Field {
|
||||
label: @tr("Game or subject");
|
||||
TextField { text <=> form.game; label: @tr("Game or subject"); }
|
||||
}
|
||||
}
|
||||
if Nav.event-error != "": Banner {
|
||||
text: Nav.event-error;
|
||||
tone: Theme.danger;
|
||||
}
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: end;
|
||||
spacing: Theme.space-3;
|
||||
if form.id >= 0: Button {
|
||||
kind: ButtonKind.danger;
|
||||
icon: Icons.trash-2;
|
||||
text: @tr("Delete");
|
||||
clicked => {
|
||||
Bridge.delete-event(form.id);
|
||||
done();
|
||||
}
|
||||
}
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
Button {
|
||||
text: @tr("Cancel");
|
||||
clicked => { done(); }
|
||||
}
|
||||
Button {
|
||||
kind: ButtonKind.primary;
|
||||
icon: Icons.check;
|
||||
text: form.id < 0 ? @tr("Create") : @tr("Save");
|
||||
enabled: form.title != "" && form.start != "";
|
||||
clicked => {
|
||||
Nav.event-error = Bridge.save-event(form);
|
||||
if Nav.event-error == "" {
|
||||
done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,443 @@
|
||||
// Friends: the contacts (friend, blocked or neutral), where each is now
|
||||
// (server, channel, away, streaming), and what can be done with them:
|
||||
// message, poke, join their channel, watch their stream, the relation, a
|
||||
// note, their volume.
|
||||
|
||||
import { Theme } from "../theme.slint";
|
||||
import { Icons } from "../icons.slint";
|
||||
import { Bridge, ContactItem } from "../bridge.slint";
|
||||
import { Nav, Page } from "../nav.slint";
|
||||
import { Icon, Button, ButtonKind, IconButton, Avatar, Status, Chip, LiveBadge, SegmentedTabs, SearchBox, TextField, Slider, Divider, Field, ListView, ScrollView } from "../components/index.slint";
|
||||
|
||||
// One contact: avatar, name, what they do and where, quick actions.
|
||||
component ContactRow inherits Rectangle {
|
||||
in property <ContactItem> person;
|
||||
height: 64px * Theme.font-scale;
|
||||
border-radius: Theme.radius-md;
|
||||
background: person.selected ? Theme.accent-soft : touch.has-hover ? Theme.surface-3 : transparent;
|
||||
border-width: person.selected ? 1px : 0px;
|
||||
border-color: Theme.accent;
|
||||
accessible-role: AccessibleRole.list-item;
|
||||
accessible-label: person.name;
|
||||
accessible-description: person.status;
|
||||
accessible-item-selectable: true;
|
||||
accessible-item-selected: person.selected;
|
||||
accessible-action-default => { Bridge.select-contact(person.uid); }
|
||||
touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => { Bridge.select-contact(root.person.uid); }
|
||||
double-clicked => { Bridge.contact-action(root.person.uid, "message"); }
|
||||
}
|
||||
opacity: person.relation == "blocked" ? 0.7 : 1.0;
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-3;
|
||||
padding-right: Theme.space-3;
|
||||
spacing: Theme.space-4;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Avatar {
|
||||
size: 44px;
|
||||
initials: root.person.initials;
|
||||
tint: root.person.tint;
|
||||
image: root.person.avatar;
|
||||
label: root.person.name;
|
||||
status: !root.person.online ? Status.offline : root.person.away ? Status.idle : Status.online;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
spacing: 1px;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
alignment: start;
|
||||
Text {
|
||||
text: root.person.name;
|
||||
color: root.person.relation == "friend" ? Theme.name-text : Theme.text;
|
||||
font-size: Theme.font-md;
|
||||
font-weight: Theme.weight-semibold;
|
||||
overflow: elide;
|
||||
}
|
||||
if root.person.relation == "blocked": Chip {
|
||||
text: @tr("Blocked");
|
||||
icon: Icons.ban;
|
||||
tint: Theme.danger;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
if root.person.streaming: LiveBadge {
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: root.person.status;
|
||||
color: root.person.online ? Theme.text-secondary : Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
overflow: elide;
|
||||
}
|
||||
if root.person.place != "": Text {
|
||||
text: root.person.place;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
if root.person.relation != "blocked": HorizontalLayout {
|
||||
spacing: Theme.space-1;
|
||||
IconButton {
|
||||
icon: Icons.message-square;
|
||||
label: @tr("Message {}", root.person.name);
|
||||
filled: true;
|
||||
round: true;
|
||||
size: 34px;
|
||||
icon-size: Theme.icon-sm;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.contact-action(root.person.uid, "message"); }
|
||||
}
|
||||
if root.person.reachable: IconButton {
|
||||
icon: Icons.hand;
|
||||
label: @tr("Poke {}", root.person.name);
|
||||
filled: true;
|
||||
round: true;
|
||||
size: 34px;
|
||||
icon-size: Theme.icon-sm;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.contact-action(root.person.uid, "poke"); }
|
||||
}
|
||||
if root.person.online: IconButton {
|
||||
icon: Icons.log-in;
|
||||
label: @tr("Join {}'s channel", root.person.name);
|
||||
filled: true;
|
||||
round: true;
|
||||
size: 34px;
|
||||
icon-size: Theme.icon-sm;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.contact-action(root.person.uid, "join"); }
|
||||
}
|
||||
if root.person.streaming: IconButton {
|
||||
icon: Icons.monitor;
|
||||
label: @tr("Watch {}'s stream", root.person.name);
|
||||
filled: true;
|
||||
round: true;
|
||||
size: 34px;
|
||||
icon-size: Theme.icon-sm;
|
||||
tint: Theme.live;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.contact-action(root.person.uid, "watch"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The contacts with tabs and a search.
|
||||
export component FriendsPage inherits VerticalLayout {
|
||||
in property <bool> compact;
|
||||
padding: compact ? Theme.space-4 : Theme.space-6;
|
||||
spacing: Theme.space-4;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-4;
|
||||
if !root.compact: Icon {
|
||||
source: Icons.users;
|
||||
size: 30px;
|
||||
tint: Theme.accent-text;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: @tr("Friends");
|
||||
font-size: Theme.font-2xl;
|
||||
font-weight: Theme.weight-bold;
|
||||
color: Theme.text;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
if !root.compact: SegmentedTabs {
|
||||
max-width: 420px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
model: [@tr("Online — {}", Bridge.contacts-online), @tr("All — {}", Bridge.contacts-all), @tr("Blocked — {}", Bridge.contacts-blocked)];
|
||||
current-index: Nav.friends-tab;
|
||||
label: @tr("Which contacts");
|
||||
selected(i) => {
|
||||
Nav.friends-tab = i;
|
||||
Bridge.friends-tab(i);
|
||||
}
|
||||
}
|
||||
if !root.compact: Rectangle {
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
if !root.compact: SearchBox {
|
||||
max-width: 280px;
|
||||
height: 38px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
show-shortcut: false;
|
||||
placeholder: @tr("Search contacts");
|
||||
label: @tr("Search contacts");
|
||||
edited(text) => { Bridge.search-contacts(text); }
|
||||
}
|
||||
}
|
||||
if root.compact: SegmentedTabs {
|
||||
model: [@tr("Online"), @tr("All"), @tr("Blocked")];
|
||||
current-index: Nav.friends-tab;
|
||||
label: @tr("Which contacts");
|
||||
selected(i) => {
|
||||
Nav.friends-tab = i;
|
||||
Bridge.friends-tab(i);
|
||||
}
|
||||
}
|
||||
if root.compact: SearchBox {
|
||||
height: 38px;
|
||||
show-shortcut: false;
|
||||
placeholder: @tr("Search contacts");
|
||||
label: @tr("Search contacts");
|
||||
edited(text) => { Bridge.search-contacts(text); }
|
||||
}
|
||||
if Bridge.contacts.length == 0: VerticalLayout {
|
||||
spacing: Theme.space-2;
|
||||
padding-top: Theme.space-6;
|
||||
alignment: start;
|
||||
Text {
|
||||
text: Nav.friends-tab == 0 ? @tr("None of your friends is online right now.")
|
||||
: Nav.friends-tab == 2 ? @tr("You have blocked no one.")
|
||||
: @tr("No contacts yet.");
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-lg;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
Text {
|
||||
text: @tr("Open a person's card in a server's members panel to add them as a friend or to block them. Friends show up here on every server they are on.");
|
||||
color: Theme.text-muted;
|
||||
wrap: word-wrap;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
padding-top: Theme.space-3;
|
||||
Button {
|
||||
icon: Icons.server;
|
||||
text: @tr("Go to a server");
|
||||
clicked => { Nav.show(Page.server); }
|
||||
}
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
vertical-stretch: 1;
|
||||
accessible-role: AccessibleRole.list;
|
||||
accessible-label: @tr("Contacts");
|
||||
for person in Bridge.contacts: VerticalLayout {
|
||||
padding-bottom: Theme.space-1;
|
||||
ContactRow {
|
||||
person: person;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Everything about the selected contact (the right panel).
|
||||
export component ContactPanel inherits Rectangle {
|
||||
property <ContactItem> c: Bridge.contact;
|
||||
sv := ScrollView {
|
||||
VerticalLayout {
|
||||
width: sv.visible-width;
|
||||
padding: Theme.space-5;
|
||||
spacing: Theme.space-4;
|
||||
alignment: start;
|
||||
HorizontalLayout {
|
||||
alignment: end;
|
||||
IconButton {
|
||||
icon: Icons.x;
|
||||
label: @tr("Close");
|
||||
size: 28px;
|
||||
icon-size: Theme.icon-sm;
|
||||
clicked => { Bridge.select-contact(""); }
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
Avatar {
|
||||
size: 84px;
|
||||
initials: root.c.initials;
|
||||
tint: root.c.tint;
|
||||
image: root.c.avatar;
|
||||
label: root.c.name;
|
||||
status: !root.c.online ? Status.offline : root.c.away ? Status.idle : Status.online;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
spacing: Theme.space-1;
|
||||
Text {
|
||||
text: root.c.name;
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-xl;
|
||||
font-weight: Theme.weight-semibold;
|
||||
horizontal-alignment: center;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: root.c.status;
|
||||
color: root.c.online ? Theme.success : Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
horizontal-alignment: center;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
spacing: Theme.space-2;
|
||||
if root.c.relation == "friend": Chip {
|
||||
text: @tr("Friend");
|
||||
icon: Icons.user-check;
|
||||
tint: Theme.success;
|
||||
}
|
||||
if root.c.relation == "blocked": Chip {
|
||||
text: @tr("Blocked");
|
||||
icon: Icons.ban;
|
||||
tint: Theme.danger;
|
||||
}
|
||||
if root.c.streaming: LiveBadge { }
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Button {
|
||||
horizontal-stretch: 1;
|
||||
small: true;
|
||||
icon: Icons.message-square;
|
||||
text: @tr("Message");
|
||||
enabled: root.c.relation != "blocked";
|
||||
clicked => { Bridge.contact-action(root.c.uid, "message"); }
|
||||
}
|
||||
Button {
|
||||
horizontal-stretch: 1;
|
||||
small: true;
|
||||
icon: Icons.hand;
|
||||
text: @tr("Poke");
|
||||
enabled: root.c.reachable;
|
||||
clicked => { Bridge.contact-action(root.c.uid, "poke"); }
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Button {
|
||||
horizontal-stretch: 1;
|
||||
small: true;
|
||||
icon: Icons.log-in;
|
||||
text: @tr("Join");
|
||||
enabled: root.c.online;
|
||||
clicked => { Bridge.contact-action(root.c.uid, "join"); }
|
||||
}
|
||||
Button {
|
||||
horizontal-stretch: 1;
|
||||
small: true;
|
||||
icon: Icons.monitor;
|
||||
text: @tr("Watch");
|
||||
enabled: root.c.streaming;
|
||||
clicked => { Bridge.contact-action(root.c.uid, "watch"); }
|
||||
}
|
||||
}
|
||||
Divider { }
|
||||
Text {
|
||||
text: root.c.online ? @tr("Where") : @tr("Last seen");
|
||||
color: Theme.text;
|
||||
font-weight: Theme.weight-semibold;
|
||||
}
|
||||
for spot in root.c.spots: HorizontalLayout {
|
||||
spacing: Theme.space-3;
|
||||
Icon {
|
||||
source: Icons.server;
|
||||
size: Theme.icon-sm;
|
||||
tint: Theme.text-secondary;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: spot;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
horizontal-stretch: 1;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
if root.c.spots.length == 0: Text {
|
||||
text: root.c.place != "" ? root.c.place : @tr("Not seen on your servers yet.");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
Divider { }
|
||||
Field {
|
||||
label: @tr("Note");
|
||||
hint: @tr("Only on this device. Press Enter to keep it.");
|
||||
TextField {
|
||||
text: root.c.note;
|
||||
placeholder: @tr("Add a note");
|
||||
icon: Icons.pencil;
|
||||
label: @tr("Note about {}", root.c.name);
|
||||
accepted(text) => { Bridge.contact-note(root.c.uid, text); }
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
spacing: Theme.space-2;
|
||||
HorizontalLayout {
|
||||
Text {
|
||||
text: @tr("Volume for me");
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
Text {
|
||||
text: @tr("{}%", round(root.c.volume));
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
IconButton {
|
||||
icon: root.c.muted ? Icons.volume-x : Icons.volume-2;
|
||||
label: root.c.muted ? @tr("Unmute for me") : @tr("Mute for me");
|
||||
checked: root.c.muted;
|
||||
danger: true;
|
||||
size: 30px;
|
||||
icon-size: Theme.icon-sm;
|
||||
clicked => { Bridge.contact-action(root.c.uid, "mute"); }
|
||||
}
|
||||
Slider {
|
||||
horizontal-stretch: 1;
|
||||
minimum: 0;
|
||||
maximum: 400;
|
||||
step: 5;
|
||||
value: root.c.volume;
|
||||
enabled: !root.c.muted;
|
||||
label: @tr("Volume of {}", root.c.name);
|
||||
released(v) => { Bridge.contact-volume(root.c.uid, v); }
|
||||
}
|
||||
}
|
||||
}
|
||||
Divider { }
|
||||
VerticalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Button {
|
||||
icon: root.c.relation == "friend" ? Icons.user-x : Icons.user-plus;
|
||||
text: root.c.relation == "friend" ? @tr("Remove friend") : @tr("Add friend");
|
||||
centered: false;
|
||||
clicked => { Bridge.contact-action(root.c.uid, root.c.relation == "friend" ? "neutral" : "friend"); }
|
||||
}
|
||||
Button {
|
||||
kind: root.c.relation == "blocked" ? ButtonKind.secondary : ButtonKind.danger;
|
||||
icon: Icons.ban;
|
||||
text: root.c.relation == "blocked" ? @tr("Unblock") : @tr("Block");
|
||||
centered: false;
|
||||
clicked => { Bridge.contact-action(root.c.uid, root.c.relation == "blocked" ? "neutral" : "block"); }
|
||||
}
|
||||
Button {
|
||||
kind: ButtonKind.ghost;
|
||||
icon: Icons.trash-2;
|
||||
text: @tr("Forget this contact");
|
||||
centered: false;
|
||||
clicked => { Bridge.contact-action(root.c.uid, "remove"); }
|
||||
}
|
||||
}
|
||||
if root.c.since != "": Text {
|
||||
text: root.c.since;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,679 @@
|
||||
// Direct messages (design mockup 02): the conversations of every server at
|
||||
// the left, the open one in the middle (the chat's message list and
|
||||
// composer; pokes show in it), who it is with at the right. TeamSpeak
|
||||
// delivers private messages only to people online on the same server; the
|
||||
// server keeps offline messages (mail) for the others.
|
||||
|
||||
import { Theme } from "../theme.slint";
|
||||
import { Icons } from "../icons.slint";
|
||||
import { Bridge, ConversationItem } from "../bridge.slint";
|
||||
import { Nav, Page } from "../nav.slint";
|
||||
import { Icon, Button, ButtonKind, IconButton, Avatar, Status, Chip, CountBadge, SearchBox, TextField, Field, Slider, Divider, Banner, Modal, PopupMenu, MenuEntry, ListView, ScrollView } from "../components/index.slint";
|
||||
import { MessageList, Composer } from "chat.slint";
|
||||
|
||||
// One conversation of the list.
|
||||
component ConversationRow inherits Rectangle {
|
||||
in property <ConversationItem> chat;
|
||||
height: 64px * Theme.font-scale;
|
||||
border-radius: Theme.radius-md;
|
||||
background: chat.selected ? Theme.accent-soft : touch.has-hover ? Theme.surface-3 : transparent;
|
||||
border-width: chat.selected ? 1px : 0px;
|
||||
border-color: Theme.accent;
|
||||
accessible-role: AccessibleRole.list-item;
|
||||
accessible-label: chat.title;
|
||||
accessible-description: chat.preview;
|
||||
accessible-item-selectable: true;
|
||||
accessible-item-selected: chat.selected;
|
||||
accessible-action-default => { Bridge.open-conversation(chat.key); }
|
||||
touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => { Bridge.open-conversation(root.chat.key); }
|
||||
}
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-3;
|
||||
padding-right: Theme.space-3;
|
||||
spacing: Theme.space-3;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Avatar {
|
||||
size: 44px;
|
||||
initials: root.chat.initials;
|
||||
tint: root.chat.tint;
|
||||
image: root.chat.avatar;
|
||||
square: root.chat.kind < 2;
|
||||
label: root.chat.title;
|
||||
status: root.chat.kind == 2 ? (root.chat.online ? Status.online : Status.offline) : Status.none;
|
||||
if root.chat.kind == 3: Icon {
|
||||
source: Icons.mail;
|
||||
size: 20px;
|
||||
tint: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
spacing: 1px;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Text {
|
||||
text: root.chat.title;
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-md;
|
||||
font-weight: root.chat.unread > 0 ? Theme.weight-bold : Theme.weight-medium;
|
||||
horizontal-stretch: 1;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: root.chat.time;
|
||||
color: root.chat.selected ? Theme.text-secondary : Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Text {
|
||||
text: root.chat.preview;
|
||||
color: root.chat.unread > 0 ? Theme.text : Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
horizontal-stretch: 1;
|
||||
overflow: elide;
|
||||
}
|
||||
if root.chat.unread > 0: CountBadge {
|
||||
count: root.chat.unread;
|
||||
fill: Theme.accent;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Pill tabs: All, Unread, Inbox.
|
||||
component PillTab inherits Rectangle {
|
||||
in property <string> text;
|
||||
in property <bool> selected;
|
||||
in property <int> badge;
|
||||
callback clicked();
|
||||
height: 30px;
|
||||
width: row.preferred-width + 24px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: selected ? Theme.accent-soft : touch.has-hover ? Theme.surface-3 : transparent;
|
||||
border-width: selected ? 1px : 0px;
|
||||
border-color: Theme.accent;
|
||||
accessible-role: AccessibleRole.tab;
|
||||
accessible-label: text;
|
||||
accessible-item-selectable: true;
|
||||
accessible-item-selected: selected;
|
||||
accessible-action-default => { clicked(); }
|
||||
touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => { root.clicked(); }
|
||||
}
|
||||
row := HorizontalLayout {
|
||||
alignment: center;
|
||||
spacing: Theme.space-2;
|
||||
Text {
|
||||
text: root.text;
|
||||
color: root.selected ? Theme.text : Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
font-weight: root.selected ? Theme.weight-semibold : Theme.weight-regular;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
if root.badge > 0: CountBadge {
|
||||
count: root.badge;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The list of conversations.
|
||||
export component ConversationList inherits VerticalLayout {
|
||||
padding: Theme.space-4;
|
||||
padding-right: Theme.space-3;
|
||||
spacing: Theme.space-3;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-3;
|
||||
Text {
|
||||
text: @tr("Messages");
|
||||
font-size: Theme.font-2xl;
|
||||
font-weight: Theme.weight-bold;
|
||||
color: Theme.text;
|
||||
vertical-alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.plus;
|
||||
label: @tr("New message");
|
||||
filled: true;
|
||||
checked: true;
|
||||
size: 34px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.open-search("@"); }
|
||||
}
|
||||
}
|
||||
SearchBox {
|
||||
height: 38px;
|
||||
show-shortcut: false;
|
||||
placeholder: @tr("Search messages…");
|
||||
label: @tr("Search messages");
|
||||
edited(text) => { Bridge.search-conversations(text); }
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
alignment: start;
|
||||
PillTab {
|
||||
text: @tr("All");
|
||||
selected: Nav.dm-tab == 0;
|
||||
clicked => {
|
||||
Nav.dm-tab = 0;
|
||||
Bridge.dm-tab(0);
|
||||
}
|
||||
}
|
||||
PillTab {
|
||||
text: @tr("Unread");
|
||||
selected: Nav.dm-tab == 1;
|
||||
badge: Bridge.dm-unread;
|
||||
clicked => {
|
||||
Nav.dm-tab = 1;
|
||||
Bridge.dm-tab(1);
|
||||
}
|
||||
}
|
||||
PillTab {
|
||||
text: @tr("Inbox");
|
||||
selected: Nav.dm-tab == 2;
|
||||
badge: Bridge.inbox-unread;
|
||||
clicked => {
|
||||
Nav.dm-tab = 2;
|
||||
Bridge.dm-tab(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if Bridge.conversations.length == 0: Text {
|
||||
text: Nav.dm-tab == 2 ? @tr("No offline messages. Servers keep them for you while you are away; connect with voice to fetch them.")
|
||||
: Nav.dm-tab == 1 ? @tr("Nothing unread.")
|
||||
: @tr("No conversations yet. Message someone from their card on a server, or with the + above.");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
ListView {
|
||||
vertical-stretch: 1;
|
||||
accessible-role: AccessibleRole.list;
|
||||
accessible-label: @tr("Conversations");
|
||||
for chat in Bridge.conversations: VerticalLayout {
|
||||
padding-bottom: Theme.space-1;
|
||||
ConversationRow {
|
||||
chat: chat;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The open conversation (or offline message).
|
||||
export component Conversation inherits VerticalLayout {
|
||||
in property <bool> compact;
|
||||
if !Bridge.dm.open: VerticalLayout {
|
||||
vertical-stretch: 1;
|
||||
alignment: center;
|
||||
spacing: Theme.space-3;
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
Icon {
|
||||
source: Icons.messages-square;
|
||||
size: 56px;
|
||||
tint: Theme.text-disabled;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: @tr("Pick a conversation, or start one with +.");
|
||||
color: Theme.text-muted;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
}
|
||||
if Bridge.dm.open: Rectangle {
|
||||
height: 76px;
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-5;
|
||||
padding-right: Theme.space-4;
|
||||
spacing: Theme.space-4;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Avatar {
|
||||
size: 50px;
|
||||
initials: Bridge.dm.initials;
|
||||
tint: Bridge.dm.tint;
|
||||
image: Bridge.dm.avatar;
|
||||
label: Bridge.dm.name;
|
||||
status: Bridge.dm.online ? Status.online : Status.offline;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
spacing: 2px;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-3;
|
||||
alignment: start;
|
||||
Text {
|
||||
text: Bridge.dm.name;
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-xl;
|
||||
font-weight: Theme.weight-semibold;
|
||||
overflow: elide;
|
||||
}
|
||||
if Bridge.dm.online: Rectangle {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
border-radius: 5px;
|
||||
background: Theme.success;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: Bridge.dm.status;
|
||||
color: Bridge.dm.online ? Theme.accent-text : Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
if Bridge.dm.can-send: IconButton {
|
||||
icon: Icons.hand;
|
||||
label: @tr("Poke {}", Bridge.dm.name);
|
||||
filled: true;
|
||||
size: 42px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.dm-action("poke"); }
|
||||
}
|
||||
if Bridge.dm.online: IconButton {
|
||||
icon: Icons.log-in;
|
||||
label: @tr("Join {}'s channel", Bridge.dm.name);
|
||||
filled: true;
|
||||
size: 42px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.dm-action("join"); }
|
||||
}
|
||||
IconButton {
|
||||
icon: Bridge.dm.friend ? Icons.user-check : Icons.user-plus;
|
||||
label: Bridge.dm.friend ? @tr("Remove friend") : @tr("Add friend");
|
||||
checked: Bridge.dm.friend;
|
||||
filled: true;
|
||||
size: 42px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.dm-action("friend"); }
|
||||
}
|
||||
more := IconButton {
|
||||
icon: Icons.more-horizontal;
|
||||
label: @tr("More");
|
||||
filled: true;
|
||||
size: 42px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { menu.show(self.x + self.width - 220px, self.y + self.height + 4px); }
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
y: parent.height - 1px;
|
||||
height: 1px;
|
||||
background: Theme.border;
|
||||
}
|
||||
menu := PopupMenu {
|
||||
entries: [
|
||||
{ text: Bridge.dm.muted ? @tr("Unmute for me") : @tr("Mute for me"), icon: Icons.volume-x, enabled: true },
|
||||
{ text: @tr("Write an offline message"), icon: Icons.mail, enabled: Bridge.dm.offline },
|
||||
{ text: Bridge.dm.blocked ? @tr("Unblock") : @tr("Block"), icon: Icons.ban, enabled: true, danger: !Bridge.dm.blocked, separator: true },
|
||||
];
|
||||
activated(i) => {
|
||||
if i == 0 {
|
||||
Bridge.dm-action("mute");
|
||||
} else if i == 1 {
|
||||
Nav.write-offline(Bridge.dm.uid, Bridge.dm.name);
|
||||
} else {
|
||||
Bridge.dm-action("block");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// An offline message instead of the conversation.
|
||||
if Bridge.dm.open && Bridge.dm.mail: ScrollView {
|
||||
vertical-stretch: 1;
|
||||
VerticalLayout {
|
||||
padding: Theme.space-6;
|
||||
spacing: Theme.space-4;
|
||||
alignment: start;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-3;
|
||||
Icon {
|
||||
source: Icons.mail;
|
||||
tint: Theme.accent-text;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.dm.mail-subject;
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-xl;
|
||||
font-weight: Theme.weight-semibold;
|
||||
horizontal-stretch: 1;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: Bridge.dm.mail-time;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.dm.mail-text != "" ? Bridge.dm.mail-text : @tr("Fetching the message…");
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-md;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-3;
|
||||
alignment: start;
|
||||
Button {
|
||||
kind: ButtonKind.primary;
|
||||
icon: Icons.send;
|
||||
text: @tr("Reply");
|
||||
enabled: Bridge.dm.offline;
|
||||
clicked => { Nav.write-offline(Bridge.dm.uid, Bridge.dm.name); }
|
||||
}
|
||||
Button {
|
||||
icon: Icons.mail;
|
||||
text: @tr("Mark unread");
|
||||
clicked => { Bridge.dm-action("unread-mail"); }
|
||||
}
|
||||
Button {
|
||||
kind: ButtonKind.danger;
|
||||
icon: Icons.trash-2;
|
||||
text: @tr("Delete");
|
||||
clicked => { Bridge.dm-action("delete-mail"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if Bridge.dm.open && !Bridge.dm.mail && Bridge.dm.stored: MessageList {
|
||||
vertical-stretch: 1;
|
||||
model: Bridge.dm-messages;
|
||||
}
|
||||
if Bridge.dm.open && !Bridge.dm.mail && !Bridge.dm.stored: MessageList {
|
||||
vertical-stretch: 1;
|
||||
model: Bridge.messages;
|
||||
older: true;
|
||||
}
|
||||
if Bridge.dm.open && !Bridge.dm.mail && Bridge.dm.notice != "": HorizontalLayout {
|
||||
padding-left: Theme.space-5;
|
||||
padding-right: Theme.space-5;
|
||||
padding-top: Theme.space-2;
|
||||
Banner {
|
||||
text: Bridge.dm.notice;
|
||||
icon: Icons.info;
|
||||
tone: Theme.info;
|
||||
if Bridge.dm.can-connect: Button {
|
||||
small: true;
|
||||
kind: ButtonKind.primary;
|
||||
icon: Icons.log-in;
|
||||
text: @tr("Connect");
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.dm-action("connect"); }
|
||||
}
|
||||
if Bridge.dm.offline: Button {
|
||||
small: true;
|
||||
icon: Icons.mail;
|
||||
text: @tr("Offline message");
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.write-offline(Bridge.dm.uid, Bridge.dm.name); }
|
||||
}
|
||||
}
|
||||
}
|
||||
if Bridge.dm.open && !Bridge.dm.mail: Composer {
|
||||
attach: false;
|
||||
enabled: Bridge.dm.can-send;
|
||||
placeholder: Bridge.dm.can-send ? @tr("Message @{}…", Bridge.dm.name) : @tr("{} cannot get messages now", Bridge.dm.name);
|
||||
}
|
||||
}
|
||||
|
||||
// The messages page: the list and the open conversation side by side.
|
||||
export component MessagesPage inherits HorizontalLayout {
|
||||
ConversationList {
|
||||
width: 310px * max(1.0, Theme.font-scale);
|
||||
}
|
||||
Rectangle {
|
||||
width: 1px;
|
||||
background: Theme.border;
|
||||
}
|
||||
Conversation {
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Who the conversation is with (the right panel).
|
||||
export component DmProfile inherits Rectangle {
|
||||
sv := ScrollView {
|
||||
VerticalLayout {
|
||||
width: sv.visible-width;
|
||||
padding: Theme.space-5;
|
||||
spacing: Theme.space-4;
|
||||
alignment: start;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-4;
|
||||
Avatar {
|
||||
size: 72px;
|
||||
initials: Bridge.dm.initials;
|
||||
tint: Bridge.dm.tint;
|
||||
image: Bridge.dm.avatar;
|
||||
label: Bridge.dm.name;
|
||||
status: Bridge.dm.online ? Status.online : Status.offline;
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
Text {
|
||||
text: Bridge.dm.name;
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-xl;
|
||||
font-weight: Theme.weight-semibold;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.dm.online ? @tr("Online") : @tr("Offline");
|
||||
color: Bridge.dm.online ? Theme.accent-text : Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
}
|
||||
}
|
||||
}
|
||||
if Bridge.dm.description != "": Text {
|
||||
text: "“" + Bridge.dm.description + "”";
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-md;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
if Bridge.dm.groups.length > 0: FlexboxLayout {
|
||||
spacing: Theme.space-2;
|
||||
for group in Bridge.dm.groups: Chip {
|
||||
text: group;
|
||||
icon: Icons.shield;
|
||||
outlined: true;
|
||||
}
|
||||
}
|
||||
Divider { }
|
||||
Text {
|
||||
text: @tr("About");
|
||||
color: Theme.text;
|
||||
font-weight: Theme.weight-semibold;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.dm.note != "" ? Bridge.dm.note : @tr("No note. Add one on the Friends page.");
|
||||
color: Bridge.dm.note != "" ? Theme.text-secondary : Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
if Bridge.dm.since != "": HorizontalLayout {
|
||||
spacing: Theme.space-3;
|
||||
Icon {
|
||||
source: Icons.calendar;
|
||||
size: Theme.icon-sm;
|
||||
tint: Theme.text-secondary;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.dm.since;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
}
|
||||
Divider { }
|
||||
Text {
|
||||
text: @tr("Servers — {}", Bridge.dm.servers.length);
|
||||
color: Theme.text;
|
||||
font-weight: Theme.weight-semibold;
|
||||
}
|
||||
for server in Bridge.dm.servers: HorizontalLayout {
|
||||
spacing: Theme.space-3;
|
||||
Rectangle {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: Theme.surface-4;
|
||||
Icon {
|
||||
source: Icons.server;
|
||||
size: Theme.icon-sm;
|
||||
tint: Theme.accent-text;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: server;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
vertical-alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
Divider { }
|
||||
Text {
|
||||
text: @tr("Shared Files — {}", Bridge.dm.files.length);
|
||||
color: Theme.text;
|
||||
font-weight: Theme.weight-semibold;
|
||||
}
|
||||
for file in Bridge.dm.files: HorizontalLayout {
|
||||
spacing: Theme.space-3;
|
||||
Rectangle {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: Theme.danger-soft;
|
||||
Icon {
|
||||
source: Icons.file-text;
|
||||
size: Theme.icon-sm;
|
||||
tint: Theme.danger;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: file;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
vertical-alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
if Bridge.dm.files.length == 0: Text {
|
||||
text: @tr("Files linked in this conversation show up here.");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
Divider { }
|
||||
VerticalLayout {
|
||||
spacing: Theme.space-2;
|
||||
HorizontalLayout {
|
||||
Text {
|
||||
text: @tr("Volume for me");
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
Text {
|
||||
text: @tr("{}%", round(Bridge.dm.volume));
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
IconButton {
|
||||
icon: Bridge.dm.muted ? Icons.volume-x : Icons.volume-2;
|
||||
label: Bridge.dm.muted ? @tr("Unmute for me") : @tr("Mute for me");
|
||||
checked: Bridge.dm.muted;
|
||||
danger: true;
|
||||
size: 30px;
|
||||
icon-size: Theme.icon-sm;
|
||||
clicked => { Bridge.dm-action("mute"); }
|
||||
}
|
||||
Slider {
|
||||
horizontal-stretch: 1;
|
||||
minimum: 0;
|
||||
maximum: 400;
|
||||
step: 5;
|
||||
value: Bridge.dm.volume;
|
||||
enabled: !Bridge.dm.muted;
|
||||
label: @tr("Volume of {}", Bridge.dm.name);
|
||||
released(v) => { Bridge.dm-volume(v); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Write an offline message (the server keeps it until they read it).
|
||||
export component OfflineDialog inherits Modal {
|
||||
in-out property <string> subject;
|
||||
in-out property <string> body;
|
||||
callback done();
|
||||
title: @tr("Offline message to {}", Nav.offline-form.to);
|
||||
subtitle: @tr("The server keeps it until {} reads it.", Nav.offline-form.to);
|
||||
icon: Icons.mail;
|
||||
card-width: 520px;
|
||||
card-height: 380px;
|
||||
dismissed => { done(); }
|
||||
Field {
|
||||
label: @tr("Subject");
|
||||
TextField {
|
||||
text <=> root.subject;
|
||||
placeholder: @tr("Subject");
|
||||
label: @tr("Subject");
|
||||
}
|
||||
}
|
||||
Field {
|
||||
label: @tr("Message");
|
||||
TextField {
|
||||
text <=> root.body;
|
||||
placeholder: @tr("Your message");
|
||||
label: @tr("Message");
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
vertical-stretch: 1;
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: end;
|
||||
spacing: Theme.space-3;
|
||||
Button {
|
||||
text: @tr("Cancel");
|
||||
clicked => { root.done(); }
|
||||
}
|
||||
Button {
|
||||
kind: ButtonKind.primary;
|
||||
icon: Icons.send;
|
||||
text: @tr("Send");
|
||||
enabled: root.body != "";
|
||||
clicked => {
|
||||
Bridge.send-offline({ uid: Nav.offline-form.uid, to: Nav.offline-form.to, subject: root.subject, text: root.body });
|
||||
root.done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,482 @@
|
||||
// Things over the page: the bell's notifications, the search (Ctrl+K), a
|
||||
// picture from the chat opened larger.
|
||||
|
||||
import { Theme } from "../theme.slint";
|
||||
import { Icons } from "../icons.slint";
|
||||
import { Bridge, NoticeItem, SearchItem } from "../bridge.slint";
|
||||
import { Nav, Page, SettingsSection } from "../nav.slint";
|
||||
import { Icon, Button, ButtonKind, IconButton, Avatar, Status, Chip, CountBadge, TextField, Kbd, Divider, ListView, ScrollView } from "../components/index.slint";
|
||||
|
||||
// One notification.
|
||||
component NoticeRow inherits Rectangle {
|
||||
in property <NoticeItem> notice;
|
||||
min-height: 64px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: touch.has-hover ? Theme.surface-4 : notice.unread ? Theme.accent-soft.transparentize(0.6) : transparent;
|
||||
accessible-role: AccessibleRole.list-item;
|
||||
accessible-label: notice.title;
|
||||
accessible-description: notice.body;
|
||||
accessible-action-default => { Bridge.open-notice(notice.key); Nav.notifications-open = false; }
|
||||
touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => {
|
||||
Bridge.open-notice(root.notice.key);
|
||||
Nav.notifications-open = false;
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
padding: Theme.space-3;
|
||||
spacing: Theme.space-3;
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
Rectangle {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
Avatar {
|
||||
size: 40px;
|
||||
initials: root.notice.initials;
|
||||
tint: root.notice.tint;
|
||||
image: root.notice.avatar;
|
||||
label: root.notice.title;
|
||||
}
|
||||
Rectangle {
|
||||
x: 24px;
|
||||
y: 24px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 10px;
|
||||
background: root.notice.kind == "poke" ? Theme.warning
|
||||
: root.notice.kind == "mention" ? Theme.accent
|
||||
: root.notice.kind == "event" ? #8b5cf6
|
||||
: root.notice.kind == "friend" ? Theme.success : Theme.info;
|
||||
border-width: 2px;
|
||||
border-color: Theme.surface-3;
|
||||
Icon {
|
||||
source: root.notice.kind == "poke" ? Icons.hand
|
||||
: root.notice.kind == "mention" ? Icons.at-sign
|
||||
: root.notice.kind == "event" ? Icons.calendar
|
||||
: root.notice.kind == "friend" ? Icons.user-check : Icons.message-square;
|
||||
size: 11px;
|
||||
tint: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
horizontal-stretch: 1;
|
||||
spacing: 2px;
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Text {
|
||||
text: root.notice.title;
|
||||
color: Theme.text;
|
||||
font-weight: root.notice.unread ? Theme.weight-semibold : Theme.weight-medium;
|
||||
horizontal-stretch: 1;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: root.notice.time;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
}
|
||||
}
|
||||
if root.notice.body != "": Text {
|
||||
text: root.notice.body;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
wrap: word-wrap;
|
||||
overflow: elide;
|
||||
max-height: 36px * Theme.font-scale;
|
||||
}
|
||||
}
|
||||
if root.notice.unread: Rectangle {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
border-radius: 4px;
|
||||
background: Theme.accent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The bell's panel: mentions, pokes, messages, event reminders, friends
|
||||
// coming online; requests to watch our stream and saved crash reports.
|
||||
export component NotificationsPanel inherits Rectangle {
|
||||
width: 400px;
|
||||
background: Theme.surface-3;
|
||||
border-radius: Theme.radius-lg;
|
||||
border-width: 1px;
|
||||
border-color: Theme.border-strong;
|
||||
clip: true;
|
||||
accessible-role: AccessibleRole.groupbox;
|
||||
accessible-label: @tr("Notifications");
|
||||
// Clicks inside stay inside.
|
||||
TouchArea { }
|
||||
VerticalLayout {
|
||||
padding: Theme.space-3;
|
||||
spacing: Theme.space-2;
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-2;
|
||||
spacing: Theme.space-2;
|
||||
Text {
|
||||
text: @tr("Notifications");
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-lg;
|
||||
font-weight: Theme.weight-semibold;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
if Bridge.notifications-unread > 0: CountBadge {
|
||||
count: Bridge.notifications-unread;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Rectangle {
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
Button {
|
||||
small: true;
|
||||
kind: ButtonKind.ghost;
|
||||
icon: Icons.check;
|
||||
text: @tr("Mark all read");
|
||||
enabled: Bridge.notifications-unread > 0;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.mark-notices-read(); }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.trash-2;
|
||||
label: @tr("Clear all");
|
||||
size: 30px;
|
||||
icon-size: Theme.icon-sm;
|
||||
enabled: Bridge.notifications.length > 0;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Bridge.clear-notices(); }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.settings;
|
||||
label: @tr("Notification settings");
|
||||
size: 30px;
|
||||
icon-size: Theme.icon-sm;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => {
|
||||
Nav.notifications-open = false;
|
||||
Nav.open-settings(SettingsSection.notifications);
|
||||
}
|
||||
}
|
||||
}
|
||||
if Bridge.share-requests > 0: Rectangle {
|
||||
height: 48px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: share-touch.has-hover ? Theme.surface-4 : Theme.live-soft;
|
||||
share-touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => {
|
||||
Nav.notifications-open = false;
|
||||
Nav.open-share();
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-3;
|
||||
spacing: Theme.space-3;
|
||||
Icon {
|
||||
source: Icons.monitor-up;
|
||||
tint: Theme.live;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: @tr("{} want to watch your stream", Bridge.share-requests);
|
||||
color: Theme.text;
|
||||
vertical-alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if Bridge.crash-notice != "": Rectangle {
|
||||
min-height: 48px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: Theme.warning-soft;
|
||||
HorizontalLayout {
|
||||
padding: Theme.space-3;
|
||||
spacing: Theme.space-3;
|
||||
Icon {
|
||||
source: Icons.triangle-alert;
|
||||
tint: Theme.warning;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.crash-notice;
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-sm;
|
||||
wrap: word-wrap;
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if Bridge.notifications.length == 0 && Bridge.share-requests == 0: VerticalLayout {
|
||||
padding: Theme.space-6;
|
||||
spacing: Theme.space-2;
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
Icon {
|
||||
source: Icons.bell;
|
||||
size: 36px;
|
||||
tint: Theme.text-disabled;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: @tr("Nothing new. Mentions, pokes, messages, event reminders and friends coming online show up here.");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
horizontal-alignment: center;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
vertical-stretch: 1;
|
||||
min-height: Bridge.notifications.length > 0 ? 200px : 0px;
|
||||
for notice in Bridge.notifications: NoticeRow {
|
||||
notice: notice;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A result of the search.
|
||||
component ResultRow inherits VerticalLayout {
|
||||
in property <SearchItem> item;
|
||||
in property <bool> selected;
|
||||
callback clicked();
|
||||
if root.item.header != "": Text {
|
||||
text: root.item.header;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
font-weight: Theme.weight-semibold;
|
||||
height: 28px;
|
||||
vertical-alignment: bottom;
|
||||
}
|
||||
Rectangle {
|
||||
height: 46px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: root.selected ? Theme.accent-soft : touch.has-hover ? Theme.surface-4 : transparent;
|
||||
border-width: root.selected ? 1px : 0px;
|
||||
border-color: Theme.accent;
|
||||
accessible-role: AccessibleRole.list-item;
|
||||
accessible-label: root.item.title;
|
||||
accessible-description: root.item.subtitle;
|
||||
accessible-item-selectable: true;
|
||||
accessible-item-selected: root.selected;
|
||||
accessible-action-default => { root.clicked(); }
|
||||
touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => { root.clicked(); }
|
||||
}
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-3;
|
||||
padding-right: Theme.space-3;
|
||||
spacing: Theme.space-3;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
if root.item.kind == "person" || root.item.kind == "contact" || root.item.kind == "server": Avatar {
|
||||
size: 32px;
|
||||
square: root.item.kind == "server";
|
||||
initials: root.item.initials;
|
||||
tint: root.item.tint;
|
||||
image: root.item.avatar;
|
||||
label: root.item.title;
|
||||
status: root.item.kind == "person" ? Status.online : Status.none;
|
||||
}
|
||||
if root.item.kind == "channel" || root.item.kind == "setting": Rectangle {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: Theme.surface-4;
|
||||
Icon {
|
||||
source: root.item.kind == "channel" ? Icons.hash : Icons.settings;
|
||||
size: Theme.icon-sm;
|
||||
tint: Theme.accent-text;
|
||||
}
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
Text {
|
||||
text: root.item.title;
|
||||
color: Theme.text;
|
||||
font-weight: Theme.weight-medium;
|
||||
overflow: elide;
|
||||
}
|
||||
if root.item.subtitle != "": Text {
|
||||
text: root.item.subtitle;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
if root.selected: Icon {
|
||||
source: Icons.arrow-right;
|
||||
size: Theme.icon-sm;
|
||||
tint: Theme.accent-text;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The search (Ctrl+K): servers, channels, people and settings pages; the
|
||||
// arrow keys pick a result, Enter opens it, Escape closes.
|
||||
export component SearchPalette inherits Rectangle {
|
||||
background: Theme.scrim;
|
||||
accessible-role: AccessibleRole.none;
|
||||
TouchArea {
|
||||
clicked => { Nav.close-search(); }
|
||||
}
|
||||
card := Rectangle {
|
||||
x: (parent.width - self.width) / 2;
|
||||
y: min(80px, parent.height / 10);
|
||||
width: min(parent.width - 24px, 640px);
|
||||
height: min(parent.height - self.y - 24px, 540px);
|
||||
background: Theme.surface;
|
||||
border-radius: Theme.radius-xl;
|
||||
border-width: 1px;
|
||||
border-color: Theme.border-strong;
|
||||
clip: true;
|
||||
accessible-role: AccessibleRole.groupbox;
|
||||
accessible-label: @tr("Search");
|
||||
TouchArea { }
|
||||
VerticalLayout {
|
||||
padding: Theme.space-4;
|
||||
spacing: Theme.space-3;
|
||||
input := TextField {
|
||||
height: 46px;
|
||||
text: Nav.search-text;
|
||||
icon: Icons.search;
|
||||
font-size: Theme.font-md;
|
||||
placeholder: @tr("Search servers, channels, people, settings…");
|
||||
label: @tr("Search");
|
||||
init => { self.focus(); }
|
||||
edited(text) => {
|
||||
Nav.search-text = text;
|
||||
Nav.search-index = 0;
|
||||
results.content-y = 0;
|
||||
Bridge.search(text);
|
||||
}
|
||||
accepted => {
|
||||
if Bridge.search-results.length > 0 {
|
||||
Bridge.search-activate(Nav.search-index);
|
||||
Nav.close-search();
|
||||
}
|
||||
}
|
||||
key-pressed(event) => {
|
||||
if event.text == Key.DownArrow {
|
||||
Nav.search-index = min(Bridge.search-results.length - 1, Nav.search-index + 1);
|
||||
if (Nav.search-index + 1) * 52px > results.visible-height - results.content-y {
|
||||
results.content-y = results.visible-height - (Nav.search-index + 1) * 52px;
|
||||
}
|
||||
return accept;
|
||||
}
|
||||
if event.text == Key.UpArrow {
|
||||
Nav.search-index = max(0, Nav.search-index - 1);
|
||||
if Nav.search-index * 52px < -results.content-y {
|
||||
results.content-y = -Nav.search-index * 52px;
|
||||
}
|
||||
return accept;
|
||||
}
|
||||
if event.text == Key.Escape {
|
||||
Nav.close-search();
|
||||
return accept;
|
||||
}
|
||||
reject
|
||||
}
|
||||
}
|
||||
if Bridge.search-results.length == 0: Text {
|
||||
text: Nav.search-text == "" ? @tr("Type to find a server, a channel, a person or a settings page.") : @tr("Nothing matches “{}”.", Nav.search-text);
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
results := ScrollView {
|
||||
vertical-stretch: 1;
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
for item[i] in Bridge.search-results: ResultRow {
|
||||
item: item;
|
||||
selected: i == Nav.search-index;
|
||||
clicked => {
|
||||
Bridge.search-activate(i);
|
||||
Nav.close-search();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Divider { }
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
alignment: start;
|
||||
Kbd { text: "↑"; }
|
||||
Kbd { text: "↓"; }
|
||||
Text {
|
||||
text: @tr("to choose");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
Rectangle {
|
||||
width: Theme.space-4;
|
||||
}
|
||||
Kbd { text: "Enter"; }
|
||||
Text {
|
||||
text: @tr("to open");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
Rectangle {
|
||||
width: Theme.space-4;
|
||||
}
|
||||
Kbd { text: "Esc"; }
|
||||
Text {
|
||||
text: @tr("to close");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A picture from the chat, as large as the window allows.
|
||||
export component Lightbox inherits Rectangle {
|
||||
background: #000000d8;
|
||||
accessible-role: AccessibleRole.image;
|
||||
accessible-label: @tr("Picture");
|
||||
TouchArea {
|
||||
clicked => { Nav.lightbox-open = false; }
|
||||
}
|
||||
FocusScope {
|
||||
init => { self.focus(); }
|
||||
key-pressed(event) => {
|
||||
if event.text == Key.Escape {
|
||||
Nav.lightbox-open = false;
|
||||
return accept;
|
||||
}
|
||||
reject
|
||||
}
|
||||
}
|
||||
Image {
|
||||
x: 40px;
|
||||
y: 40px;
|
||||
width: parent.width - 80px;
|
||||
height: parent.height - 80px;
|
||||
source: Nav.lightbox;
|
||||
image-fit: contain;
|
||||
}
|
||||
IconButton {
|
||||
x: parent.width - self.width - Theme.space-4;
|
||||
y: Theme.space-4;
|
||||
icon: Icons.x;
|
||||
label: @tr("Close");
|
||||
round: true;
|
||||
filled: true;
|
||||
clicked => { Nav.lightbox-open = false; }
|
||||
}
|
||||
}
|
||||
@@ -198,25 +198,29 @@ export component TopBar inherits Rectangle {
|
||||
HorizontalLayout {
|
||||
horizontal-stretch: 1;
|
||||
alignment: center;
|
||||
search := SearchBox {
|
||||
// Opens the search (Ctrl+K does too).
|
||||
Rectangle {
|
||||
max-width: 680px;
|
||||
height: 40px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
placeholder: Bridge.current-server >= 0 ? @tr("Search channels and people in {}…", Bridge.server-title) : @tr("Search channels and people…");
|
||||
label: @tr("Search");
|
||||
edited(text) => { Bridge.search(text); }
|
||||
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.share-requests > 0 ? @tr("{} requests to watch your stream", Bridge.share-requests) : @tr("Notifications");
|
||||
dot: Bridge.share-requests > 0 || Bridge.crash-notice != "";
|
||||
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 => {
|
||||
if Bridge.share-requests > 0 {
|
||||
Nav.open-share();
|
||||
}
|
||||
}
|
||||
clicked => { Nav.notifications-open = !Nav.notifications-open; }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.users;
|
||||
@@ -241,9 +245,6 @@ export component TopBar inherits Rectangle {
|
||||
clicked => { Nav.open-about(); }
|
||||
}
|
||||
}
|
||||
// Ctrl+K focuses the search.
|
||||
property <int> requests: Nav.search-requests;
|
||||
changed requests => { search.focus(); }
|
||||
}
|
||||
|
||||
// A sidebar panel: the page's navigation (@children) above the voice card
|
||||
|
||||
@@ -117,14 +117,23 @@ export component MobileShell inherits Rectangle {
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.search;
|
||||
label: @tr("Search");
|
||||
round: true;
|
||||
filled: true;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.open-search(""); }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.bell;
|
||||
label: @tr("Notifications");
|
||||
round: true;
|
||||
filled: true;
|
||||
dot: Bridge.share-requests > 0 || Bridge.crash-notice != "";
|
||||
checked: Nav.notifications-open;
|
||||
dot: Bridge.notifications-unread > 0 || Bridge.share-requests > 0 || Bridge.crash-notice != "";
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.mobile-tab = MobileTab.activity; Nav.show(Page.server); }
|
||||
clicked => { Nav.notifications-open = !Nav.notifications-open; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||