mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-19 09:34:19 +01:00
@@ -1,4 +1,4 @@
|
|||||||
use crate::{app_size::AppSizeHandler, setup::setup_cc, theme};
|
use crate::{app_size::AppSizeHandler, persist_zoom::ZoomHandler, setup::setup_cc, theme};
|
||||||
|
|
||||||
use notedeck::{
|
use notedeck::{
|
||||||
Accounts, AppContext, Args, DataPath, DataPathType, Directory, FileKeyStorage, ImageCache,
|
Accounts, AppContext, Args, DataPath, DataPathType, Directory, FileKeyStorage, ImageCache,
|
||||||
@@ -26,6 +26,7 @@ pub struct Notedeck {
|
|||||||
theme: ThemeHandler,
|
theme: ThemeHandler,
|
||||||
tabs: Tabs,
|
tabs: Tabs,
|
||||||
app_rect_handler: AppSizeHandler,
|
app_rect_handler: AppSizeHandler,
|
||||||
|
zoom_handler: ZoomHandler,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn margin_top(narrow: bool) -> f32 {
|
fn margin_top(narrow: bool) -> f32 {
|
||||||
@@ -80,6 +81,7 @@ impl eframe::App for Notedeck {
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.app_rect_handler.try_save_app_size(ctx);
|
self.app_rect_handler.try_save_app_size(ctx);
|
||||||
|
self.zoom_handler.try_save_zoom_factor(ctx);
|
||||||
|
|
||||||
if self.args.relay_debug {
|
if self.args.relay_debug {
|
||||||
if self.pool.debug.is_none() {
|
if self.pool.debug.is_none() {
|
||||||
@@ -206,6 +208,11 @@ impl Notedeck {
|
|||||||
let unknown_ids = UnknownIds::default();
|
let unknown_ids = UnknownIds::default();
|
||||||
let tabs = Tabs::new(None);
|
let tabs = Tabs::new(None);
|
||||||
let app_rect_handler = AppSizeHandler::new(&path);
|
let app_rect_handler = AppSizeHandler::new(&path);
|
||||||
|
let zoom_handler = ZoomHandler::new(&path);
|
||||||
|
|
||||||
|
if let Some(zoom_factor) = zoom_handler.get_zoom_factor() {
|
||||||
|
ctx.set_zoom_factor(zoom_factor);
|
||||||
|
}
|
||||||
|
|
||||||
// migrate
|
// migrate
|
||||||
if let Err(e) = img_cache.migrate_v0() {
|
if let Err(e) = img_cache.migrate_v0() {
|
||||||
@@ -224,6 +231,7 @@ impl Notedeck {
|
|||||||
args: parsed_args,
|
args: parsed_args,
|
||||||
theme,
|
theme,
|
||||||
tabs,
|
tabs,
|
||||||
|
zoom_handler,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
pub mod app_size;
|
pub mod app_size;
|
||||||
pub mod fonts;
|
pub mod fonts;
|
||||||
|
pub mod persist_zoom;
|
||||||
pub mod setup;
|
pub mod setup;
|
||||||
pub mod theme;
|
pub mod theme;
|
||||||
pub mod timed_serializer;
|
pub mod timed_serializer;
|
||||||
|
|||||||
Reference in New Issue
Block a user