Compare commits
No commits in common. "f7b90360635928c530e5258497d415eafbbe27ee" and "d9d3438997436fa3ce8a9fa06a47efba6bd1b4eb" have entirely different histories.
f7b9036063
...
d9d3438997
@ -214,7 +214,7 @@ impl SyncCacheCommandChannel {
|
||||
}
|
||||
|
||||
impl SyncCacheCommandSender {
|
||||
pub fn _is_channel_open(&self) -> bool {
|
||||
pub fn is_channel_open(&self) -> bool {
|
||||
Rc::strong_count(&self.channel) > 1
|
||||
}
|
||||
|
||||
|
13
src/ui.rs
13
src/ui.rs
@ -56,10 +56,6 @@ impl DocumentCanvas {
|
||||
}
|
||||
|
||||
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.current_page_number, self.current_page_number + 1],
|
||||
area_height,
|
||||
@ -69,11 +65,11 @@ impl DocumentCanvas {
|
||||
pub fn cache_surrounding_pages(&self, area_height: i32) {
|
||||
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 + 1,
|
||||
self.current_page_number.saturating_sub(1),
|
||||
self.current_page_number + 2,
|
||||
self.current_page_number.saturating_sub(2),
|
||||
self.current_page_number + 3,
|
||||
],
|
||||
area_height,
|
||||
@ -110,13 +106,10 @@ pub fn toggle_fullscreen(ui: &Ui) {
|
||||
ui.header_bar.hide();
|
||||
ui.bottom_bar.hide();
|
||||
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
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.cache_surrounding_pages(new_area_height);
|
||||
.cache_surrounding_pages(ui.image_container.height() + ui.header_bar.height());
|
||||
}
|
||||
false => {
|
||||
ui.header_bar.show();
|
||||
|
Loading…
x
Reference in New Issue
Block a user