Skip to main content

FloatingWindow

Struct FloatingWindow 

Source
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

Source

pub const DEFAULT_SIZE: (u32, u32)

The default width and height in logical pixels.

Source

pub fn new() -> FloatingWindow

A visible, empty window of the default size.

Source

pub fn title(self, title: impl IntoProp<String>) -> FloatingWindow

Sets the title the compositor shows, as in a title bar or task list.

Source

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.

Source

pub fn height(self, height: impl IntoProp<u32>) -> FloatingWindow

Sets the height it asks for, in logical pixels.

Source

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.

Source

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.

Source

pub fn maximized(self, maximized: impl IntoProp<bool>) -> FloatingWindow

Sets whether it asks to fill the screen but for panels.

Source

pub fn fullscreen(self, fullscreen: impl IntoProp<bool>) -> FloatingWindow

Sets whether it asks to cover the whole screen.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn shortcuts_inhibited(self, signal: Signal<bool>) -> FloatingWindow

Has the compositor write whether it honors inhibit_shortcuts, as PanelWindow::shortcuts_inhibited does.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn child(self, child: impl Widget) -> FloatingWindow

Sets the window’s one child, which fills the window.

Trait Implementations§

Source§

impl Default for FloatingWindow

Source§

fn default() -> FloatingWindow

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more