Struct titanium::desktop::gui::libdruid::WindowConfig
pub struct WindowConfig { /* private fields */ }
Expand description
Window configuration that can be applied to a WindowBuilder, or to an existing WindowHandle. It does not include anything related to app data.
Implementations§
§impl WindowConfig
impl WindowConfig
pub fn window_size_policy(self, size_policy: WindowSizePolicy) -> WindowConfig
pub fn window_size_policy(self, size_policy: WindowSizePolicy) -> WindowConfig
Set the window size policy.
pub fn window_size(self, size: impl Into<Size>) -> WindowConfig
pub fn window_size(self, size: impl Into<Size>) -> WindowConfig
Set the window’s initial drawing area size in display points.
You can pass in a tuple (width, height)
or a Size
,
e.g. to create a window with a drawing area 1000dp wide and 500dp high:
window.window_size((1000.0, 500.0));
The actual window size in pixels will depend on the platform DPI settings.
This should be considered a request to the platform to set the size of the window. The platform might increase the size a tiny bit due to DPI.
pub fn with_min_size(self, size: impl Into<Size>) -> WindowConfig
pub fn with_min_size(self, size: impl Into<Size>) -> WindowConfig
Set the window’s minimum drawing area size in display points.
The actual minimum window size in pixels will depend on the platform DPI settings.
This should be considered a request to the platform to set the minimum size of the window. The platform might increase the size a tiny bit due to DPI.
To set the window’s initial drawing area size use window_size
.
pub fn resizable(self, resizable: bool) -> WindowConfig
pub fn resizable(self, resizable: bool) -> WindowConfig
Set whether the window should be resizable.
pub fn show_titlebar(self, show_titlebar: bool) -> WindowConfig
pub fn show_titlebar(self, show_titlebar: bool) -> WindowConfig
Set whether the window should have a titlebar and decorations.
pub fn set_position(self, position: Point) -> WindowConfig
pub fn set_position(self, position: Point) -> WindowConfig
Sets the window position in virtual screen coordinates.
position
Position in pixels.
pub fn set_level(self, level: WindowLevel) -> WindowConfig
pub fn set_level(self, level: WindowLevel) -> WindowConfig
Sets the WindowLevel
of the window
pub fn set_always_on_top(self, always_on_top: bool) -> WindowConfig
pub fn set_always_on_top(self, always_on_top: bool) -> WindowConfig
Sets whether the window is always on top.
An always on top window stays on top, even after clicking off of it.
pub fn set_window_state(self, state: WindowState) -> WindowConfig
pub fn set_window_state(self, state: WindowState) -> WindowConfig
Sets the WindowState
of the window.
pub fn transparent(self, transparent: bool) -> WindowConfig
pub fn transparent(self, transparent: bool) -> WindowConfig
Set whether the window background should be transparent
pub fn apply_to_builder(&self, builder: &mut WindowBuilder)
pub fn apply_to_builder(&self, builder: &mut WindowBuilder)
Apply this window configuration to the passed in WindowBuilder
pub fn apply_to_handle(&self, win_handle: &mut WindowHandle)
pub fn apply_to_handle(&self, win_handle: &mut WindowHandle)
Apply this window configuration to the passed in WindowHandle
Trait Implementations§
§impl Default for WindowConfig
impl Default for WindowConfig
§fn default() -> WindowConfig
fn default() -> WindowConfig
§impl PartialEq<WindowConfig> for WindowConfig
impl PartialEq<WindowConfig> for WindowConfig
§fn eq(&self, other: &WindowConfig) -> bool
fn eq(&self, other: &WindowConfig) -> bool
self
and other
values to be equal, and is used
by ==
.