pub struct Style {
pub line_width: Option<f32>,
pub font: Option<FontId>,
pub background_color: Color32,
}Expand description
Visual style used to paint the map under a given theme.
Holds the non-palette visual configuration – stroke width, font,
background – that combines with the active MapTheme’s
ThemeColors when the widget paints. Style itself carries no color:
every color the widget paints with (node fill, connection lines, alerts,
selection, text) is resolved live from the installed MapTheme for the
current ColorMode – see Map::set_theme –
instead of living here as a copy that would need to be kept in sync.
Multiplying or dividing a Style by a number scales
line_width and the font size; the widget uses this
to scale the active style with the current zoom factor. Fields that are
None are left untouched by those operators.
Fields§
§line_width: Option<f32>Width of the connection lines between nodes; their color comes from
the active MapTheme’s ThemeColors::segment. None disables
the default stroke – a
SegmentTemplate or a segment
effect installed through Map::segment still
runs either way.
font: Option<FontId>Font used for map labels.
background_color: Color32Background color of the map canvas.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
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