pub struct FloatingWindow { /* private fields */ }Expand description
A window like an application’s, which the compositor places, tiles or
floats: a launcher, a settings panel, a picture viewer. Show one with
cx.floating from the crabshell crate. Every property takes a value
or a closure.
use crabshell_ui::{FloatingWindow, Text};
let about = FloatingWindow::new()
.title("About")
.width(320)
.height(200)
.child(Text::new("hello"));Implementations§
Source§impl FloatingWindow
impl FloatingWindow
Sourcepub const DEFAULT_SIZE: (u32, u32)
pub const DEFAULT_SIZE: (u32, u32)
The default width and height in logical pixels.
Sourcepub fn new() -> FloatingWindow
pub fn new() -> FloatingWindow
A visible, empty window of the default size.
Sourcepub fn title(self, title: impl IntoProp<String>) -> FloatingWindow
pub fn title(self, title: impl IntoProp<String>) -> FloatingWindow
Sets the title the compositor shows, as in a title bar or task list.
Sourcepub fn width(self, width: impl IntoProp<u32>) -> FloatingWindow
pub fn width(self, width: impl IntoProp<u32>) -> FloatingWindow
Sets the width it asks for, in logical pixels. The compositor may give it another, as when tiling it.
Sourcepub fn height(self, height: impl IntoProp<u32>) -> FloatingWindow
pub fn height(self, height: impl IntoProp<u32>) -> FloatingWindow
Sets the height it asks for, in logical pixels.
Sourcepub fn min_size(self, size: impl IntoProp<(u32, u32)>) -> FloatingWindow
pub fn min_size(self, size: impl IntoProp<(u32, u32)>) -> FloatingWindow
Sets the smallest size the user may make it, as (width, height);
0 leaves a side free.
Sourcepub fn max_size(self, size: impl IntoProp<(u32, u32)>) -> FloatingWindow
pub fn max_size(self, size: impl IntoProp<(u32, u32)>) -> FloatingWindow
Sets the largest size the user may make it, as (width, height);
0 leaves a side free.
Sourcepub fn maximized(self, maximized: impl IntoProp<bool>) -> FloatingWindow
pub fn maximized(self, maximized: impl IntoProp<bool>) -> FloatingWindow
Sets whether it asks to fill the screen but for panels.
Sourcepub fn fullscreen(self, fullscreen: impl IntoProp<bool>) -> FloatingWindow
pub fn fullscreen(self, fullscreen: impl IntoProp<bool>) -> FloatingWindow
Sets whether it asks to cover the whole screen.
Sourcepub fn visible(self, visible: impl IntoProp<bool>) -> FloatingWindow
pub fn visible(self, visible: impl IntoProp<bool>) -> FloatingWindow
Sets whether it is shown. Hidden, it has no surface at all; shown again, it is a new window to the compositor.
Sourcepub fn mask(self, mask: impl IntoProp<Option<Region>>) -> FloatingWindow
pub fn mask(self, mask: impl IntoProp<Option<Region>>) -> FloatingWindow
Sets the part of the window that takes pointer input, as
PanelWindow::mask does: clicks outside
it reach whatever is below, and None, the default, is the whole
window.
Sourcepub fn blur(self, region: impl IntoProp<Option<Region>>) -> FloatingWindow
pub fn blur(self, region: impl IntoProp<Option<Region>>) -> FloatingWindow
Asks the compositor to blur what is behind this part of the window,
as PanelWindow::blur does.
Sourcepub fn inhibit_idle(self, inhibit: impl IntoProp<bool>) -> FloatingWindow
pub fn inhibit_idle(self, inhibit: impl IntoProp<bool>) -> FloatingWindow
Keeps the screen from idling while true and the window is shown,
as PanelWindow::inhibit_idle
does.
Sourcepub fn inhibit_shortcuts(self, inhibit: impl IntoProp<bool>) -> FloatingWindow
pub fn inhibit_shortcuts(self, inhibit: impl IntoProp<bool>) -> FloatingWindow
Takes the compositor’s shortcuts while true and the window has the
keyboard, as
PanelWindow::inhibit_shortcuts
does.
Sourcepub fn shortcuts_inhibited(self, signal: Signal<bool>) -> FloatingWindow
pub fn shortcuts_inhibited(self, signal: Signal<bool>) -> FloatingWindow
Has the compositor write whether it honors inhibit_shortcuts, as
PanelWindow::shortcuts_inhibited
does.
Sourcepub fn focus_grab(self, signal: Signal<bool>) -> FloatingWindow
pub fn focus_grab(self, signal: Signal<bool>) -> FloatingWindow
Holds the focus while signal is true, with the other windows
given it, as PanelWindow::focus_grab
does.
Sourcepub fn compositor_opacity(self, opacity: impl IntoProp<f32>) -> FloatingWindow
pub fn compositor_opacity(self, opacity: impl IntoProp<f32>) -> FloatingWindow
Sets the opacity the compositor shows the whole window at, blur
included, as
PanelWindow::compositor_opacity
does.
Sourcepub fn visible_mask(
self,
region: impl IntoProp<Option<Region>>,
) -> FloatingWindow
pub fn visible_mask( self, region: impl IntoProp<Option<Region>>, ) -> FloatingWindow
Tells the compositor which part of the window holds anything to
see, as PanelWindow::visible_mask
does.
Sourcepub fn on_close(self, handler: impl Fn(&Cx) + 'static) -> FloatingWindow
pub fn on_close(self, handler: impl Fn(&Cx) + 'static) -> FloatingWindow
Runs handler when the user or compositor asks the window to close,
as with a title bar’s close button. Without one, the window hides
until visible turns false and true again.
Sourcepub fn style(self, style: impl IntoProp<Style>) -> FloatingWindow
pub fn style(self, style: impl IntoProp<Style>) -> FloatingWindow
Sets the window’s style. Its color and font are inherited by every
Text in it that doesn’t set its own.
Sourcepub fn child(self, child: impl Widget) -> FloatingWindow
pub fn child(self, child: impl Widget) -> FloatingWindow
Sets the window’s one child, which fills the window.