diff --git a/src/app.rs b/src/app.rs index 9581eb5..6e287f0 100644 --- a/src/app.rs +++ b/src/app.rs @@ -70,6 +70,9 @@ mod imp { } .sidebar-content row:selected { background-color: alpha(@window_fg_color, 0.22); + } + .unread-title { + font-weight: bold; }" ); gtk4::style_context_add_provider_for_display( diff --git a/src/article_row.rs b/src/article_row.rs index a5ff552..d8877ce 100644 --- a/src/article_row.rs +++ b/src/article_row.rs @@ -83,10 +83,10 @@ mod imp { let unread = obj.article().unread; if unread { title_label.remove_css_class("dim-label"); - title_label.set_attributes(Some(&bold_attrs())); + title_label.add_css_class("unread-title"); } else { title_label.add_css_class("dim-label"); - title_label.set_attributes(None); + title_label.remove_css_class("unread-title"); } }); *self.unread_handler.borrow_mut() = Some((obj.clone(), id)); @@ -104,21 +104,15 @@ mod imp { fn update_read_style(&self, unread: bool) { if unread { self.title_label.remove_css_class("dim-label"); - self.title_label.set_attributes(Some(&bold_attrs())); + self.title_label.add_css_class("unread-title"); } else { self.title_label.add_css_class("dim-label"); - self.title_label.set_attributes(None); + self.title_label.remove_css_class("unread-title"); } } } } -fn bold_attrs() -> gtk4::pango::AttrList { - let list = gtk4::pango::AttrList::new(); - list.insert(gtk4::pango::AttrInt::new_weight(gtk4::pango::Weight::Bold)); - list -} - fn relative_time(unix: i64) -> String { let now = std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH)