pub struct WindowConfBuilder { /* private fields */ }Expand description
A builder method for WindowConf.
Implementations§
Source§impl WindowConfBuilder
impl WindowConfBuilder
Sourcepub fn width<I: Into<Dimension>>(&mut self, width: I) -> &mut Self
pub fn width<I: Into<Dimension>>(&mut self, width: I) -> &mut Self
Defines the widget width in pixels, fullscreen width or pecentage width of full screen. On setting values greater than the provided pixels of monitor, the widget offsets from monitor’s rectangular monitor space. It is important to note that the value should be the maximum width the widget will ever attain, not the current width in case of resizeable widgets. This value has full screen width as its default.
Sourcepub fn height<I: Into<Dimension>>(&mut self, height: I) -> &mut Self
pub fn height<I: Into<Dimension>>(&mut self, height: I) -> &mut Self
Defines the widget height in pixels, fullscreen width or pecentage height of full screen. On setting values greater than the provided pixels of monitor, the widget offsets from monitor’s rectangular monitor space. It is important to note that the value should be the maximum height the widget will ever attain, not the current height in case of resizeable widgets. This value has full screen height as its default.
Sourcepub fn anchor_1(&mut self, anchor: Anchor) -> &mut Self
pub fn anchor_1(&mut self, anchor: Anchor) -> &mut Self
Defines the first anchor to which the window needs to be attached. View
Anchor for related explaination of usage. If all values are None,
then widget is displayed in the center of screen.
Sourcepub fn anchor_2(&mut self, anchor: Anchor) -> &mut Self
pub fn anchor_2(&mut self, anchor: Anchor) -> &mut Self
Defines the second anchor to which the window needs to be attached. View
Anchor for related explaination of usage. If all values are None,
then widget is displayed in the center of screen.
Sourcepub fn anchor_3(&mut self, anchor: Anchor) -> &mut Self
pub fn anchor_3(&mut self, anchor: Anchor) -> &mut Self
Defines the third anchor to which the window needs to be attached. View
Anchor for related explaination of usage. If all values are None,
then widget is displayed in the center of screen.
Sourcepub fn anchor_4(&mut self, anchor: Anchor) -> &mut Self
pub fn anchor_4(&mut self, anchor: Anchor) -> &mut Self
Defines the fourth anchor to which the window needs to be attached. View
Anchor for related explaination of usage. If all values are None,
then widget is displayed in the center of screen.
Sourcepub fn margins(
&mut self,
top: i32,
right: i32,
bottom: i32,
left: i32,
) -> &mut Self
pub fn margins( &mut self, top: i32, right: i32, bottom: i32, left: i32, ) -> &mut Self
Defines the margin of widget from monitor edges, negative values make the
widget go outside of monitor pixels if anchored to some edge(s). Otherwise,
the widget moves to the opposite direction to the given pixels. Defaults to
0 for all sides.
Sourcepub fn layer_type(&mut self, layer: Layer) -> &mut Self
pub fn layer_type(&mut self, layer: Layer) -> &mut Self
Defines the possible layer on which to define the widget. View Layer
for more details. Defaults to Layer::Top.
Sourcepub fn board_interactivity(&mut self, board: KeyboardInteractivity) -> &mut Self
pub fn board_interactivity(&mut self, board: KeyboardInteractivity) -> &mut Self
Defines the relation of widget with Keyboard. View KeyboardInteractivity
for more details. Defauts to KeyboardInteractivity::None
Sourcepub fn exclusive_zone(&mut self, dimension: i32) -> &mut Self
pub fn exclusive_zone(&mut self, dimension: i32) -> &mut Self
Defines if the widget is exclusive of not, if not set, defaults to None, else sets to number of pixels to set as exclusive zone as i32. Defaults to no exclusive zone (i.e. None as mentioned).
Sourcepub fn monitor(&mut self, name: String) -> &mut Self
pub fn monitor(&mut self, name: String) -> &mut Self
Defines the monitor name on which to spawn the window. It is necessary to set this value if a percentage dimention is given to either width or height; When no monitor is provided, the window is spawned on the default monitor.
Sourcepub fn natural_scroll(&mut self, scroll: bool) -> &mut Self
pub fn natural_scroll(&mut self, scroll: bool) -> &mut Self
Defines if the method of scrolling for the widget should be natural or reverse. Defaults to reverse scrolling. Learn more about scrolling types here.
Sourcepub fn build(&self) -> Result<WindowConf, Box<dyn Error>>
pub fn build(&self) -> Result<WindowConf, Box<dyn Error>>
Creates an instnce of WindowConf with the provided configurations.
This function result in an error if width and height are not set or they
are set to zero or monitor is not specified when full or percentage dimension is used.
Trait Implementations§
Source§impl Default for WindowConfBuilder
impl Default for WindowConfBuilder
Source§fn default() -> WindowConfBuilder
fn default() -> WindowConfBuilder
Auto Trait Implementations§
impl Freeze for WindowConfBuilder
impl RefUnwindSafe for WindowConfBuilder
impl Send for WindowConfBuilder
impl Sync for WindowConfBuilder
impl Unpin for WindowConfBuilder
impl UnsafeUnpin for WindowConfBuilder
impl UnwindSafe for WindowConfBuilder
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.