Struct WindowControls
pub struct WindowControls {
pub pill: Rect,
pub minimize: Rect,
pub maximize: Rect,
pub close: Rect,
}Expand description
Where each control sits, and the pill behind them; Rect::ZERO for one
the window doesn’t offer.
Fields§
§pill: RectThe glass pill around every control: the window’s own, not a control’s, so it never changes with hover, press or focus.
minimize: RectThe window of the app’s own, on a desktop that leaves its frame to the app, is the one control a Tilo window has no state for.
maximize: Rect§close: RectImplementations§
§impl WindowControls
impl WindowControls
pub fn lay_out(row: Rect) -> WindowControls
pub fn lay_out(row: Rect) -> WindowControls
The controls at the trailing end of row, centred on its centre
line, inside one pill.
pub fn lay_out_own_window(row: Rect) -> WindowControls
pub fn lay_out_own_window(row: Rect) -> WindowControls
The controls of a window the app draws the frame of itself (a desktop that leaves decorations to the client): minimize joins maximize and close, in the order desktops put them.
pub fn without_close(self) -> WindowControls
pub fn without_close(self) -> WindowControls
The controls of a window this person may not close (someone else’s, or one they only watch): no close, and the pill closes around the one control left.
pub fn around(bar: Rect, controls: Rect) -> Rect
pub fn around(bar: Rect, controls: Rect) -> Rect
The pill around any window’s own controls, laid out on bar: as tall as a bar control
with the pill’s padding, centred on the bar’s centre line, from controls’ leading
edge less the padding to its trailing edge less the window’s own inset. Rect::ZERO
for no controls.
pub fn content_limit(&self, row: Rect) -> f64
pub fn content_limit(&self, row: Rect) -> f64
Where the controls begin, less the gap anything before them keeps; the row’s trailing edge for none.
pub fn iter(&self) -> impl Iterator<Item = (WindowControl, Rect)>
pub fn hit(&self, p: Point) -> Option<WindowControl>
pub fn on_pill(&self, p: Point) -> bool
pub fn on_pill(&self, p: Point) -> bool
Whether p is on the pill at all: the window’s own chrome, covering
the padding around the controls.
pub fn offset(&mut self, shift: Vec2)
pub fn paint(
&self,
scene: &mut Scene,
transform: Affine,
theme: &Theme,
state: ControlsState,
)
pub fn paint( &self, scene: &mut Scene, transform: Affine, theme: &Theme, state: ControlsState, )
Paint the pill and its controls.
Trait Implementations§
§impl Clone for WindowControls
impl Clone for WindowControls
§fn clone(&self) -> WindowControls
fn clone(&self) -> WindowControls
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for WindowControls
impl Debug for WindowControls
§impl Default for WindowControls
impl Default for WindowControls
§fn default() -> WindowControls
fn default() -> WindowControls
§impl PartialEq for WindowControls
impl PartialEq for WindowControls
impl Copy for WindowControls
impl StructuralPartialEq for WindowControls
Auto Trait Implementations§
impl Freeze for WindowControls
impl RefUnwindSafe for WindowControls
impl Send for WindowControls
impl Sync for WindowControls
impl Unpin for WindowControls
impl UnsafeUnpin for WindowControls
impl UnwindSafe for WindowControls
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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> 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