pub struct Theme {Show 14 fields
pub colors: ThemeColor,
pub highlight_theme: Arc<HighlightTheme>,
pub light_theme: Rc<ThemeConfig>,
pub dark_theme: Rc<ThemeConfig>,
pub mode: ThemeMode,
pub font_family: SharedString,
pub font_size: Pixels,
pub radius: Pixels,
pub radius_lg: Pixels,
pub shadow: bool,
pub transparent: Hsla,
pub scrollbar_show: ScrollbarShow,
pub tile_grid_size: Pixels,
pub tile_shadow: bool,
}
Fields§
§colors: ThemeColor
§highlight_theme: Arc<HighlightTheme>
§light_theme: Rc<ThemeConfig>
§dark_theme: Rc<ThemeConfig>
§mode: ThemeMode
§font_family: SharedString
§font_size: Pixels
§radius: Pixels
Radius for the general elements.
radius_lg: Pixels
Radius for the large elements, e.g.: Modal, Notification border radius.
shadow: bool
§transparent: Hsla
§scrollbar_show: ScrollbarShow
Show the scrollbar mode, default: Scrolling
tile_grid_size: Pixels
Tile grid size, default is 4px.
tile_shadow: bool
The shadow of the tile panel.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn apply_config(&mut self, config: &Rc<ThemeConfig>)
pub fn apply_config(&mut self, config: &Rc<ThemeConfig>)
Apply the given theme configuration to the current theme.
Source§impl Theme
impl Theme
Sourcepub fn global_mut(cx: &mut App) -> &mut Theme
pub fn global_mut(cx: &mut App) -> &mut Theme
Returns the global theme mutable reference
Sourcepub fn theme_name(&self) -> &SharedString
pub fn theme_name(&self) -> &SharedString
Returns the current theme name.
Sourcepub fn sync_system_appearance(window: Option<&mut Window>, cx: &mut App)
pub fn sync_system_appearance(window: Option<&mut Window>, cx: &mut App)
Sync the theme with the system appearance
Sourcepub fn sync_scrollbar_appearance(cx: &mut App)
pub fn sync_scrollbar_appearance(cx: &mut App)
Sync the Scrollbar showing behavior with the system
pub fn change( mode: impl Into<ThemeMode>, window: Option<&mut Window>, cx: &mut App, )
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ThemeColor> for Theme
impl From<ThemeColor> for Theme
Source§fn from(colors: ThemeColor) -> Self
fn from(colors: ThemeColor) -> Self
Converts to this type from the input type.
Source§impl JsonSchema for Theme
impl JsonSchema for Theme
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref
keyword. Read moreimpl Global for Theme
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl !Send for Theme
impl !Sync for Theme
impl Unpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.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>
Converts
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>
Converts
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReadGlobal for Twhere
T: Global,
impl<T> ReadGlobal for Twhere
T: Global,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> UpdateGlobal for Twhere
T: Global,
impl<T> UpdateGlobal for Twhere
T: Global,
Source§fn update_global<C, F, R>(cx: &mut C, update: F) -> R
fn update_global<C, F, R>(cx: &mut C, update: F) -> R
Updates the global instance of the implementing type using the provided closure. Read more
Source§fn set_global<C>(cx: &mut C, global: T)where
C: BorrowAppContext,
fn set_global<C>(cx: &mut C, global: T)where
C: BorrowAppContext,
Set the global instance of the implementing type.