summaryrefslogtreecommitdiffstats
path: root/core/src/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-13 13:26:22 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-13 13:26:37 +0200
commit5e6d99419906077e75268ba136542254611df9f8 (patch)
tree566f4c7df3be6bd815580f59acf14df8b6706a97 /core/src/widget
parenta3d9cf2a6471b715f74bc8f8f0b0c93250fac4dd (diff)
downloadiced-5e6d99419906077e75268ba136542254611df9f8.tar.gz
iced-5e6d99419906077e75268ba136542254611df9f8.tar.bz2
iced-5e6d99419906077e75268ba136542254611df9f8.zip
Add `default` and `base` stylings to `text` widget
Diffstat (limited to 'core/src/widget')
-rw-r--r--core/src/widget/text.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs
index 990c5567..91c9893d 100644
--- a/core/src/widget/text.rs
+++ b/core/src/widget/text.rs
@@ -373,6 +373,18 @@ impl Catalog for Theme {
}
}
+/// The default text styling; color is inherited.
+pub fn default(_theme: &Theme) -> Style {
+ Style { color: None }
+}
+
+/// Text with the default base color.
+pub fn base(theme: &Theme) -> Style {
+ Style {
+ color: Some(theme.palette().text),
+ }
+}
+
/// Text conveying some important information, like an action.
pub fn primary(theme: &Theme) -> Style {
Style {