Compare commits

..

No commits in common. "f7b90360635928c530e5258497d415eafbbe27ee" and "d9d3438997436fa3ce8a9fa06a47efba6bd1b4eb" have entirely different histories.

2 changed files with 4 additions and 11 deletions

View File

@ -214,7 +214,7 @@ impl SyncCacheCommandChannel {
} }
impl SyncCacheCommandSender { impl SyncCacheCommandSender {
pub fn _is_channel_open(&self) -> bool { pub fn is_channel_open(&self) -> bool {
Rc::strong_count(&self.channel) > 1 Rc::strong_count(&self.channel) > 1
} }

View File

@ -56,10 +56,6 @@ impl DocumentCanvas {
} }
pub fn cache_initial_pages(&self, area_height: i32) { pub fn cache_initial_pages(&self, area_height: i32) {
self.priority_cache_current_pages(area_height);
}
pub fn priority_cache_current_pages(&self, area_height: i32){
self.page_cache_sender.send_priority_cache_commands( self.page_cache_sender.send_priority_cache_commands(
&[self.current_page_number, self.current_page_number + 1], &[self.current_page_number, self.current_page_number + 1],
area_height, area_height,
@ -69,11 +65,11 @@ impl DocumentCanvas {
pub fn cache_surrounding_pages(&self, area_height: i32) { pub fn cache_surrounding_pages(&self, area_height: i32) {
self.page_cache_sender.send_cache_commands( self.page_cache_sender.send_cache_commands(
&[ &[
self.current_page_number.saturating_sub(2),
self.current_page_number.saturating_sub(1),
self.current_page_number, self.current_page_number,
self.current_page_number + 1, self.current_page_number + 1,
self.current_page_number.saturating_sub(1),
self.current_page_number + 2, self.current_page_number + 2,
self.current_page_number.saturating_sub(2),
self.current_page_number + 3, self.current_page_number + 3,
], ],
area_height, area_height,
@ -110,13 +106,10 @@ pub fn toggle_fullscreen(ui: &Ui) {
ui.header_bar.hide(); ui.header_bar.hide();
ui.bottom_bar.hide(); ui.bottom_bar.hide();
ui.window.fullscreen(); ui.window.fullscreen();
let new_area_height = ui.image_container.height() + ui.header_bar.height();
ui.document_canvas.as_ref().unwrap().priority_cache_current_pages(new_area_height);
ui.document_canvas ui.document_canvas
.as_ref() .as_ref()
.unwrap() .unwrap()
.cache_surrounding_pages(new_area_height); .cache_surrounding_pages(ui.image_container.height() + ui.header_bar.height());
} }
false => { false => {
ui.header_bar.show(); ui.header_bar.show();