pub struct WindowSpec {
pub id: WindowId,
pub title: String,
pub size: Option<Vec2>,
pub min_size: Option<Vec2>,
pub shell_bars: bool,
pub centre_dock: bool,
}Expand description
What a window opens with.
Fields§
§id: WindowId§title: StringThe first title, until the content sets its own.
size: Option<Vec2>The inner size at its first opening (a saved size wins).
min_size: Option<Vec2>§shell_bars: boolDraws the main window’s bars in this window too
(WindowSpec::shell_bars).
centre_dock: boolIts middle is its centre area, as the main window’s is
(WindowSpec::centre_dock).
Implementations§
Source§impl WindowSpec
impl WindowSpec
pub fn new(id: impl Into<String>, title: impl Into<String>) -> Self
Sourcepub fn shell_bars(self, on: bool) -> Self
pub fn shell_bars(self, on: bool) -> Self
The window shows the main window’s bars, as VS Code’s windows do:
its title bar holds the zones::CAPTION_START zone (the
application’s menu button and name, its logo), and the main menu
(app.main) is drawn under it when the application has a menu
bar (AppBuilder::menu_bar). The menus are evaluated and run in
this window’s context (appWindow): a command whose when holds
only in another window is greyed, its tooltip naming that window.
Embedded in the main window (no windows of their own), the main
window’s bars are already above it: none is drawn.
Sourcepub fn centre_dock(self, on: bool) -> Self
pub fn centre_dock(self, on: bool) -> Self
The window’s middle is its centre area’s dock, as the main
window’s is: the panels docked in its centre take the whole middle,
between its sides and above its bottom, and the window draws no
content of its own (the content given at opening is not called).
The centre is drawn even with no panel in it, saying so, a target
for a tab dropped there. A window of panels around panels, a home
window for a set of them.
Without it (the default), the window’s content keeps the start of the middle and its centre’s panels go beside it, once one is placed there.
pub fn size(self, size: impl Into<Vec2>) -> Self
pub fn min_size(self, size: impl Into<Vec2>) -> Self
Trait Implementations§
Source§impl Clone for WindowSpec
impl Clone for WindowSpec
Source§fn clone(&self) -> WindowSpec
fn clone(&self) -> WindowSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowSpec
impl Debug for WindowSpec
Source§impl PartialEq for WindowSpec
impl PartialEq for WindowSpec
impl StructuralPartialEq for WindowSpec
Auto Trait Implementations§
impl Freeze for WindowSpec
impl RefUnwindSafe for WindowSpec
impl Send for WindowSpec
impl Sync for WindowSpec
impl Unpin for WindowSpec
impl UnsafeUnpin for WindowSpec
impl UnwindSafe for WindowSpec
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> 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> 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