WindowDrawnDecorations
struct · ferroui-controls · v0.5.0
struct WindowDrawnDecorations
Manages client-side window decorations (app-drawn window frame).
This is a logical element that holds the decorations template and properties. The host of the top-level extracts the overlay, underlay and popover visuals from the template content and inserts them into its own visual tree.
Pseudo-classes: :normal, :maximized, :fullscreen, :has-shadow,
:has-border, :has-titlebar, :has-maximize, :has-fullscreen,
:has-minimize, :has-close, :has-title.
Members
TYPEto_refPC_NORMALPC_MAXIMIZEDPC_FULLSCREENPC_HAS_SHADOWPC_HAS_BORDERPC_HAS_TITLEBARPC_HAS_MAXIMIZEPC_HAS_FULLSCREENPC_HAS_MINIMIZEPC_HAS_CLOSEPC_HAS_TITLEPART_CLOSE_BUTTONPART_MINIMIZE_BUTTONPART_MAXIMIZE_BUTTONPART_FULL_SCREEN_BUTTONPART_POPOVER_CLOSE_BUTTONPART_POPOVER_FULL_SCREEN_BUTTONPART_TITLE_BARtemplate_propertydefault_title_bar_height_propertydefault_frame_thickness_propertydefault_shadow_thickness_propertytitle_bar_height_propertyframe_thickness_propertyshadow_thickness_propertyhas_shadow_propertyhas_border_propertyhas_title_bar_propertytitle_propertytitle_bar_decorations_propertyconstructnewrender_scalingset_render_scalingtemplateset_templatedefault_title_bar_heightset_default_title_bar_heightdefault_frame_thicknessset_default_frame_thicknessdefault_shadow_thicknessset_default_shadow_thicknesstitle_bar_height_overrideset_title_bar_height_overrideframe_thickness_overrideset_frame_thickness_overrideshadow_thickness_overrideset_shadow_thickness_overridetitleset_titleget_title_bar_decorationsset_title_bar_decorationstitle_bar_decorationsset_own_title_bar_decorationscaption_buttons_widthcontenttitle_bar_heightframe_thicknessshadow_thicknesshas_shadowhas_borderhas_title_bar
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<WindowDrawnDecorations>
Returns a strong reference to this object.
PC_NORMAL
const PC_NORMAL: &'static str
PC_MAXIMIZED
const PC_MAXIMIZED: &'static str
PC_FULLSCREEN
const PC_FULLSCREEN: &'static str
PC_HAS_SHADOW
const PC_HAS_SHADOW: &'static str
PC_HAS_BORDER
const PC_HAS_BORDER: &'static str
PC_HAS_TITLEBAR
const PC_HAS_TITLEBAR: &'static str
PC_HAS_MAXIMIZE
const PC_HAS_MAXIMIZE: &'static str
PC_HAS_FULLSCREEN
const PC_HAS_FULLSCREEN: &'static str
PC_HAS_MINIMIZE
const PC_HAS_MINIMIZE: &'static str
PC_HAS_CLOSE
const PC_HAS_CLOSE: &'static str
PC_HAS_TITLE
const PC_HAS_TITLE: &'static str
PART_CLOSE_BUTTON
const PART_CLOSE_BUTTON: &'static str
PART_MINIMIZE_BUTTON
const PART_MINIMIZE_BUTTON: &'static str
PART_MAXIMIZE_BUTTON
const PART_MAXIMIZE_BUTTON: &'static str
PART_FULL_SCREEN_BUTTON
const PART_FULL_SCREEN_BUTTON: &'static str
PART_POPOVER_CLOSE_BUTTON
const PART_POPOVER_CLOSE_BUTTON: &'static str
PART_POPOVER_FULL_SCREEN_BUTTON
const PART_POPOVER_FULL_SCREEN_BUTTON: &'static str
PART_TITLE_BAR
const PART_TITLE_BAR: &'static str
template_property
fn template_property() -> &'static StyledProperty<Option<Rc<dyn IWindowDrawnDecorationsTemplate>>>
Defines the Template property.
default_title_bar_height_property
fn default_title_bar_height_property() -> &'static StyledProperty<f64>
Defines the DefaultTitleBarHeight property.
default_frame_thickness_property
fn default_frame_thickness_property() -> &'static StyledProperty<Thickness>
Defines the DefaultFrameThickness property.
default_shadow_thickness_property
fn default_shadow_thickness_property() -> &'static StyledProperty<Thickness>
Defines the DefaultShadowThickness property.
title_bar_height_property
fn title_bar_height_property() -> &'static DirectProperty<WindowDrawnDecorations, f64>
Defines the TitleBarHeight property.
frame_thickness_property
fn frame_thickness_property() -> &'static DirectProperty<WindowDrawnDecorations, Thickness>
Defines the FrameThickness property.
shadow_thickness_property
fn shadow_thickness_property() -> &'static DirectProperty<WindowDrawnDecorations, Thickness>
Defines the ShadowThickness property.
has_shadow_property
fn has_shadow_property() -> &'static DirectProperty<WindowDrawnDecorations, bool>
Defines the HasShadow property.
has_border_property
fn has_border_property() -> &'static DirectProperty<WindowDrawnDecorations, bool>
Defines the HasBorder property.
has_title_bar_property
fn has_title_bar_property() -> &'static DirectProperty<WindowDrawnDecorations, bool>
Defines the HasTitleBar property.
title_property
fn title_property() -> &'static StyledProperty<Option<String>>
Defines the Title property.
title_bar_decorations_property
fn title_bar_decorations_property() -> &'static AttachedProperty<TitleBarDecorations>
Defines the TitleBarDecorations attached property.
construct
fn construct() -> Self
Field initialisation only.
new
fn new() -> Ref<Self>
render_scaling
fn render_scaling(self: &Self) -> f64
The current render scaling factor used for pixel-aligning decoration geometry (title bar height, frame/shadow thickness).
set_render_scaling
fn set_render_scaling(self: &Self, value: f64)
template
fn template(self: &Self) -> Option<Rc<dyn IWindowDrawnDecorationsTemplate>>
The decorations template.
set_template
fn set_template(self: &Self, value: Option<Rc<dyn IWindowDrawnDecorationsTemplate>>)
default_title_bar_height
fn default_title_bar_height(self: &Self) -> f64
The theme-set default titlebar height.
set_default_title_bar_height
fn set_default_title_bar_height(self: &Self, value: f64)
default_frame_thickness
fn default_frame_thickness(self: &Self) -> Thickness
The theme-set default frame thickness.
set_default_frame_thickness
fn set_default_frame_thickness(self: &Self, value: Thickness)
default_shadow_thickness
fn default_shadow_thickness(self: &Self) -> Thickness
The theme-set default shadow thickness.
set_default_shadow_thickness
fn set_default_shadow_thickness(self: &Self, value: Thickness)
title_bar_height_override
fn title_bar_height_override(self: &Self) -> f64
The titlebar height override. When -1, falls back to
default_title_bar_height.
set_title_bar_height_override
fn set_title_bar_height_override(self: &Self, value: f64)
frame_thickness_override
fn frame_thickness_override(self: &Self) -> Option<Thickness>
The frame thickness override. When set, takes precedence over
default_frame_thickness.
set_frame_thickness_override
fn set_frame_thickness_override(self: &Self, value: Option<Thickness>)
shadow_thickness_override
fn shadow_thickness_override(self: &Self) -> Option<Thickness>
The shadow thickness override. When set, takes precedence over
default_shadow_thickness.
set_shadow_thickness_override
fn set_shadow_thickness_override(self: &Self, value: Option<Thickness>)
title
fn title(self: &Self) -> Option<String>
The window title displayed in the decorations. Mirrors the value set on the host window.
set_title
fn set_title(self: &Self, value: Option<String>)
get_title_bar_decorations
fn get_title_bar_decorations(element: &StyledElement) -> TitleBarDecorations
Gets which title bar elements to display.
set_title_bar_decorations
fn set_title_bar_decorations(element: &StyledElement, value: TitleBarDecorations)
Sets which title bar elements to display.
Set this property on a window to control the elements displayed in its drawn title bar.
title_bar_decorations
fn title_bar_decorations(self: &Self) -> TitleBarDecorations
Which title bar elements are requested to be displayed. Mirrors the value set on the host window.
set_own_title_bar_decorations
fn set_own_title_bar_decorations(self: &Self, value: TitleBarDecorations)
Sets which title bar elements are requested to be displayed on these
decorations (the instance property; the associated function
set_title_bar_decorations is the
attached property setter).
caption_buttons_width
fn caption_buttons_width(self: &Self) -> f64
The built template content.
The width the visible caption buttons (minimize, maximize, full screen, close) take at the
right of the title bar, from the left edge of the leftmost of them to the right edge of the
decorations; 0 without a visible caption button. Not in upstream: the caption-button inset
of a TitleBar drawn in the title bar of the window (WinUI's AppWindowTitleBar.RightInset).
content
fn content(self: &Self) -> Option<Ref<WindowDrawnDecorationsContent>>
title_bar_height
fn title_bar_height(self: &Self) -> f64
The effective titlebar height, resolving a -1 override to the default. 0 if the titlebar part is disabled.
frame_thickness
fn frame_thickness(self: &Self) -> Thickness
The effective frame thickness: the override if explicitly set, otherwise the default. Zero if the border part is disabled.
shadow_thickness
fn shadow_thickness(self: &Self) -> Thickness
The effective shadow thickness: the override if explicitly set, otherwise the default. Zero if the shadow part is disabled.
has_shadow
fn has_shadow(self: &Self) -> bool
Whether the shadow decoration part is enabled.
has_border
fn has_border(self: &Self) -> bool
Whether the border decoration part is enabled.
has_title_bar
fn has_title_bar(self: &Self) -> bool
Whether the title bar decoration part is enabled.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtStyledElementImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<WindowDrawnDecorations>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplFerroObjectImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.