tree_space/ui/mod.rs
1//! GTK/relm4 layer: the panel window, toolbar and file tree.
2//!
3//! Layout of concerns:
4//!
5//! * [`app`] — the root [`relm4::SimpleComponent`]: owns the layer-shell
6//! window, the toolbar and tree subcomponents, the status bar and session
7//! state persistence.
8//! * [`bookmarks`] — the bookmarks strip docked above/below the panes, plus its
9//! editor dialog.
10//! * [`toolbar`] — the "open folder" button and the editable path entry.
11//! * [`tree`] — the file tree itself: rendering, keyboard navigation, the
12//! context menu, inline rename, clipboard and trash.
13//! * [`props`] — the Properties dialog (metadata and a permissions editor).
14
15pub mod app;
16pub mod bookmarks;
17pub mod props;
18pub mod toolbar;
19pub mod tree;
20
21/// The `wlr-layer-shell` namespace every tree-space surface advertises, so
22/// compositor rules can target the panel and its dialogs by name instead of the
23/// built-in `gtk4-layer-shell` default.
24pub(crate) const LAYER_NAMESPACE: &str = "tree-space";
25
26/// Pause and detach a `GtkVideo`'s media stream.
27///
28/// Detaching alone does not stop a clip: the `GtkMediaStream` (a
29/// `GtkMediaFile`) can outlive the widget — a row GTK has removed is freed
30/// lazily, and the media cache may still hold it — so it keeps its GStreamer
31/// pipeline, audio included, running even after the thumbnail is gone. Pausing
32/// first actually stops playback; detaching then releases the widget's
33/// reference.
34pub(crate) fn stop_video_stream(video: &relm4::gtk::Video) {
35 use relm4::gtk::prelude::*;
36 if let Some(stream) = video.media_stream() {
37 stream.set_playing(false);
38 }
39 video.set_media_stream(None::<&relm4::gtk::MediaStream>);
40}