ui: a slimmer top bar, and the bell's panel under the bell
The top bar repeated what the rail and the pages show: the logo and the app name, the page's name, a members button that only worked on the server page, and About. It now holds the search, starting over the main panel, and the bell, in 44 px (taller only when large text makes its controls taller). The members button moved into the voice channel's header, as the chat's header has one; About stays in Settings and on the phone. The Stream Studio already names itself in its preview's header. The bell's panel opens under the bell instead of 100 px to its left, and is as tall as its notices up to 560 px: a ScrollView of all the rows (at most 100) replaces the ListView that stretched to the full height. A notice is never shorter than its text, so a long list scrolls instead of squeezing the rows. The user card loses its settings gear, which the rail has too (VoiceButtons gets `gear` for the call bar to come); its avatar and name are a button to Settings > My Account. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AVRENKftQqGoEeswiR9TDQ
This commit is contained in:
9 files changed
+125
-109
No files matched your search
@@ -135,7 +135,6 @@ export component MainWindow inherits Window {
|
||||
if !Bridge.myts.prompt && !root.chrome: StreamViewer { }
|
||||
|
||||
if !Bridge.myts.prompt && !Nav.narrow && root.chrome: DesktopShell {
|
||||
context: Nav.page == Page.settings ? @tr("Settings") : Nav.page == Page.studio ? @tr("Stream Studio") : "";
|
||||
if Nav.page == Page.home: Sidebar {
|
||||
HomeNav { }
|
||||
}
|
||||
@@ -331,17 +330,18 @@ export component MainWindow inherits Window {
|
||||
}
|
||||
}
|
||||
|
||||
// The bell's panel, under the bell (the phone: the whole width).
|
||||
// The bell's panel, under the bell (the phone: the whole width), as
|
||||
// tall as its notices up to 560 px.
|
||||
if !Bridge.myts.prompt && (Nav.notifications-open): Rectangle {
|
||||
background: Theme.scrim-light;
|
||||
TouchArea {
|
||||
clicked => { Nav.notifications-open = false; }
|
||||
}
|
||||
NotificationsPanel {
|
||||
x: Nav.narrow ? 8px : parent.width - self.width - 100px;
|
||||
x: Nav.narrow ? 8px : parent.width - self.width - Theme.space-4;
|
||||
y: Nav.narrow ? 64px : Theme.topbar-height;
|
||||
width: Nav.narrow ? parent.width - 16px : 400px;
|
||||
height: min(parent.height - self.y - 16px, 560px);
|
||||
height: min(parent.height - self.y - 16px, 560px, self.preferred-height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { ServerHeader, ConnectActions, ChannelTree } from "channels.slint";
|
||||
import { StreamsPanel } from "streams.slint";
|
||||
import { PinsDrawer, TopicsDrawer } from "drawers.slint";
|
||||
import { MembersPanel } from "members.slint";
|
||||
import { VoiceCard, VoiceButtons } from "../shells/common.slint";
|
||||
import { VoiceCard } from "../shells/common.slint";
|
||||
import { StudioBridge } from "../studio-bridge.slint";
|
||||
import { ShareMenu } from "../share-menu.slint";
|
||||
|
||||
|
||||
@@ -5,12 +5,14 @@ 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";
|
||||
import { Icon, Button, ButtonKind, IconButton, Avatar, Status, Chip, CountBadge, TextField, Kbd, Divider, ScrollView } from "../components/index.slint";
|
||||
|
||||
// One notification.
|
||||
component NoticeRow inherits Rectangle {
|
||||
in property <NoticeItem> notice;
|
||||
min-height: 64px;
|
||||
// Never shorter than its text, so a long list scrolls instead of
|
||||
// squeezing the rows.
|
||||
min-height: max(64px, body.preferred-height);
|
||||
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;
|
||||
@@ -24,7 +26,7 @@ component NoticeRow inherits Rectangle {
|
||||
Nav.notifications-open = false;
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
body := HorizontalLayout {
|
||||
padding: Theme.space-3;
|
||||
spacing: Theme.space-3;
|
||||
VerticalLayout {
|
||||
@@ -229,11 +231,17 @@ export component NotificationsPanel inherits Rectangle {
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
// All the rows (there are at most 100), so the panel can be as
|
||||
// tall as they are; it scrolls when they need more room.
|
||||
if Bridge.notifications.length > 0: list := ScrollView {
|
||||
vertical-stretch: 1;
|
||||
min-height: Bridge.notifications.length > 0 ? 200px : 0px;
|
||||
for notice in Bridge.notifications: NoticeRow {
|
||||
notice: notice;
|
||||
preferred-height: rows.preferred-height;
|
||||
min-height: min(rows.preferred-height, 200px);
|
||||
rows := VerticalLayout {
|
||||
width: list.visible-width;
|
||||
for notice in Bridge.notifications: NoticeRow {
|
||||
notice: notice;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +250,13 @@ export component VoiceView inherits VerticalLayout {
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.copy(Bridge.invite()); }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.users;
|
||||
label: @tr("Members");
|
||||
checked: Nav.right-panel-open && !Nav.pins-open && !Nav.topics-open;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.toggle-members(); }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.message-square;
|
||||
label: @tr("Chat only");
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Bridge } from "../bridge.slint";
|
||||
import { Nav, SettingsSection } from "../nav.slint";
|
||||
import { StudioBridge } from "../studio-bridge.slint";
|
||||
import { ShareMenu } from "../share-menu.slint";
|
||||
import { Icon, IconButton, Avatar, Status } from "../components/index.slint";
|
||||
import { Icon, IconButton, FocusRing, Avatar, Status } from "../components/index.slint";
|
||||
|
||||
// A rounded panel of the frame (sidebar, main area, right panel).
|
||||
export component Panel inherits Rectangle {
|
||||
@@ -123,9 +123,11 @@ export component VoiceCard inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// Mute, deafen, share, settings.
|
||||
// Mute, deafen, share, and with `gear` the voice settings.
|
||||
export component VoiceButtons inherits HorizontalLayout {
|
||||
in property <length> size: 34px;
|
||||
// The rail has the settings; the user card leaves them out.
|
||||
in property <bool> gear: false;
|
||||
spacing: Theme.space-1;
|
||||
IconButton {
|
||||
icon: Bridge.input-muted ? Icons.mic-off : Icons.mic;
|
||||
@@ -156,7 +158,7 @@ export component VoiceButtons inherits HorizontalLayout {
|
||||
}
|
||||
share-menu := ShareMenu { }
|
||||
}
|
||||
IconButton {
|
||||
if root.gear: IconButton {
|
||||
icon: Icons.settings;
|
||||
label: @tr("Settings");
|
||||
size: root.size;
|
||||
@@ -165,6 +167,7 @@ export component VoiceButtons inherits HorizontalLayout {
|
||||
}
|
||||
|
||||
// The primary app profile, with current server voice status and controls.
|
||||
// The avatar and the name open Settings › Account.
|
||||
export component UserCard inherits Rectangle {
|
||||
min-height: 60px;
|
||||
border-radius: Theme.radius-lg;
|
||||
@@ -173,42 +176,76 @@ export component UserCard inherits Rectangle {
|
||||
accessible-label: @tr("You");
|
||||
HorizontalLayout {
|
||||
padding: Theme.space-2;
|
||||
padding-left: Theme.space-3;
|
||||
spacing: Theme.space-3;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Avatar {
|
||||
size: 38px;
|
||||
initials: Bridge.myts.signed-in || Bridge.nickname != "" ? "" : "?";
|
||||
// The server's avatar for us, else the account's.
|
||||
image: Bridge.own-avatar.width > 0 ? Bridge.own-avatar : Bridge.myts.avatar;
|
||||
tint: Theme.accent;
|
||||
label: Bridge.primary-name;
|
||||
// Green ring while our voice goes out.
|
||||
speaking: Bridge.transmitting;
|
||||
status: Bridge.voice-connected ? Status.online : Bridge.observing ? Status.info : Status.offline;
|
||||
Icon {
|
||||
source: Icons.user;
|
||||
size: 20px;
|
||||
tint: #ffffff;
|
||||
visible: (Bridge.myts.signed-in || Bridge.nickname != "") && Bridge.own-avatar.width == 0 && Bridge.myts.avatar.width == 0;
|
||||
spacing: Theme.space-2;
|
||||
profile := Rectangle {
|
||||
horizontal-stretch: 1;
|
||||
border-radius: Theme.radius-md;
|
||||
background: profile-touch.pressed ? Theme.surface-4 : profile-touch.has-hover ? Theme.surface-3 : transparent;
|
||||
accessible-role: AccessibleRole.button;
|
||||
accessible-label: @tr("Your profile");
|
||||
accessible-description: Bridge.primary-name;
|
||||
accessible-action-default => { Nav.open-settings(SettingsSection.account); }
|
||||
FocusRing {
|
||||
shown: profile-focus.has-focus;
|
||||
w: profile.width;
|
||||
h: profile.height;
|
||||
}
|
||||
profile-focus := FocusScope {
|
||||
key-pressed(event) => {
|
||||
if event.text == " " || event.text == "\n" {
|
||||
Nav.open-settings(SettingsSection.account);
|
||||
return accept;
|
||||
}
|
||||
reject
|
||||
}
|
||||
profile-touch := TouchArea {
|
||||
mouse-cursor: MouseCursor.pointer;
|
||||
clicked => {
|
||||
profile-focus.focus();
|
||||
Nav.open-settings(SettingsSection.account);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
Text {
|
||||
text: Bridge.primary-name;
|
||||
color: Theme.text;
|
||||
font-weight: Theme.weight-semibold;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.voice-connected ? @tr("Online") : Bridge.observing ? @tr("Observing") : @tr("Offline");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
overflow: elide;
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-2;
|
||||
padding-right: Theme.space-2;
|
||||
spacing: Theme.space-3;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Avatar {
|
||||
size: 38px;
|
||||
initials: Bridge.myts.signed-in || Bridge.nickname != "" ? "" : "?";
|
||||
// The server's avatar for us, else the account's.
|
||||
image: Bridge.own-avatar.width > 0 ? Bridge.own-avatar : Bridge.myts.avatar;
|
||||
tint: Theme.accent;
|
||||
label: Bridge.primary-name;
|
||||
// Green ring while our voice goes out.
|
||||
speaking: Bridge.transmitting;
|
||||
status: Bridge.voice-connected ? Status.online : Bridge.observing ? Status.info : Status.offline;
|
||||
Icon {
|
||||
source: Icons.user;
|
||||
size: 20px;
|
||||
tint: #ffffff;
|
||||
visible: (Bridge.myts.signed-in || Bridge.nickname != "") && Bridge.own-avatar.width == 0 && Bridge.myts.avatar.width == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
horizontal-stretch: 1;
|
||||
Text {
|
||||
text: Bridge.primary-name;
|
||||
color: Theme.text;
|
||||
font-weight: Theme.weight-semibold;
|
||||
overflow: elide;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.voice-connected ? @tr("Online") : Bridge.observing ? @tr("Observing") : @tr("Offline");
|
||||
color: Theme.text-muted;
|
||||
font-size: Theme.font-xs;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
VoiceButtons { }
|
||||
|
||||
@@ -163,46 +163,24 @@ export component ServerRail inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// The bar at the top: the app name and page, search, notifications.
|
||||
// The bar at the top: the search over the main panel, the bell at the
|
||||
// right.
|
||||
export component TopBar inherits Rectangle {
|
||||
in property <string> context;
|
||||
height: Theme.topbar-height;
|
||||
accessible-role: AccessibleRole.banner;
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-4;
|
||||
// Where the main panel starts: the panels below have a space-3
|
||||
// margin and gap around the sidebar.
|
||||
padding-left: Theme.sidebar-width + 2 * Theme.space-3;
|
||||
padding-right: Theme.space-4;
|
||||
spacing: Theme.space-4;
|
||||
HorizontalLayout {
|
||||
width: Theme.sidebar-width - Theme.space-4;
|
||||
spacing: Theme.space-3;
|
||||
Image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
source: Icons.logo;
|
||||
}
|
||||
Text {
|
||||
text: Bridge.app-name;
|
||||
color: Theme.text;
|
||||
font-size: Theme.font-xl;
|
||||
font-weight: Theme.weight-semibold;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
if root.context != "": Text {
|
||||
text: root.context;
|
||||
color: Theme.accent-text;
|
||||
font-size: Theme.font-md;
|
||||
vertical-alignment: center;
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
horizontal-stretch: 1;
|
||||
alignment: center;
|
||||
// Opens the search (Ctrl+K does too).
|
||||
Rectangle {
|
||||
max-width: 680px;
|
||||
height: 40px;
|
||||
height: Theme.control-height;
|
||||
y: (parent.height - self.height) / 2;
|
||||
SearchBox {
|
||||
read-only: true;
|
||||
@@ -223,28 +201,6 @@ export component TopBar inherits Rectangle {
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.notifications-open = !Nav.notifications-open; }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.users;
|
||||
label: @tr("Members");
|
||||
checked: Nav.right-panel-open && !Nav.pins-open && !Nav.topics-open && Nav.page == Page.server;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => {
|
||||
Nav.show(Page.server);
|
||||
Nav.toggle-members();
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
width: 1px;
|
||||
height: 24px;
|
||||
y: (parent.height - self.height) / 2;
|
||||
background: Theme.border-strong;
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.help;
|
||||
label: @tr("About {}", Bridge.app-name);
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.open-about(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,14 +224,11 @@ export component Sidebar inherits Panel {
|
||||
|
||||
// The frame: rail | (top bar / panels).
|
||||
export component DesktopShell inherits Rectangle {
|
||||
in property <string> context;
|
||||
background: Theme.backdrop;
|
||||
HorizontalLayout {
|
||||
ServerRail { }
|
||||
VerticalLayout {
|
||||
TopBar {
|
||||
context: root.context;
|
||||
}
|
||||
TopBar { }
|
||||
HorizontalLayout {
|
||||
padding-left: Theme.space-3;
|
||||
padding-right: Theme.space-3;
|
||||
|
||||
@@ -139,7 +139,8 @@ export global Theme {
|
||||
// Shell dimensions.
|
||||
out property <length> rail-width: 72px;
|
||||
out property <length> sidebar-width: 264px * max(1.0, font-scale);
|
||||
out property <length> topbar-height: 56px;
|
||||
// Taller only when large text makes the controls in it taller.
|
||||
out property <length> topbar-height: max(44px, control-height + space-3);
|
||||
out property <length> right-panel-min: 220px;
|
||||
|
||||
// Motion.
|
||||
|
||||
Reference in new issue
Block a user