ui: home continues where you left off, with unread mentions
The banner carousel repeated the servers below it, and the quick actions, the friends and the sidebar art appeared twice. Home now shows the banner only before the first server; after it a card with the last voice channel (`ui.last_voice`, Join or Open) and up to three unread mentions. Friends show once, and the sidebar lists the five newest private chats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AVRENKftQqGoEeswiR9TDQ
This commit is contained in:
1 parent
a3b61bca70
commit
7965187d2c
20 files changed
+561
-372
No files matched your search
@@ -237,7 +237,7 @@ export component MainWindow inherits Window {
|
||||
: Bridge.server-title;
|
||||
subtitle: Nav.page == Page.settings || Nav.page == Page.friends || Nav.page == Page.messages || Nav.page == Page.library ? ""
|
||||
: Nav.page == Page.events || Nav.phone-voice ? Bridge.server-title
|
||||
: Nav.page == Page.home || Nav.mobile-tab == MobileTab.home ? @tr("Find your people. Talk beyond.")
|
||||
: Nav.page == Page.home || Nav.mobile-tab == MobileTab.home ? ""
|
||||
: 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 || Nav.page == Page.friends || Nav.page == Page.messages || Nav.page == Page.library || Nav.page == Page.events;
|
||||
|
||||
@@ -522,6 +522,23 @@ export struct HappeningItem {
|
||||
live: bool,
|
||||
}
|
||||
|
||||
// Home's "Continue where you left off": the voice channel we were in last.
|
||||
export struct ResumeItem {
|
||||
// There is one: its server is still a bookmark at the same address.
|
||||
shown: bool,
|
||||
server-id: int,
|
||||
server: string,
|
||||
initials: string,
|
||||
tint: color,
|
||||
icon: image,
|
||||
// The channel's name as the tree shows it.
|
||||
channel: string,
|
||||
// Voice is connected there: the button shows the server; else it
|
||||
// connects into the channel.
|
||||
open: bool,
|
||||
connecting: bool,
|
||||
}
|
||||
|
||||
// A scheduled event of a server's gateway.
|
||||
export struct EventItem {
|
||||
id: int,
|
||||
@@ -1129,8 +1146,14 @@ export global Bridge {
|
||||
// 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.
|
||||
// Home: where we were with voice last and the unread mentions (at most
|
||||
// three, newest first), friends online, live streams on our servers,
|
||||
// the latest chats, what friends do, events and server news, the
|
||||
// Library; in the sidebar the newest private chats (five, unread
|
||||
// first).
|
||||
in property <ResumeItem> last-place;
|
||||
in property <[NoticeItem]> home-mentions;
|
||||
in property <[ConversationItem]> sidebar-dms;
|
||||
in property <[ContactItem]> friends-online;
|
||||
in property <[LiveItem]> live-rooms;
|
||||
in property <[ConversationItem]> recent-chats;
|
||||
@@ -1148,6 +1171,9 @@ export global Bridge {
|
||||
callback open-recordings-folder();
|
||||
// Connect a bookmark with voice (the Join buttons).
|
||||
callback connect-server(int);
|
||||
// The last place's button: its server, connected into the channel if
|
||||
// voice is not there yet.
|
||||
callback resume();
|
||||
|
||||
// Friends: the contacts (friends, then the others), the selected one.
|
||||
in property <[ContactItem]> contacts;
|
||||
|
||||
@@ -99,6 +99,9 @@ export global Nav {
|
||||
// The last message shows its actions as if hovered (VOELIN_OPEN=actions:
|
||||
// a screenshot cannot hover).
|
||||
in-out property <bool> show-actions;
|
||||
// Home shows its first-run banner over the servers (VOELIN_OPEN=first-run:
|
||||
// the empty state over sample data).
|
||||
in-out property <bool> first-run;
|
||||
|
||||
// The bell's panel, the search (Ctrl+K) and its selected result, a
|
||||
// picture opened from the chat, the event and offline message forms,
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
// The home page (design mockup 01): a banner with Voelin and the user's
|
||||
// servers, friends online, live streams on our servers, the servers, the
|
||||
// latest chats; at the right what friends do, quick actions and what is
|
||||
// happening (events, scheduled streams, server news). Also the sidebar
|
||||
// that leads to Friends, Direct Messages and the Library, and the Library.
|
||||
// The home page (design mockup 01): where we were with voice last and the
|
||||
// unread mentions (before the first server, a banner with Voelin), friends
|
||||
// online, live streams on our servers, the servers, the latest chats; at
|
||||
// the right what friends do and what is happening (events, scheduled
|
||||
// streams, server news). Also the sidebar that leads to Friends, Direct
|
||||
// Messages and the Library, with the newest private chats; and the
|
||||
// Library.
|
||||
|
||||
import { Theme } from "../theme.slint";
|
||||
import { Icons } from "../icons.slint";
|
||||
import { Bridge, ServerItem, ContactItem, LiveItem, ConversationItem, HappeningItem, RecordingItem } from "../bridge.slint";
|
||||
import { Bridge, ServerItem, ContactItem, LiveItem, ConversationItem, HappeningItem, RecordingItem, ResumeItem } from "../bridge.slint";
|
||||
import { Nav, Page, SettingsSection } from "../nav.slint";
|
||||
import { Icon, Button, ButtonKind, IconButton, Avatar, Status, Chip, SectionHeader, NavItem, Divider, CountBadge, LiveBadge, ScrollView, ListView } from "../components/index.slint";
|
||||
import { ConversationRow } from "messages.slint";
|
||||
import { NoticeRow } from "overlays.slint";
|
||||
|
||||
// A painted picture (Icons.art-*) covering an area of the given size, cut
|
||||
// at the sides or at the bottom by the parent's clip. Drawn at its own
|
||||
@@ -28,100 +32,11 @@ component Art inherits Image {
|
||||
image-fit: fill;
|
||||
}
|
||||
|
||||
// A quick action of the sidebar: an icon in a rounded square.
|
||||
component QuickNav inherits Rectangle {
|
||||
in property <image> icon;
|
||||
in property <string> text;
|
||||
callback clicked();
|
||||
height: 44px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: touch.has-hover ? Theme.surface-3 : transparent;
|
||||
accessible-role: AccessibleRole.button;
|
||||
accessible-label: text;
|
||||
accessible-action-default => { clicked(); }
|
||||
touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => { root.clicked(); }
|
||||
}
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-2;
|
||||
spacing: Theme.space-4;
|
||||
Rectangle {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
border-radius: Theme.radius-md;
|
||||
background: Theme.surface-2;
|
||||
border-width: 1px;
|
||||
border-color: Theme.border-strong;
|
||||
Icon {
|
||||
source: root.icon;
|
||||
size: Theme.icon-md;
|
||||
tint: Theme.text-secondary;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: root.text;
|
||||
color: Theme.text;
|
||||
vertical-alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The painted picture at the bottom of the home sidebar.
|
||||
component SidebarArt inherits Rectangle {
|
||||
min-height: 140px;
|
||||
// Out to the panel's edges (over the sidebar's padding, not its
|
||||
// border), so no side edges show; the top fades into the panel slowly,
|
||||
// easing out.
|
||||
Rectangle {
|
||||
x: 1px - Theme.space-3;
|
||||
width: parent.width + 2 * (Theme.space-3 - 1px);
|
||||
clip: true;
|
||||
Art {
|
||||
source: Icons.art-sidebar;
|
||||
cover-width: parent.width;
|
||||
cover-height: parent.height;
|
||||
align-y: 1;
|
||||
}
|
||||
Rectangle {
|
||||
y: 0;
|
||||
height: min(parent.height * 0.55, 220px);
|
||||
background: @linear-gradient(180deg,
|
||||
Theme.surface 0%,
|
||||
Theme.surface.transparentize(0.2) 30%,
|
||||
Theme.surface.transparentize(0.65) 65%,
|
||||
Theme.surface.transparentize(1) 100%);
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: end;
|
||||
padding: Theme.space-5;
|
||||
padding-bottom: Theme.space-8;
|
||||
spacing: Theme.space-1;
|
||||
visible: root.height > 170px;
|
||||
for line in [@tr("Hang out"), @tr("Play together"), @tr("Find your people")]: Text {
|
||||
text: line;
|
||||
color: #e8edff;
|
||||
font-size: Theme.font-lg;
|
||||
font-weight: Theme.weight-medium;
|
||||
}
|
||||
Rectangle {
|
||||
height: Theme.space-5;
|
||||
}
|
||||
Rectangle {
|
||||
width: 44px;
|
||||
height: 2px;
|
||||
background: Theme.accent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The sidebar next to the home page, the friends, the messages and the
|
||||
// Library.
|
||||
// Library. Under its links the newest private chats, except on the
|
||||
// messages page, which lists them all.
|
||||
export component HomeNav inherits VerticalLayout {
|
||||
property <bool> dms: Nav.page != Page.messages && Bridge.sidebar-dms.length > 0;
|
||||
spacing: Theme.space-2;
|
||||
NavItem {
|
||||
icon: Icons.home;
|
||||
@@ -148,44 +63,36 @@ export component HomeNav inherits VerticalLayout {
|
||||
selected: Nav.page == Page.library;
|
||||
clicked => { Nav.show(Page.library); }
|
||||
}
|
||||
Divider { }
|
||||
VerticalLayout {
|
||||
padding-top: Theme.space-3;
|
||||
if root.dms: Divider { }
|
||||
if root.dms: VerticalLayout {
|
||||
padding-top: Theme.space-2;
|
||||
padding-left: Theme.space-3;
|
||||
padding-bottom: Theme.space-2;
|
||||
Text {
|
||||
text: @tr("Quick Actions");
|
||||
text: @tr("Recent Messages");
|
||||
font-size: Theme.font-body;
|
||||
font-weight: Theme.weight-medium;
|
||||
color: Theme.text;
|
||||
}
|
||||
}
|
||||
QuickNav {
|
||||
icon: Icons.plus;
|
||||
text: @tr("Add a Server");
|
||||
clicked => { Nav.add-server(); }
|
||||
}
|
||||
QuickNav {
|
||||
icon: Icons.log-in;
|
||||
text: @tr("Join a Server");
|
||||
clicked => { Nav.add-server(); }
|
||||
}
|
||||
QuickNav {
|
||||
icon: Icons.user-plus;
|
||||
text: @tr("Find Friends");
|
||||
clicked => {
|
||||
Nav.friends-tab = 1;
|
||||
Bridge.friends-tab(1);
|
||||
Nav.show(Page.friends);
|
||||
// Scrolls when the window is low, so it never makes the window taller.
|
||||
if root.dms: dm-list := ScrollView {
|
||||
vertical-stretch: 1;
|
||||
VerticalLayout {
|
||||
width: dm-list.visible-width;
|
||||
alignment: start;
|
||||
spacing: Theme.space-1;
|
||||
for chat in Bridge.sidebar-dms: ConversationRow {
|
||||
chat: chat;
|
||||
}
|
||||
}
|
||||
}
|
||||
SidebarArt {
|
||||
if !root.dms: Rectangle {
|
||||
vertical-stretch: 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// A slide arrow of the banner: a dark round button with a light ring.
|
||||
// An arrow over the live streams' row: a dark round button with a light
|
||||
// ring.
|
||||
component BannerArrow inherits Rectangle {
|
||||
in property <image> icon;
|
||||
in property <string> label;
|
||||
@@ -209,47 +116,30 @@ component BannerArrow inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// The banner: Voelin first, then each server; arrows and dots switch.
|
||||
// The banner before the first server: Voelin, what it does, Add a Server.
|
||||
component HomeBanner inherits Rectangle {
|
||||
in property <bool> compact;
|
||||
property <int> slide: 0;
|
||||
property <int> count: Bridge.servers.length + 1;
|
||||
property <ServerItem> server: Bridge.servers[max(0, root.slide - 1)];
|
||||
min-height: compact ? 200px : 212px;
|
||||
border-radius: Theme.radius-xl;
|
||||
clip: true;
|
||||
background: root.slide == 0
|
||||
? @linear-gradient(115deg, #0e1d5c 0%, #1c1470 45%, #3a1f86 75%, #0b2a6b 100%)
|
||||
: @linear-gradient(115deg, root.server.tint.darker(0.6) 0%, #1c1470 55%, #0b2a6b 100%);
|
||||
background: @linear-gradient(115deg, #0e1d5c 0%, #1c1470 45%, #3a1f86 75%, #0b2a6b 100%);
|
||||
border-width: 1px;
|
||||
border-color: Theme.border-strong;
|
||||
accessible-role: AccessibleRole.groupbox;
|
||||
accessible-label: root.slide == 0 ? Bridge.app-name : root.server.name;
|
||||
accessible-label: Bridge.app-name;
|
||||
// The night landscape, cut at the left on narrow screens (the moon
|
||||
// stays); a server's slide takes the server's colour over it.
|
||||
// stays).
|
||||
Art {
|
||||
source: Icons.art-banner;
|
||||
cover-width: parent.width;
|
||||
cover-height: parent.height;
|
||||
align-x: 1;
|
||||
}
|
||||
if root.slide > 0: Rectangle {
|
||||
background: root.server.tint.with-alpha(0.28);
|
||||
}
|
||||
if root.compact: Rectangle {
|
||||
background: @linear-gradient(90deg, #060c2cc0 0%, #060c2c50 55%, transparent 85%);
|
||||
}
|
||||
// The phone: swipe between the slides.
|
||||
if root.compact && root.count > 1: SwipeGestureHandler {
|
||||
handle-swipe-left: true;
|
||||
handle-swipe-right: true;
|
||||
swiped => {
|
||||
root.slide = self.current-position.x < self.pressed-position.x
|
||||
? mod(root.slide + 1, root.count) : mod(root.slide + root.count - 1, root.count);
|
||||
}
|
||||
}
|
||||
// Words down a slope at the right, as written on the sky.
|
||||
if !root.compact && root.slide == 0 && root.width > 640px: Rectangle {
|
||||
if !root.compact && root.width > 640px: Rectangle {
|
||||
x: parent.width - 180px;
|
||||
y: 24px;
|
||||
width: 160px;
|
||||
@@ -268,7 +158,7 @@ component HomeBanner inherits Rectangle {
|
||||
padding-left: root.compact ? Theme.space-5 : 44px;
|
||||
spacing: Theme.space-3;
|
||||
alignment: center;
|
||||
if root.slide == 0: HorizontalLayout {
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-4;
|
||||
alignment: start;
|
||||
Image {
|
||||
@@ -284,93 +174,112 @@ component HomeBanner inherits Rectangle {
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
if root.slide > 0: HorizontalLayout {
|
||||
spacing: Theme.space-4;
|
||||
alignment: start;
|
||||
Avatar {
|
||||
size: root.compact ? 44px : 56px;
|
||||
square: true;
|
||||
initials: root.server.initials;
|
||||
image: root.server.icon;
|
||||
tint: root.server.tint;
|
||||
label: root.server.name;
|
||||
status: root.server.status == "connected" ? Status.online : root.server.status == "observing" ? Status.info : root.server.status == "connecting" ? Status.idle : Status.none;
|
||||
}
|
||||
Text {
|
||||
text: root.server.name;
|
||||
color: #ffffff;
|
||||
font-size: (root.compact ? 26px : 36px) * Theme.font-scale;
|
||||
font-weight: Theme.weight-bold;
|
||||
vertical-alignment: center;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: root.slide == 0 ? @tr("Voice, chat and streams\non TeamSpeak servers.")
|
||||
: root.server.flavor != "" ? root.server.flavor : @tr("Not reached yet");
|
||||
text: @tr("Voice, chat and streams\non TeamSpeak servers.");
|
||||
color: #ffffff;
|
||||
font-size: root.compact ? Theme.font-lg : Theme.font-2xl;
|
||||
font-weight: Theme.weight-medium;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
Text {
|
||||
text: root.slide == 0 ? @tr("Talk. Watch. Share. Or look in without joining.") : root.server.detail;
|
||||
text: @tr("Talk. Watch. Share. Or look in without joining.");
|
||||
color: #c9d4ff;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: start;
|
||||
spacing: Theme.space-3;
|
||||
padding-top: Theme.space-2;
|
||||
if root.slide == 0: Button {
|
||||
Button {
|
||||
kind: ButtonKind.primary;
|
||||
icon: Icons.arrow-right;
|
||||
text: @tr("Add a Server");
|
||||
clicked => { Nav.add-server(); }
|
||||
}
|
||||
if root.slide > 0 && root.server.status != "connected": Button {
|
||||
kind: ButtonKind.primary;
|
||||
icon: Icons.log-in;
|
||||
text: root.server.status == "connecting" ? @tr("Connecting…") : @tr("Connect");
|
||||
enabled: root.server.status != "connecting";
|
||||
clicked => { Bridge.connect-server(root.server.id); }
|
||||
}
|
||||
if root.slide > 0: Button {
|
||||
icon: Icons.arrow-right;
|
||||
text: @tr("Open");
|
||||
clicked => { Nav.select-server(root.server.id); }
|
||||
}
|
||||
}
|
||||
}
|
||||
// Round buttons in the bottom corners, a little above the dots. The
|
||||
// phone has the dots only.
|
||||
if root.count > 1 && !root.compact: BannerArrow {
|
||||
x: Theme.space-3;
|
||||
y: parent.height - self.height - 12px;
|
||||
icon: Icons.chevron-left;
|
||||
label: @tr("Previous");
|
||||
clicked => { root.slide = mod(root.slide + root.count - 1, root.count); }
|
||||
}
|
||||
|
||||
// Where we were with voice last: the channel and its server, Join (Open
|
||||
// while voice is there).
|
||||
component ResumeCard inherits Rectangle {
|
||||
in property <ResumeItem> place;
|
||||
in property <bool> compact;
|
||||
border-radius: Theme.radius-lg;
|
||||
clip: true;
|
||||
background: Theme.surface-2;
|
||||
border-width: 1px;
|
||||
border-color: touch.has-hover ? Theme.border-strong : Theme.border;
|
||||
accessible-role: AccessibleRole.groupbox;
|
||||
accessible-label: @tr("Continue where you left off");
|
||||
accessible-description: place.channel + " · " + place.server;
|
||||
touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
enabled: !root.place.connecting;
|
||||
clicked => { Bridge.resume(); }
|
||||
}
|
||||
if root.count > 1 && !root.compact: BannerArrow {
|
||||
x: parent.width - self.width - Theme.space-3;
|
||||
y: parent.height - self.height - 12px;
|
||||
icon: Icons.chevron-right;
|
||||
label: @tr("Next");
|
||||
clicked => { root.slide = mod(root.slide + 1, root.count); }
|
||||
// The server's colour, fading out to the right.
|
||||
Rectangle {
|
||||
background: @linear-gradient(90deg, root.place.tint.with-alpha(0.3) 0%, root.place.tint.with-alpha(0) 65%);
|
||||
}
|
||||
if root.count > 1: HorizontalLayout {
|
||||
y: parent.height - (root.compact ? 22px : 17px);
|
||||
height: 10px;
|
||||
alignment: center;
|
||||
spacing: Theme.space-3;
|
||||
for i in root.count: Rectangle {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 4px;
|
||||
background: i == root.slide ? #ffffff : #ffffff50;
|
||||
TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => { root.slide = i; }
|
||||
HorizontalLayout {
|
||||
padding: root.compact ? Theme.space-3 : Theme.space-4;
|
||||
padding-left: root.compact ? Theme.space-3 : Theme.space-5;
|
||||
spacing: root.compact ? Theme.space-3 : Theme.space-4;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Avatar {
|
||||
size: root.compact ? 44px : 52px;
|
||||
square: true;
|
||||
initials: root.place.initials;
|
||||
image: root.place.icon;
|
||||
tint: root.place.tint;
|
||||
label: root.place.server;
|
||||
status: root.place.open ? Status.online : root.place.connecting ? Status.idle : Status.none;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
spacing: 2px;
|
||||
Text {
|
||||
text: @tr("Continue where you left off");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
overflow: elide;
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Icon {
|
||||
source: Icons.channel;
|
||||
size: Theme.icon-sm;
|
||||
tint: Theme.text-secondary;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
Text {
|
||||
text: root.place.channel;
|
||||
color: Theme.text;
|
||||
font-size: root.compact ? Theme.font-md : Theme.font-lg;
|
||||
font-weight: Theme.weight-semibold;
|
||||
horizontal-stretch: 1;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: root.place.server;
|
||||
color: Theme.text-secondary;
|
||||
font-size: Theme.font-sm;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Button {
|
||||
small: root.compact;
|
||||
kind: root.place.open ? ButtonKind.secondary : ButtonKind.primary;
|
||||
icon: root.place.open ? Icons.arrow-right : Icons.log-in;
|
||||
text: root.place.connecting ? @tr("Connecting…") : root.place.open ? @tr("Open") : @tr("Join");
|
||||
enabled: !root.place.connecting;
|
||||
clicked => { Bridge.resume(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -889,8 +798,14 @@ component ActivityRow inherits Rectangle {
|
||||
|
||||
// The main column of the home page.
|
||||
export component HomePage inherits Rectangle {
|
||||
// The phone layout: one column with the messages and the activity.
|
||||
// The phone layout: one column with the messages and the servers.
|
||||
in property <bool> compact;
|
||||
// No server yet (or VOELIN_OPEN=first-run): the banner with Add a
|
||||
// Server, in place of where we were last and the mentions.
|
||||
property <bool> first-run: Bridge.servers.length == 0 || Nav.first-run;
|
||||
// Friends once: the bubbles where the right column with what friends
|
||||
// do is hidden.
|
||||
property <bool> bubbles: root.compact || !Nav.wide;
|
||||
// The column inside its padding; a friend's bubble and the gap after it.
|
||||
property <length> row-width: sv.visible-width - 2 * Theme.space-4;
|
||||
property <length> friend-gap: 6px;
|
||||
@@ -905,10 +820,26 @@ export component HomePage inherits Rectangle {
|
||||
padding: Theme.space-4;
|
||||
spacing: Theme.space-4;
|
||||
alignment: start;
|
||||
HomeBanner {
|
||||
if root.first-run: HomeBanner {
|
||||
compact: root.compact;
|
||||
}
|
||||
Section {
|
||||
if !root.first-run && Bridge.last-place.shown: ResumeCard {
|
||||
place: Bridge.last-place;
|
||||
compact: root.compact;
|
||||
}
|
||||
if !root.first-run && Bridge.home-mentions.length > 0: Section {
|
||||
text: @tr("Unread Mentions");
|
||||
icon: Icons.at-sign;
|
||||
action: @tr("See All");
|
||||
action-clicked => { Nav.notifications-open = true; }
|
||||
}
|
||||
if !root.first-run && Bridge.home-mentions.length > 0: VerticalLayout {
|
||||
spacing: Theme.space-1;
|
||||
for notice in Bridge.home-mentions: NoticeRow {
|
||||
notice: notice;
|
||||
}
|
||||
}
|
||||
if root.bubbles: Section {
|
||||
text: @tr("Friends Online");
|
||||
icon: Icons.users;
|
||||
action: @tr("View All ({})", Bridge.friends-online.length);
|
||||
@@ -918,13 +849,13 @@ export component HomePage inherits Rectangle {
|
||||
Nav.show(Page.friends);
|
||||
}
|
||||
}
|
||||
if Bridge.friends-online.length == 0: Text {
|
||||
if root.bubbles && Bridge.friends-online.length == 0: Text {
|
||||
text: @tr("No friends online. Add friends from a person's card on a server: they show up here, wherever they are.");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-sm;
|
||||
wrap: word-wrap;
|
||||
}
|
||||
if Bridge.friends-online.length > 0: HorizontalLayout {
|
||||
if root.bubbles && Bridge.friends-online.length > 0: HorizontalLayout {
|
||||
spacing: root.friend-gap;
|
||||
alignment: start;
|
||||
// On the desktop as many whole bubbles as fit (the rest
|
||||
@@ -1090,78 +1021,6 @@ export component HomePage inherits Rectangle {
|
||||
chat: chat;
|
||||
}
|
||||
}
|
||||
if root.compact: Section {
|
||||
text: @tr("Recent Activity");
|
||||
icon: Icons.zap;
|
||||
action: @tr("See All");
|
||||
action-clicked => { Nav.show(Page.friends); }
|
||||
}
|
||||
if root.compact: VerticalLayout {
|
||||
spacing: Theme.space-1;
|
||||
for friend in Bridge.friend-activity: ActivityRow {
|
||||
friend: friend;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A quick action of the right column: an icon, a title and what it does.
|
||||
component QuickAction inherits Rectangle {
|
||||
in property <image> icon;
|
||||
in property <string> title;
|
||||
in property <string> subtitle;
|
||||
callback clicked();
|
||||
height: 54px;
|
||||
border-radius: Theme.radius-md;
|
||||
background: touch.has-hover ? Theme.surface-3 : Theme.surface-2;
|
||||
border-width: 1px;
|
||||
border-color: Theme.border;
|
||||
accessible-role: AccessibleRole.button;
|
||||
accessible-label: title;
|
||||
accessible-description: subtitle;
|
||||
accessible-action-default => { 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;
|
||||
Rectangle {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
border-radius: 18px;
|
||||
background: Theme.accent-soft;
|
||||
Icon {
|
||||
source: root.icon;
|
||||
size: Theme.icon-md;
|
||||
tint: Theme.accent-text;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
Text {
|
||||
text: root.title;
|
||||
color: Theme.text;
|
||||
font-weight: Theme.weight-medium;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: root.subtitle;
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
Icon {
|
||||
source: Icons.chevron-right;
|
||||
size: Theme.icon-sm;
|
||||
tint: Theme.text-muted;
|
||||
y: (parent.height - self.height) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1262,32 +1121,6 @@ export component HomeAside inherits Rectangle {
|
||||
}
|
||||
}
|
||||
Divider { }
|
||||
Section {
|
||||
text: @tr("Quick Actions");
|
||||
}
|
||||
QuickAction {
|
||||
icon: Icons.user-plus;
|
||||
title: @tr("Find Friends");
|
||||
subtitle: @tr("Search your contacts");
|
||||
clicked => {
|
||||
Nav.friends-tab = 1;
|
||||
Bridge.friends-tab(1);
|
||||
Nav.show(Page.friends);
|
||||
}
|
||||
}
|
||||
QuickAction {
|
||||
icon: Icons.log-in;
|
||||
title: @tr("Join a Server");
|
||||
subtitle: @tr("Enter an address");
|
||||
clicked => { Nav.add-server(); }
|
||||
}
|
||||
QuickAction {
|
||||
icon: Icons.bookmark;
|
||||
title: @tr("Add a Server");
|
||||
subtitle: @tr("Save it for later");
|
||||
clicked => { Nav.add-server(); }
|
||||
}
|
||||
Divider { }
|
||||
Section {
|
||||
text: @tr("What's Happening");
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ 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 {
|
||||
// One conversation of the list (also the home sidebar's).
|
||||
export component ConversationRow inherits Rectangle {
|
||||
in property <ConversationItem> chat;
|
||||
height: 64px * Theme.font-scale;
|
||||
border-radius: Theme.radius-md;
|
||||
|
||||
@@ -7,8 +7,8 @@ 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, ScrollView } from "../components/index.slint";
|
||||
|
||||
// One notification.
|
||||
component NoticeRow inherits Rectangle {
|
||||
// One notification (also home's unread mentions).
|
||||
export component NoticeRow inherits Rectangle {
|
||||
in property <NoticeItem> notice;
|
||||
// Never shorter than its text, so a long list scrolls instead of
|
||||
// squeezing the rows.
|
||||
|
||||
Reference in new issue
Block a user