diff --git a/README.md b/README.md index c4bae82..6d92bc9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ It follows the [river of news](http://scripting.com/2014/06/02/whatIsARiverOfNew - **River of news**: all unread articles in one flat list, auto-marked as read as you flip through them one by one - **Offline reading**: article content and images are cached locally so you can read without a connection -- **Image caching**: images are pre-fetched after each reload; skipped on metered connections unless enabled in preferences +- **Image caching**: images are pre-fetched after each reload; can be disabled in preferences and is always skipped on metered connections - **Offline sync**: read/unread state changes made offline are queued and pushed to the server next time you're online - **Persistent state**: the article list, selected article, and scroll position are restored when you reopen the app - **Dark mode**: follows the system color scheme automatically 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 578aae5..d8877ce 100644 --- a/src/article_row.rs +++ b/src/article_row.rs @@ -83,8 +83,10 @@ mod imp { let unread = obj.article().unread; if unread { title_label.remove_css_class("dim-label"); + title_label.add_css_class("unread-title"); } else { title_label.add_css_class("dim-label"); + title_label.remove_css_class("unread-title"); } }); *self.unread_handler.borrow_mut() = Some((obj.clone(), id)); @@ -102,8 +104,10 @@ mod imp { fn update_read_style(&self, unread: bool) { if unread { self.title_label.remove_css_class("dim-label"); + self.title_label.add_css_class("unread-title"); } else { self.title_label.add_css_class("dim-label"); + self.title_label.remove_css_class("unread-title"); } } } diff --git a/src/window.rs b/src/window.rs index e0991ed..91181c8 100644 --- a/src/window.rs +++ b/src/window.rs @@ -63,6 +63,7 @@ pub mod imp { pub current_article_id: RefCell>, pub mark_unread_guard: RefCell, pub pending_restore_id: RefCell>, + pub sidebar_zoom_css: std::cell::OnceCell, } #[glib::object_subclass] @@ -140,6 +141,16 @@ pub mod imp { let zoom = settings.double("zoom-level"); self.web_view.set_zoom_level(zoom); + // Set up sidebar font zoom CSS provider + let zoom_css = gtk4::CssProvider::new(); + gtk4::style_context_add_provider_for_display( + >k4::gdk::Display::default().unwrap(), + &zoom_css, + gtk4::STYLE_PROVIDER_PRIORITY_APPLICATION, + ); + self.sidebar_zoom_css.set(zoom_css).ok(); + self.update_sidebar_zoom(zoom); + // Persist sidebar width while dragging (only when visible) let s2 = settings.clone(); let sidebar_weak = self.sidebar_toolbar.downgrade(); @@ -794,16 +805,26 @@ pub mod imp { // ── Zoom ────────────────────────────────────────────────────────────── + fn update_sidebar_zoom(&self, level: f64) { + if let Some(css) = self.sidebar_zoom_css.get() { + css.load_from_string(&format!( + ".sidebar-content label {{ font-size: {level}em; }}" + )); + } + } + fn zoom(&self, factor: f64) { let wv = &*self.web_view; let new_level = (wv.zoom_level() * factor).clamp(0.25, 5.0); wv.set_zoom_level(new_level); + self.update_sidebar_zoom(new_level); let settings = gio::Settings::new("net.jeena.FeedTheMonkey"); settings.set_double("zoom-level", new_level).ok(); } fn zoom_reset(&self) { self.web_view.set_zoom_level(1.0); + self.update_sidebar_zoom(1.0); let settings = gio::Settings::new("net.jeena.FeedTheMonkey"); settings.set_double("zoom-level", 1.0).ok(); }