WindowBuilderExt

Trait WindowBuilderExt 

Source
pub trait WindowBuilderExt {
Show 16 methods // Required methods fn as_modal(self, val: bool) -> Self; fn as_fullscreen(self, val: bool) -> Self; fn with_icon<T: ImageExt>(self, image: Option<T>) -> Self where Self: Sized; fn with_cursor(self, cursor: Cursor) -> Self; fn with_border(self, flag: bool) -> Self; unsafe fn with_region(self, region: Region) -> Self; fn with_size_range( self, min_w: i32, min_h: i32, max_w: i32, max_h: i32, ) -> Self; fn with_hotspot<W: WidgetExt>(self, w: &W) -> Self where Self: Sized; fn with_shape<I: ImageExt>(self, image: Option<I>) -> Self where Self: Sized; fn with_cursor_image(self, image: RgbImage, hot_x: i32, hot_y: i32) -> Self; fn with_default_cursor(self, cursor: Cursor) -> Self; fn with_screen_num(self, n: i32) -> Self; fn with_opacity(self, val: f64) -> Self; fn with_xclass(self, s: &str) -> Self; fn with_override(self) -> Self; fn with_force_position(self, flag: bool) -> Self;
}
Expand description

Adds builder pattern friendly versions of several setter functions

Required Methods§

Source

fn as_modal(self, val: bool) -> Self

Makes a window modal, should be called before show

Source

fn as_fullscreen(self, val: bool) -> Self

Makes a window fullscreen

Source

fn with_icon<T: ImageExt>(self, image: Option<T>) -> Self
where Self: Sized,

Sets the windows icon. Supported formats are bmp, jpeg, png and rgb.

Source

fn with_cursor(self, cursor: Cursor) -> Self

Sets the cursor style within the window. Needs to be called after the window is shown

Source

fn with_border(self, flag: bool) -> Self

Sets whether the window has a border

Source

unsafe fn with_region(self, region: Region) -> Self

Set the graphical draw region of the window

§Safety

The data must be valid.

Source

fn with_size_range(self, min_w: i32, min_h: i32, max_w: i32, max_h: i32) -> Self

Set the window’s minimum width, minimum height, max width and max height. You can pass 0 as max_w and max_h to allow unlimited upward resize of the window.

Source

fn with_hotspot<W: WidgetExt>(self, w: &W) -> Self
where Self: Sized,

Set the hotspot widget of the window

Source

fn with_shape<I: ImageExt>(self, image: Option<I>) -> Self
where Self: Sized,

Set the shape of the window. Supported image formats are BMP, RGB and Pixmap. The window covers non-transparent/non-black shape of the image. The image must not be scaled(resized) beforehand. The size will be adapted to the window’s size

Source

fn with_cursor_image(self, image: RgbImage, hot_x: i32, hot_y: i32) -> Self

Set the cursor image

Source

fn with_default_cursor(self, cursor: Cursor) -> Self

Set the window’s default cursor

Source

fn with_screen_num(self, n: i32) -> Self

Set the screen number

Source

fn with_opacity(self, val: f64) -> Self

Set the window’s opacity, Ranges from 0.0 to 1.0, where 1.0 is fully opaque and 0.0 is fully transparent. This should be called on a shown window. On X11, opacity support depends on the window manager and can be queried:

$ xprop -root _NET_SUPPORTED | grep -o _NET_WM_WINDOW_OPACITY
Source

fn with_xclass(self, s: &str) -> Self

Set the window’s XA_WM_CLASS property. This should be called before showing the window

Source

fn with_override(self) -> Self

removes the window border and sets the window on top, by settings the NOBORDER and OVERRIDE flags

Source

fn with_force_position(self, flag: bool) -> Self

Forces the position of the window

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<E> WindowBuilderExt for E
where E: WindowExt,