voelin-ui: open the Stream Studio from the Share button
The studio had a button of its own in the top bar (and the phone's header), apart from the Share button. The Share buttons (the voice buttons on the desktop, Go Live on the phone) now open a small menu: "Share screen", the quick share of a screen or a window as before, or "Stream Studio". While a share runs they open its dialog directly, as before; while the studio is live, "Share screen" is off and the button shows the live state. The separate studio buttons are gone. Checked headless on the demo UI: the menu opens above the button, and each entry opens the share dialog or the studio. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
146502c9ca
commit
cacb023ccf
6 files changed
+68
-28
No files matched your search
@@ -9,6 +9,8 @@ import { Icon, Button, ButtonKind, IconButton, Avatar, Status, CountBadge, LiveB
|
||||
import { ServerHeader, ConnectActions, ChannelTree } from "channels.slint";
|
||||
import { StreamsPanel } from "streams.slint";
|
||||
import { VoiceCard, VoiceButtons } from "../shells/common.slint";
|
||||
import { StudioBridge } from "../studio-bridge.slint";
|
||||
import { ShareMenu } from "../share-menu.slint";
|
||||
|
||||
// Servers as a horizontal strip, the current server, its channels.
|
||||
export component MobileServers inherits VerticalLayout {
|
||||
@@ -166,11 +168,15 @@ export component YouPage inherits ScrollView {
|
||||
enabled: Bridge.voice-connected;
|
||||
clicked => { Bridge.set-output-muted(!Bridge.output-muted); }
|
||||
}
|
||||
if Bridge.streams-available && Bridge.can-share: ActionButton {
|
||||
icon: Icons.radio;
|
||||
text: Bridge.share-state == "live" ? @tr("Live") : @tr("Go Live");
|
||||
checked: Bridge.share-state == "live";
|
||||
clicked => { Nav.open-share(); }
|
||||
// A screen or the Stream Studio (ShareMenu).
|
||||
if Bridge.streams-available && Bridge.can-share: VerticalLayout {
|
||||
live := ActionButton {
|
||||
icon: Icons.radio;
|
||||
text: Bridge.share-state == "live" || StudioBridge.status.live ? @tr("Live") : @tr("Go Live");
|
||||
checked: Bridge.share-state == "live" || StudioBridge.status.live;
|
||||
clicked => { share-menu.open(0, - live.height - share-menu.menu-height - 4px); }
|
||||
}
|
||||
share-menu := ShareMenu { }
|
||||
}
|
||||
ActionButton {
|
||||
icon: Icons.phone-off;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// What a Share button opens: a quick share of a screen or a window (the
|
||||
// share dialog) or the Stream Studio. While a share runs it opens the share
|
||||
// dialog right away, to manage it.
|
||||
|
||||
import { Theme } from "theme.slint";
|
||||
import { Icons } from "icons.slint";
|
||||
import { PopupMenu } from "components/index.slint";
|
||||
import { Bridge } from "bridge.slint";
|
||||
import { StudioBridge } from "studio-bridge.slint";
|
||||
import { Nav } from "nav.slint";
|
||||
|
||||
export component ShareMenu inherits Rectangle {
|
||||
// The menu's height, to open it above a button.
|
||||
out property <length> menu-height: 2 * Theme.control-height + 2 * Theme.space-2 + 2px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
||||
// Open at (x, y), relative to this element.
|
||||
public function open(x: length, y: length) {
|
||||
if Bridge.share-state == "live" || Bridge.share-state == "starting" {
|
||||
Nav.open-share();
|
||||
} else {
|
||||
menu.show(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
menu := PopupMenu {
|
||||
menu-width: 220px;
|
||||
entries: [
|
||||
// The studio's stream takes the place of a simple share.
|
||||
{ text: @tr("Share screen"), icon: Icons.monitor-up, enabled: !StudioBridge.status.live },
|
||||
{ text: @tr("Stream Studio"), icon: Icons.radio, enabled: true },
|
||||
];
|
||||
activated(i) => {
|
||||
if i == 0 {
|
||||
Nav.open-share();
|
||||
} else {
|
||||
Nav.open-studio();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import { Theme } from "../theme.slint";
|
||||
import { Icons } from "../icons.slint";
|
||||
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";
|
||||
|
||||
// A rounded panel of the frame (sidebar, main area, right panel).
|
||||
@@ -131,12 +133,16 @@ export component VoiceButtons inherits HorizontalLayout {
|
||||
enabled: Bridge.voice-connected;
|
||||
clicked => { Bridge.set-output-muted(!Bridge.output-muted); }
|
||||
}
|
||||
if Bridge.streams-available && Bridge.can-share: IconButton {
|
||||
icon: Icons.monitor-up;
|
||||
label: Bridge.share-state == "live" ? @tr("Sharing") : @tr("Share screen");
|
||||
checked: Bridge.share-state == "live";
|
||||
size: root.size;
|
||||
clicked => { Nav.open-share(); }
|
||||
// A screen or window, or the Stream Studio (ShareMenu).
|
||||
if Bridge.streams-available && Bridge.can-share: VerticalLayout {
|
||||
IconButton {
|
||||
icon: Icons.monitor-up;
|
||||
label: Bridge.share-state == "live" ? @tr("Sharing") : StudioBridge.status.live ? @tr("Live in the Stream Studio") : @tr("Share or go live");
|
||||
checked: Bridge.share-state == "live" || StudioBridge.status.live;
|
||||
size: root.size;
|
||||
clicked => { share-menu.open(0, - root.size - share-menu.menu-height - 4px); }
|
||||
}
|
||||
share-menu := ShareMenu { }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.settings;
|
||||
|
||||
@@ -218,13 +218,6 @@ export component TopBar inherits Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.radio;
|
||||
label: @tr("Stream Studio");
|
||||
checked: Nav.page == Page.studio;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.open-studio(); }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.users;
|
||||
label: @tr("Members");
|
||||
|
||||
@@ -117,15 +117,6 @@ export component MobileShell inherits Rectangle {
|
||||
overflow: elide;
|
||||
}
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.radio;
|
||||
label: @tr("Stream Studio");
|
||||
round: true;
|
||||
filled: true;
|
||||
checked: Nav.page == Page.studio;
|
||||
y: (parent.height - self.height) / 2;
|
||||
clicked => { Nav.open-studio(); }
|
||||
}
|
||||
IconButton {
|
||||
icon: Icons.bell;
|
||||
label: @tr("Notifications");
|
||||
|
||||
+3
-1
@@ -149,7 +149,9 @@ Activity tab.
|
||||

|
||||
|
||||
The studio (mockups 09, 10 and the phone's 04) is a page of the main window
|
||||
(the radio button in the top bar), a window of its own (the button in its
|
||||
(the Share button's menu: "Share screen" for a quick share of a screen or
|
||||
window, "Stream Studio" for the studio; while a share runs the button opens
|
||||
its dialog), a window of its own (the button in its
|
||||
header; closing that window brings it back) and a phone page. Its controller
|
||||
is `src/studio.rs` on the engine's studio ([studio.md](studio.md)): the
|
||||
studio runs while it is shown, live or recording, and a `Streamer` started
|
||||
|
||||
Reference in new issue
Block a user