[−][src]Trait kas::theme::SizeHandle
Handle passed to objects during draw and sizing operations
Required methods
fn outer_frame(&self) -> (Size, Size)
Size of a frame around child widget(s)
Returns (top_left, bottom_right)
dimensions as two Size
s.
fn inner_margin(&self) -> Size
The margin around content within a widget
This area may be used to draw focus indicators.
fn outer_margin(&self) -> Size
The margin between UI elements, where desired
fn line_height(&self, class: TextClass) -> u32
The height of a line of text
fn text_bound(
&mut self,
text: &str,
class: TextClass,
multi_line: bool,
axis: AxisInfo
) -> SizeRules
&mut self,
text: &str,
class: TextClass,
multi_line: bool,
axis: AxisInfo
) -> SizeRules
Get a text label size bound
Sizing requirements of DrawHandle::text
.
Since only a subset of TextProperties
fields are required, these are
passed directly.
fn button_surround(&self) -> (Size, Size)
Size of the sides of a button.
Includes each side (as in outer_frame
), minus the content area (to be added separately).
fn edit_surround(&self) -> (Size, Size)
Size of the sides of an edit box.
Includes each side (as in outer_frame
), minus the content area (to be added separately).
fn checkbox(&self) -> Size
Size of the element drawn by DrawHandle::checkbox
.
This element is not scalable (except by DPI).
fn scrollbar(&self) -> (u32, u32, u32)
Dimensions for a scrollbar
Returns three components:
thickness
: scroll-bar width (for vertical scroll bars)min_handle_len
: minimum length for the handlemin_len
: minimum length for the whole bar
Generally, one expects min_len
is significantly greater than
min_handle_len
(so that some movement is always possible).
It is required that min_len >= min_handle_len
.