From dd12f31bf504675abadb0e2c0cdb540597fc9220 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 25 Aug 2024 19:26:16 +0300 Subject: Style changes to work better with the default theme Yes, I'm stupid and I'm developing under a custom theme --- src/components/tag_pill.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/components/tag_pill.rs') diff --git a/src/components/tag_pill.rs b/src/components/tag_pill.rs index 4947540..7579c0e 100644 --- a/src/components/tag_pill.rs +++ b/src/components/tag_pill.rs @@ -30,13 +30,22 @@ impl FactoryComponent for TagPill { relm4::view! { root = gtk::Box { #[iterate] - add_css_class: &["pill", "frame"], + add_css_class: &["pill", "frame", "tag-pill"], inline_css: "border-radius: 48px", set_spacing: 6, set_height_request: 32, + set_valign: gtk::Align::Center, } } + use gtk::prelude::StyleContextExt; + let css = gtk::CssProvider::new(); + css.load_from_bytes(&glib::Bytes::from_static(b".tag-pill button { + min-height: 30px; + min-width: 30px; +}")); + + root.style_context().add_provider(&css, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION + 2); root } @@ -51,12 +60,12 @@ impl FactoryComponent for TagPill { label = gtk::Label { set_text: &self.0, set_margin_horizontal: 6, - set_margin_start: 12, + set_margin_start: 16, }, button = gtk::Button { #[iterate] - add_css_class: &["destructive-action", "flat", "circular"], - set_icon_name: "close-symbolic", + add_css_class: &["destructive-action", "circular"], + set_icon_name: "window-close-symbolic", connect_clicked[sender, index] => move |_| { let _ = sender.output(TagPillDelete(index.clone())); -- cgit 1.4.1