DefaultStyle

Struct DefaultStyle 

Source
pub struct DefaultStyle(/* private fields */);
Expand description

W Default window style.

See also register_style_fn for how to set a style for all windows in the app.

Implementations§

Source§

impl DefaultStyle

Source

pub fn position(&self, position: impl IntoVar<Point>)

P Binds the position window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn monitor(&self, monitor: impl IntoVar<MonitorQuery>)

P Binds the monitor window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn state(&self, state: impl IntoVar<WindowState>)

P Binds the state window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn size(&self, size: impl IntoVar<Size>)

P Binds the size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn min_size(&self, min_size: impl IntoVar<Size>)

P Binds the min_size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn max_size(&self, max_size: impl IntoVar<Size>)

P Binds the max_size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn font_size(&self, font_size: impl IntoVar<Length>)

P Binds the font_size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn chrome(&self, chrome: impl IntoVar<bool>)

P Binds the chrome window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn icon(&self, icon: impl IntoVar<WindowIcon>)

P Binds the icon window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn title(&self, title: impl IntoVar<Txt>)

P Binds the title window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn auto_size(&self, auto_size: impl IntoVar<AutoSize>)

P Binds the auto_size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn auto_size_origin(&self, auto_size_origin: impl IntoVar<Point>)

P Binds the auto_size_origin window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn resizable(&self, resizable: impl IntoVar<bool>)

P Binds the resizable window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn movable(&self, movable: impl IntoVar<bool>)

P Binds the movable window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn always_on_top(&self, always_on_top: impl IntoVar<bool>)

P Binds the always_on_top window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn visible(&self, visible: impl IntoVar<bool>)

P Binds the visible window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn taskbar_visible(&self, taskbar_visible: impl IntoVar<bool>)

P Binds the taskbar_visible window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn parent(&self, parent: impl IntoVar<Option<WindowId>>)

P Binds the parent window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn modal(&self, modal: impl IntoVar<bool>)

P Binds the modal window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn color_scheme(&self, color_scheme: impl IntoVar<Option<ColorScheme>>)

P Binds the color_scheme window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn accent_color(&self, accent_color: impl IntoVar<Option<LightDark>>)

P Binds the accent_color window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn enabled_buttons(&self, enabled_buttons: impl IntoVar<WindowButton>)

P Binds the enabled_buttons window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn parallel(&self, parallel: impl IntoVar<Parallel>)

P Binds the parallel window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn frame_capture_mode( &self, frame_capture_mode: impl IntoVar<FrameCaptureMode>, )

P Binds the frame_capture_mode window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn x(&self, x: impl IntoVar<Length>)

P Binds the x of the position window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn y(&self, y: impl IntoVar<Length>)

P Binds the y of the position window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn width(&self, width: impl IntoVar<Length>)

P Binds the width of the size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn height(&self, height: impl IntoVar<Length>)

P Binds the height of the size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn min_width(&self, min_width: impl IntoVar<Length>)

P Binds the width of the min_size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn min_height(&self, min_height: impl IntoVar<Length>)

P Binds the height of the min_size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn max_width(&self, max_width: impl IntoVar<Length>)

P Binds the width of the max_size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn max_height(&self, max_height: impl IntoVar<Length>)

P Binds the height of the max_size window var with the property value.

The binding is bidirectional and the window variable is assigned on init.

Source§

impl DefaultStyle

Source

pub fn clear_color(&self, color: impl IntoVar<Rgba>)

P Window clear color.

Color used to clear the previous frame pixels before rendering a new frame. It is visible if window content does not completely fill the content area, this can happen if you do not set a background or the background is semi-transparent, also can happen during very fast resizes.

Source§

impl DefaultStyle

Source

pub fn prefer_custom_chrome(&self, prefer: impl IntoVar<bool>)

P Gets if WINDOWS.system_chrome prefers custom chrome.

Note that you must set chrome to false when using this to provide a custom chrome.

Source§

impl DefaultStyle

Source

pub fn custom_chrome_adorner_fn( &self, custom_chrome: impl IntoVar<WidgetFn<()>>, )

P Adorner property specific for custom chrome overlays.

This property behaves exactly like adorner_fn. Using it instead of adorner frees the adorner property for other usage in the window instance or in derived window types.

Note that you can also set the custom_chrome_padding_fn to ensure that the content is not hidden behind the adorner.

Source§

impl DefaultStyle

Source

pub fn custom_chrome_padding_fn(&self, padding: impl IntoVar<SideOffsets>)

P Extra padding for window content in windows that display a custom_chrome_adorner_fn.

Source§

impl DefaultStyle

Source

pub fn widget_new() -> Self

Start building a new instance.

Source

pub fn widget_type() -> WidgetType

Gets the widget type info.

Source§

impl DefaultStyle

Source

pub fn safe_padding(&self, padding: impl IntoVar<SideOffsets>)

P Padding required to avoid physical screen obstructions.

By default this is WINDOW.vars().safe_padding() that is defined by the operating system. You can unset this property to implement your own unsafe area handling.

Source§

impl DefaultStyle

Source

pub fn start_position(&self, position: impl IntoValue<StartPosition>)

B Defines how the window is positioned when it first opens.

Source§

impl DefaultStyle

Source

pub fn allow_transparency(&self, allow: impl IntoValue<bool>)

B If semi-transparent content is see-through, mixing with the operating system pixels behind the window.

Note that to actually see behind the window you must set the clear_color and background_color to a transparent color. The composition is a simple alpha blend, effects like blur do not apply to the pixels behind the window.

Methods from Deref<Target = Style>§

Source

pub fn widget_build(&mut self) -> StyleBuilder

Build the style.

Source

pub fn replace(&self, replace: impl IntoValue<bool>)

B Fully replace the contextual style.

This is not enabled by default, if set to true the contextual style properties are removed.

Source

pub fn named_style_fn(&self, name: impl IntoValue<NamedStyleVar>)

B Set in the default properties of a named style to define the contextual variable for that style.

During widget instantiation, if this is set by default in a style the contextual style is used as the defaults and only the properties set on the style instance replace them.

This property is part of the named styles pattern, see impl_named_style_fn! for more details.

Note that this property expects a ContextVar<StyleFn> as a value, not a variable directly, it will also only work if set in the default properties of a style type.

Methods from Deref<Target = NonWidgetBase>§

Source

pub fn widget_builder(&mut self) -> &mut WidgetBuilder

Returns a mutable reference to the widget builder.

Source

pub fn widget_when(&mut self) -> Option<&mut WhenInfo>

Returns a mutable reference to the when block if called inside a when block.

Source

pub fn widget_take(&mut self) -> WidgetBuilder

Takes the widget builder, finishing the widget macro build.

After this call trying to set a property using self will panic, the returned builder can still be manipulated directly.

Source

pub fn widget_build(&mut self) -> WidgetBuilder

Finishes the build.

This is the fallback build that simply returns the builder, inheritors should override this method.

Source

pub fn widget_importance(&mut self) -> &mut Importance

Returns a mutable reference to the importance of the next property assigns, unsets or when blocks.

Note that during the widget_intrinsic call this is Importance::WIDGET and after it is Importance::INSTANCE.

Source

pub fn start_when_block( &mut self, inputs: Box<[WhenInput]>, state: Var<bool>, expr: &'static str, location: SourceLocation, )

Start building a when block, all properties set after this call are pushed in the when block.

Source

pub fn end_when_block(&mut self)

End the current when block, all properties set after this call are pushed in the widget.

Trait Implementations§

Source§

impl Deref for DefaultStyle

Source§

type Target = Style

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for DefaultStyle

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

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.

§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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