#[non_exhaustive]pub struct Theme {
pub bg_color: String,
pub default_font: String,
pub text_mode: TextMode,
pub ink: Option<String>,
pub panel_bg: Option<String>,
pub panel_border: Option<String>,
pub cursor_color: Option<String>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bg_color: String§default_font: String§text_mode: TextModeHow text is positioned. Tile (default) keeps the legacy Game Boy 8×8
per-glyph grid; Proportional renders at pixel precision with per-glyph
advance (for high-resolution, CJK-correct screens). The proportional path
also requires Painter::supports_proportional() — both must hold, so any
layout without an explicit theme (e.g. all pokered screens) stays on Tile.
ink: Option<String>Default ink colour for text/list/cursor when no element-level color is
set. None → the legacy INK_BLACK.
panel_bg: Option<String>Panel interior fill (for game-themed boxes drawn via pixel_rect).
panel_border: Option<String>Panel border colour.
cursor_color: Option<String>Cursor (▶) colour; None → the resolved ink.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn ink_color(&self) -> Rgba
pub fn ink_color(&self) -> Rgba
Resolve the ink colour: theme.ink if set, else the legacy INK_BLACK.
Sourcepub fn cursor_ink(&self) -> Rgba
pub fn cursor_ink(&self) -> Rgba
Resolve the cursor colour: theme.cursor_color, else ink, else INK_BLACK.
Sourcepub fn proportional(&self, painter_supports: bool) -> bool
pub fn proportional(&self, painter_supports: bool) -> bool
Whether to use the proportional path given the painter’s capability.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Theme
impl<'de> Deserialize<'de> for Theme
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.