summaryrefslogtreecommitdiffstats
path: root/native/src/svg.rs
diff options
context:
space:
mode:
authorLibravatar Michael Aaron Murphy <michael@mmurphy.dev>2022-11-16 17:42:41 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-12-06 03:59:53 +0100
commit75ae0de9bdd3376b6e537bf59030059c926114ee (patch)
treef9b701705ccce1ef0bb391f04dc1db8af18dcf09 /native/src/svg.rs
parent0249640213120e039462f5fc12c677f15ecbc7cc (diff)
downloadiced-75ae0de9bdd3376b6e537bf59030059c926114ee.tar.gz
iced-75ae0de9bdd3376b6e537bf59030059c926114ee.tar.bz2
iced-75ae0de9bdd3376b6e537bf59030059c926114ee.zip
feat: SVG styling with icon fill color
Diffstat (limited to 'native/src/svg.rs')
-rw-r--r--native/src/svg.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/native/src/svg.rs b/native/src/svg.rs
index a8e481d2..08b0984a 100644
--- a/native/src/svg.rs
+++ b/native/src/svg.rs
@@ -6,11 +6,14 @@ use std::hash::{Hash, Hasher as _};
use std::path::PathBuf;
use std::sync::Arc;
+pub use iced_style::svg::{Appearance, StyleSheet};
+
/// A handle of Svg data.
#[derive(Debug, Clone)]
pub struct Handle {
id: u64,
data: Arc<Data>,
+ appearance: Appearance,
}
impl Handle {
@@ -36,6 +39,7 @@ impl Handle {
Handle {
id: hasher.finish(),
data: Arc::new(data),
+ appearance: Appearance::default(),
}
}
@@ -48,6 +52,16 @@ impl Handle {
pub fn data(&self) -> &Data {
&self.data
}
+
+ /// Returns the styling [`Appearance`] for the SVG.
+ pub fn appearance(&self) -> Appearance {
+ self.appearance
+ }
+
+ /// Set the [`Appearance`] for the SVG.
+ pub fn set_appearance(&mut self, appearance: Appearance) {
+ self.appearance = appearance;
+ }
}
impl Hash for Handle {