pub enum UiLayout {
List,
Tooltip,
SelectionPanelLimitHeight,
SelectionPanelFull,
}
Expand description
Specifies the context in which the UI is used and the constraints it should follow.
Variants§
List
Display a short summary. Used in lists.
Keep it small enough to fit on half a row (i.e. the second column of a
re_ui::list_item::ListItem
with re_ui::list_item::PropertyContent
. Text should
truncate.
Tooltip
Display as much information as possible in a compact way. Used for hovering/tooltips.
Keep it under a half-dozen lines. Text may wrap. Avoid interactive UI. When using a table,
use the re_data_ui::table_for_ui_layout
function.
SelectionPanelLimitHeight
Display everything as wide as available but limit height. Used in the selection panel when multiple items are selected.
When displaying lists, wrap them in a height-limited [egui::ScrollArea
]. When using a
table, use the re_data_ui::table_for_ui_layout
function.
SelectionPanelFull
Display everything as wide as available, without height restriction. Used in the selection panel when a single item is selected.
The UI will be wrapped in a [egui::ScrollArea
], so data should be fully displayed with no
restriction. When using a table, use the re_data_ui::table_for_ui_layout
function.
Implementations§
source§impl UiLayout
impl UiLayout
sourcepub fn is_single_line(&self) -> bool
pub fn is_single_line(&self) -> bool
Should the UI fit on one line?
sourcepub fn is_selection_panel(self) -> bool
pub fn is_selection_panel(self) -> bool
Do we have a lot of vertical space?
sourcepub fn table(self, ui: &mut Ui) -> TableBuilder<'_>
pub fn table(self, ui: &mut Ui) -> TableBuilder<'_>
Build an egui table and configure it for the given UI layout.
Note that the caller is responsible for strictly limiting the number of displayed rows for
Self::List
and Self::Tooltip
, as the table will not scroll.
sourcepub fn label(self, ui: &mut Ui, text: impl Into<WidgetText>) -> Response
pub fn label(self, ui: &mut Ui, text: impl Into<WidgetText>) -> Response
Show a label while respecting the given UI layout.
Important: for label only, data should use UiLayout::data_label
instead.
sourcepub fn data_label(self, ui: &mut Ui, string: impl AsRef<str>) -> Response
pub fn data_label(self, ui: &mut Ui, string: impl AsRef<str>) -> Response
Show data while respecting the given UI layout.
Import: for data only, labels should use UiLayout::data_label
instead.
fn data_label_impl(self, ui: &mut Ui, string: &str) -> Response
Trait Implementations§
source§impl PartialEq for UiLayout
impl PartialEq for UiLayout
impl Copy for UiLayout
impl Eq for UiLayout
impl StructuralPartialEq for UiLayout
Auto Trait Implementations§
impl Freeze for UiLayout
impl RefUnwindSafe for UiLayout
impl Send for UiLayout
impl Sync for UiLayout
impl Unpin for UiLayout
impl UnwindSafe for UiLayout
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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.§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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request