pub struct MapSettings {
pub max_zoom: f32,
pub min_zoom: f32,
pub line_visible_zoom: f32,
pub label_visible_zoom: f32,
pub node_text_visibility: VisibilitySetting,
pub marker_animation: SteadyAnimation,
pub node_text_size: f32,
pub label_text_size: f32,
pub styles: Vec<Style>,
}Expand description
Configuration of a Map widget.
MapSettings::default() provides sensible zoom limits plus a light and a
dark theme; the widget picks the style to apply based on
egui::Visuals::dark_mode, using styles[0] in light mode and
styles[1] in dark mode.
Fields§
§max_zoom: f32Maximum zoom factor.
min_zoom: f32Minimum zoom factor.
line_visible_zoom: f32Zoom threshold above which connection lines become visible.
label_visible_zoom: f32Zoom threshold above which node names become visible when
node_text_visibility is
VisibilitySetting::Always.
node_text_visibility: VisibilitySettingControls when node names are displayed.
marker_animation: SteadyAnimationEffect drawn on nodes registered with
Map::update_marker.
Persistent, so it keeps the app repainting for as long as a marker
exists. Ignored when a NodeTemplate is installed.
Node state set through NodeHandle picks its own
effect per node and does not read this field.
node_text_size: f32Font size, in screen pixels, of the node names.
This is a screen-space size: it deliberately does not scale with the
zoom factor, so a name stays exactly as readable when the map is zoomed
all the way out as when it is zoomed in. Because the nodes pack closer
together as you zoom out while the names keep their size, names take up
proportionally more of the view down there — use
label_visible_zoom or
node_text_visibility to control when
they are worth showing at all.
label_text_size: f32Font size, in screen pixels, of the free-floating MapLabels.
Screen-space, exactly like node_text_size.
styles: Vec<Style>Per-mode styles; index 0 is used in light mode, index 1 in dark
mode. Their colors are kept in sync with the active
MapTheme – see
Map::set_theme – rather than set here.
Implementations§
Source§impl MapSettings
impl MapSettings
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates settings with all zoom thresholds set to 0.0 and a single
transparent style.
Prefer MapSettings::default() unless you really need to build the
configuration from scratch.
Trait Implementations§
Source§impl Clone for MapSettings
impl Clone for MapSettings
Source§fn clone(&self) -> MapSettings
fn clone(&self) -> MapSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MapSettings
impl Debug for MapSettings
Auto Trait Implementations§
impl Freeze for MapSettings
impl RefUnwindSafe for MapSettings
impl Send for MapSettings
impl Sync for MapSettings
impl Unpin for MapSettings
impl UnsafeUnpin for MapSettings
impl UnwindSafe for MapSettings
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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