pub enum Titlebar {
Standard,
Medium,
Tall,
}Expand description
How tall the titlebar strip is under Chrome::Custom (backlog
W22): on macOS where the traffic lights sit in it, and everywhere the
height widgets::titlebar draws at.
On macOS the lights are AppKit’s to place: a taller titlebar is AppKit’s own taller one, made by giving the window an empty toolbar, and AppKit keeps the lights in it through resizing, fullscreen and focus. Measured on macOS 27, the strip about the lights and the close button’s top-left corner:
| strip | lights at | |
|---|---|---|
Standard | 32 | (9, 9) |
Medium | 40 | (12, 13) |
Tall | 52 | (19, 19) |
The numbers are the OS’s, and moved between releases before; what the
window got is env.window.native_controls, measured,
widgets::titlebar lays out against it, and the window’s
titlebar_h metric is the measured height too, Standard included.
On Windows and Linux the strip under custom chrome is the app’s, as
tall as the titlebar_h metric: Medium and Tall make that
window’s platform height 40 and 52 (Titlebar::strip_h) in place
of the caption’s 32 or 34, so ui.metrics().titlebar_h, $titlebar_h
and the drawn buttons, which grow to the strip, all read it. An app’s
own metrics keep it while their titlebar_h is the stock number
(Metrics::compact(), Node’s base); a number of the app’s own wins
(Core::set_platform_titlebar_h).
Nothing under Chrome::Native or Chrome::Borderless, on a
popup or on the devtools’ window.
Variants§
Standard
The titlebar a window without a toolbar has (the default).
Medium
A compact toolbar’s (NSWindowToolbarStyle::UnifiedCompact).
Tall
A full toolbar’s (NSWindowToolbarStyle::Unified).
Implementations§
Source§impl Titlebar
impl Titlebar
Sourcepub const NAMES: [&'static str; 3]
pub const NAMES: [&'static str; 3]
Every name Titlebar::from_name reads, in order.
Trait Implementations§
impl Copy for Titlebar
impl Eq for Titlebar
impl StructuralPartialEq for Titlebar
Auto Trait Implementations§
impl Freeze for Titlebar
impl RefUnwindSafe for Titlebar
impl Send for Titlebar
impl Sync for Titlebar
impl Unpin for Titlebar
impl UnsafeUnpin for Titlebar
impl UnwindSafe for Titlebar
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.