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
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn monitor(&self, monitor: impl IntoVar<MonitorQuery>)
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
impl DefaultStyle
Sourcepub fn state(&self, state: impl IntoVar<WindowState>)
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
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn icon(&self, icon: impl IntoVar<WindowIcon>)
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
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn auto_size_origin(&self, auto_size_origin: impl IntoVar<Point>)
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
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn always_on_top(&self, always_on_top: impl IntoVar<bool>)
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
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn taskbar_visible(&self, taskbar_visible: impl IntoVar<bool>)
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
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn color_scheme(&self, color_scheme: impl IntoVar<Option<ColorScheme>>)
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
impl DefaultStyle
Sourcepub fn accent_color(&self, accent_color: impl IntoVar<Option<LightDark>>)
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
impl DefaultStyle
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
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn frame_capture_mode(
&self,
frame_capture_mode: impl IntoVar<FrameCaptureMode>,
)
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
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn min_height(&self, min_height: impl IntoVar<Length>)
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
impl DefaultStyle
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn max_height(&self, max_height: impl IntoVar<Length>)
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
impl DefaultStyle
Sourcepub fn clear_color(&self, color: impl IntoVar<Rgba>)
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
impl DefaultStyle
Sourcepub fn prefer_custom_chrome(&self, prefer: impl IntoVar<bool>)
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
impl DefaultStyle
Sourcepub fn custom_chrome_adorner_fn(
&self,
custom_chrome: impl IntoVar<WidgetFn<()>>,
)
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
impl DefaultStyle
Sourcepub fn custom_chrome_padding_fn(&self, padding: impl IntoVar<SideOffsets>)
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
impl DefaultStyle
Sourcepub fn widget_new() -> DefaultStyle
pub fn widget_new() -> DefaultStyle
Start building a new instance.
Sourcepub fn widget_type() -> WidgetType
pub fn widget_type() -> WidgetType
Gets the widget type info.
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn safe_padding(&self, padding: impl IntoVar<SideOffsets>)
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
impl DefaultStyle
Sourcepub fn start_position(&self, position: impl IntoValue<StartPosition>)
pub fn start_position(&self, position: impl IntoValue<StartPosition>)
B Defines how the window is positioned when it first opens.
Source§impl DefaultStyle
impl DefaultStyle
Sourcepub fn allow_transparency(&self, allow: impl IntoValue<bool>)
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>§
Sourcepub fn widget_build(&mut self) -> StyleBuilder
pub fn widget_build(&mut self) -> StyleBuilder
Build the style.
Sourcepub fn replace(&self, replace: impl IntoValue<bool>)
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.
Sourcepub fn named_style_fn(&self, name: impl IntoValue<NamedStyleVar>)
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>§
Sourcepub fn widget_builder(&mut self) -> &mut WidgetBuilder
pub fn widget_builder(&mut self) -> &mut WidgetBuilder
Returns a mutable reference to the widget builder.
Sourcepub fn widget_when(&mut self) -> Option<&mut WhenInfo>
pub fn widget_when(&mut self) -> Option<&mut WhenInfo>
Returns a mutable reference to the when block if called inside a when block.
Sourcepub fn widget_take(&mut self) -> WidgetBuilder
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.
Sourcepub fn widget_build(&mut self) -> WidgetBuilder
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.
Sourcepub fn widget_importance(&mut self) -> &mut Importance
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.
Sourcepub fn start_when_block(
&mut self,
inputs: Box<[WhenInput]>,
state: Var<bool>,
expr: &'static str,
location: SourceLocation,
)
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.
Sourcepub fn end_when_block(&mut self)
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
impl Deref for DefaultStyle
Source§impl DerefMut for DefaultStyle
impl DerefMut for DefaultStyle
Auto Trait Implementations§
impl !Freeze for DefaultStyle
impl !RefUnwindSafe for DefaultStyle
impl Send for DefaultStyle
impl !Sync for DefaultStyle
impl !Unpin for DefaultStyle
impl !UnwindSafe for DefaultStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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