pub struct IconTheme {
pub key: Option<KeyRef>,
pub data: IconThemeData,
pub child: WidgetRef,
}Expand description
Controls the default properties of icons in a widget subtree.
The icon theme is honored by Icon and ImageIcon widgets.
Fields§
§key: Option<KeyRef>See InheritedWidget::key.
data: IconThemeDataThe set of properties to use for icons in this subtree.
child: WidgetRefThe widget below this widget in the tree.
Implementations§
Source§impl IconTheme
impl IconTheme
Sourcepub fn new<K>(data: IconThemeData, child: impl IntoWidget<K>) -> IconTheme
pub fn new<K>(data: IconThemeData, child: impl IntoWidget<K>) -> IconTheme
Creates an icon theme that controls properties of descendant widgets.
Sourcepub fn merge<K>(
key: Option<KeyRef>,
data: IconThemeData,
child: impl IntoWidget<K>,
) -> WidgetRef
pub fn merge<K>( key: Option<KeyRef>, data: IconThemeData, child: impl IntoWidget<K>, ) -> WidgetRef
Creates an icon theme that controls the properties of descendant widgets, and merges in the current icon theme, if any.
Sourcepub fn of(app: &mut App, context: BuildContext) -> IconThemeData
pub fn of(app: &mut App, context: BuildContext) -> IconThemeData
The data from the closest instance of this class that encloses the given context, if any.
If there is no ambient icon theme, defaults to IconThemeData::fallback. The
returned IconThemeData is concrete (all values are non-null; see
IconThemeData::is_concrete). Any properties on the ambient icon theme that are
null get defaulted to the values specified on IconThemeData::fallback.
The Theme widget from the material library introduces an IconTheme widget set
to the ThemeData.iconTheme, so in a Material Design application, this will typically
default to the icon theme from the ambient Theme.
Typical usage is as follows:
let theme = IconTheme::of(app, context);Trait Implementations§
Source§impl InheritedTheme for IconTheme
impl InheritedTheme for IconTheme
Source§impl InheritedWidget for IconTheme
impl InheritedWidget for IconTheme
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn update_should_notify(&self, old_widget: &IconTheme) -> bool
fn update_should_notify(&self, old_widget: &IconTheme) -> bool
Source§fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
this is InheritedTheme: an inherited widget that is an InheritedTheme
answers with itself, which is what InheritedTheme::capture collects.Auto Trait Implementations§
impl !RefUnwindSafe for IconTheme
impl !Send for IconTheme
impl !Sync for IconTheme
impl !UnwindSafe for IconTheme
impl Forget for IconTheme
impl Freeze for IconThemewhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Shadow>: Freeze,
*const RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for IconTheme
impl Unpin for IconThemewhere
Rc<dyn Key>: Unpin,
&'static dyn ColorExtension: Unpin,
Rc<dyn ColorExtension>: Unpin,
*const u8 is !null: Unpin,
Rc<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>: Unpin,
Rc<dyn Widget>: Unpin,
impl UnsafeUnpin for IconThemewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Shadow>: UnsafeUnpin,
*const RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
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<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.