pub struct Icon { /* private fields */ }Expand description
An icon, drawn as a square.
Implementations§
Source§impl Icon
impl Icon
Sourcepub const DEFAULT_SIZE: u32 = 16
pub const DEFAULT_SIZE: u32 = 16
The default size in logical pixels.
Sourcepub fn new(source: impl IntoProp<IconSource>) -> Icon
pub fn new(source: impl IntoProp<IconSource>) -> Icon
An icon showing source: an icon name (&str), a file (&Path or
PathBuf), an IconSource, or a closure that returns one.
Sourcepub fn size(self, size: impl IntoProp<u32>) -> Icon
pub fn size(self, size: impl IntoProp<u32>) -> Icon
Sets the width and height in logical pixels.
Sourcepub fn tint(self, tint: impl IntoProp<Option<Color>>) -> Icon
pub fn tint(self, tint: impl IntoProp<Option<Color>>) -> Icon
Paints the icon’s pixels in tint, keeping their alpha, as a
symbolic icon’s color follows the theme. None, the default, draws
it as it is.
Sourcepub fn visible(self, visible: impl IntoProp<bool>) -> Self
pub fn visible(self, visible: impl IntoProp<bool>) -> Self
Shows or hides the widget. Hidden, it is taken out of the layout, so its space goes to the others, and it isn’t drawn, hit or reached by Tab; it drops the keyboard focus and the pointer. Its bindings and state stay, so it shows again as it was. Shown by default.
Sourcepub fn geometry(self, geometry: Signal<Rect>) -> Self
pub fn geometry(self, geometry: Signal<Rect>) -> Self
Shares where the widget is: after each layout that moves or
resizes it, its laid-out rectangle in the window’s logical
pixels, scrolled with any scroll view around it but not moved by
a style’s translate, scale or rotate, is written to geometry. A
hidden widget writes nothing. An effect that reads it may change
the layout: the window is laid out again at once, until nothing
moves.