Release v0.2.10
This commit is contained in:
parent
ae1f0c7c4a
commit
f7c67c1a79
9 changed files with 87 additions and 15 deletions
|
|
@ -30,8 +30,8 @@ use crate::source::{
|
|||
};
|
||||
use crate::viewer::{
|
||||
FavoriteControl, FileDownloadControl, FileDropControl, FileViewerControls, MediaViewerWindow,
|
||||
SiblingFile, SiblingFileActions, SiblingNavigator, SiblingTarget, ViewModeControl,
|
||||
ViewerWindow, install_file_drop_target, set_viewer_header, set_viewer_loading,
|
||||
SiblingFile, SiblingFileActions, SiblingNavigator, SiblingTarget, TwoPageDirectionControl,
|
||||
ViewModeControl, ViewerWindow, install_file_drop_target, set_viewer_header, set_viewer_loading,
|
||||
};
|
||||
use crate::zip_cache::ZipCache;
|
||||
|
||||
|
|
@ -997,6 +997,7 @@ impl BrowserController {
|
|||
let Some(application) = controller.window.application() else {
|
||||
return;
|
||||
};
|
||||
let direction_control = controller.two_page_direction_control();
|
||||
ViewerWindow::open(
|
||||
&application,
|
||||
source,
|
||||
|
|
@ -1011,6 +1012,7 @@ impl BrowserController {
|
|||
file_drop_control: controller.file_drop_control(),
|
||||
reuse_window,
|
||||
view_mode_control: None,
|
||||
two_page_direction_control: Some(direction_control),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -1075,6 +1077,7 @@ impl BrowserController {
|
|||
file_drop_control: controller.file_drop_control(),
|
||||
reuse_window,
|
||||
view_mode_control,
|
||||
two_page_direction_control: None,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -1461,6 +1464,33 @@ impl BrowserController {
|
|||
}
|
||||
}
|
||||
|
||||
fn two_page_direction_control(self: &Rc<Self>) -> TwoPageDirectionControl {
|
||||
let selected = u32::from(self.config.borrow().two_page_right_to_left);
|
||||
let controller = Rc::downgrade(self);
|
||||
TwoPageDirectionControl {
|
||||
selected,
|
||||
change: Rc::new(move |index| {
|
||||
let Some(controller) = controller.upgrade() else {
|
||||
return false;
|
||||
};
|
||||
let right_to_left = index == 1;
|
||||
if controller.config.borrow().two_page_right_to_left == right_to_left {
|
||||
return true;
|
||||
}
|
||||
let mut updated = controller.config.borrow().clone();
|
||||
updated.two_page_right_to_left = right_to_left;
|
||||
if let Err(error) = updated.save(&controller.config_path) {
|
||||
controller
|
||||
.status_label
|
||||
.set_text(&format!("2페이지 방향을 저장할 수 없습니다: {error:#}"));
|
||||
return false;
|
||||
}
|
||||
*controller.config.borrow_mut() = updated;
|
||||
true
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
fn toggle_favorite(&self, entry: &BrowserEntry, profile: &LocationProfile) -> bool {
|
||||
let mut updated = self.config.borrow().clone();
|
||||
let was_active = self.is_favorite(&entry.uri);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue