summaryrefslogtreecommitdiff
path: root/src/widget.rs
diff options
context:
space:
mode:
authorPolesznyák Márk László <116908301+pml68@users.noreply.github.com>2025-04-29 23:35:39 +0200
committerGitHub <noreply@github.com>2025-04-29 23:35:39 +0200
commitca50c308f0058af80e9125ba00a1349877169968 (patch)
tree38fbd5c78c90487e5b641f635d01c4a614ddfd44 /src/widget.rs
parentMerge pull request #14 from pml68/dependabot/cargo/windows_exe_info-0.5.1 (diff)
parentstyle: `theme` -> `appearance` (diff)
downloadiced-builder-ca50c308f0058af80e9125ba00a1349877169968.tar.gz
Merge pull request #20 from pml68/feat/custom-theme
Diffstat (limited to 'src/widget.rs')
-rw-r--r--src/widget.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/widget.rs b/src/widget.rs
index f1eb0f3..859d25e 100644
--- a/src/widget.rs
+++ b/src/widget.rs
@@ -1,5 +1,7 @@
-use iced::Element;
-use iced::widget::{container, text, tooltip};
+use iced::widget::{self, container, text, tooltip};
+use material_theme::Theme;
+
+use crate::types::Element;
pub mod tip {
pub use super::tooltip::Position;
@@ -12,10 +14,16 @@ pub fn tip<'a, Message: 'a>(
) -> Element<'a, Message> {
tooltip(
target,
- container(text(tip).size(14))
- .padding(5)
- .style(container::rounded_box),
+ container(text(tip).size(14)).padding(5).style(|theme| {
+ let base = material_theme::container::surface_container_low(theme);
+ container::Style {
+ border: iced::border::rounded(4),
+ ..base
+ }
+ }),
position,
)
.into()
}
+
+pub type Text<'a> = widget::Text<'a, Theme>;