Compare commits
4 commits
b280d83234
...
c19c2cbd1d
| Author | SHA1 | Date | |
|---|---|---|---|
| c19c2cbd1d | |||
| 3bcd6af23c | |||
| a77fa3ae03 | |||
| 03b1936740 |
4 changed files with 29 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ pub mod imp {
|
|||
pub current_article_id: RefCell<Option<String>>,
|
||||
pub mark_unread_guard: RefCell<bool>,
|
||||
pub pending_restore_id: RefCell<Option<String>>,
|
||||
pub sidebar_zoom_css: std::cell::OnceCell<gtk4::CssProvider>,
|
||||
}
|
||||
|
||||
#[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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue