ui: streams pop out into a window of their own

Pop out now opens ViewerWindow: the player alone, titled with the
stream, which a pin keeps on top of other windows (always-on-top). The
main window goes on; the stream's card on the voice page says it plays
in its own window, with Bring back; closing the window brings it back
too, on the stream's server, and Leave closes it. Pictures go only to
the window that shows the player, so none is scaled twice; full screen
and the cursor follow that window.

The stream callbacks take a Bridge, the models attach to any Bridge,
the theme is copied to every window of its own, and one main-window
close handler, installed at start, closes the studio's and the stream's
windows (the studio installed its own before). Desktop only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AVRENKftQqGoEeswiR9TDQ
This commit is contained in:
Claude committed 2026-10-08 14:20:36 +00:00
1 parent d404cb06a7
commit a6caffa579
17 files changed
+468 -172

No files matched your search

+3 -3
View File
@@ -7,18 +7,18 @@ mod pages;
mod servers;
mod settings;
mod social;
mod streams;
pub(crate) mod streams;
pub(crate) mod studio;
use slint::ComponentHandle;
use crate::app::{MainWindow, StudioBridge};
use crate::app::{Bridge, MainWindow, StudioBridge};
/// Connect every callback of the window.
pub(crate) fn wire(ui: &MainWindow) {
servers::wire(ui);
chat::wire(ui);
streams::wire(ui);
streams::wire(&ui.global::<Bridge>());
settings::wire(ui);
emoji::wire(ui);
social::wire(ui);
+9 -11
View File
@@ -1,11 +1,9 @@
//! The streams panel, the share dialog and the viewer.
//! The streams panel, the share dialog and the viewer, for the main window
//! and for the viewer's own window (each has its own Bridge global).
use slint::ComponentHandle;
use crate::app::{Bridge, with_app};
use crate::app::{Bridge, MainWindow, with_app};
pub(super) fn wire(ui: &MainWindow) {
let bridge = ui.global::<Bridge>();
pub(crate) fn wire(bridge: &Bridge) {
bridge.on_open_share(|| with_app(|app| app.open_share()).unwrap_or_default());
bridge.on_start_share(|form| {
with_app(|app| app.start_share(form));
@@ -42,11 +40,11 @@ pub(super) fn wire(ui: &MainWindow) {
bridge.on_toggle_fullscreen(|| {
with_app(|app| app.toggle_fullscreen());
});
let window = ui.as_weak();
bridge.on_show_cursor(move |shown| {
if let Some(ui) = window.upgrade() {
crate::streams::show_cursor(ui.window(), shown);
}
bridge.on_pop_out_viewer(|out| {
with_app(|app| if out { app.viewer_pop_out() } else { app.viewer_dock() });
});
bridge.on_show_cursor(|shown| {
with_app(|app| app.viewer_cursor(shown));
});
bridge.on_set_stream_quality(|index| {
with_app(|app| app.set_stream_quality(index));