From 3ebdfffd018554e4ec2e3bcc24965b0ae993c04f Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Fri, 21 Mar 2025 13:16:58 +0200 Subject: [PATCH] Reflowable documents: fix sync T/B margins (#13439) --- frontend/apps/reader/modules/readertypeset.lua | 6 +++++- plugins/profiles.koplugin/main.lua | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/apps/reader/modules/readertypeset.lua b/frontend/apps/reader/modules/readertypeset.lua index 1badbce77..efca37059 100644 --- a/frontend/apps/reader/modules/readertypeset.lua +++ b/frontend/apps/reader/modules/readertypeset.lua @@ -511,7 +511,11 @@ function ReaderTypeset:onSetPageTopAndBottomMargin(t_b_margins, when_applied_cal end function ReaderTypeset:onSyncPageTopBottomMargins(toggle, when_applied_callback) - self.sync_t_b_page_margins = not self.sync_t_b_page_margins + if toggle == nil then + self.sync_t_b_page_margins = not self.sync_t_b_page_margins + else + self.sync_t_b_page_margins = toggle + end if self.sync_t_b_page_margins then -- Adjust current top and bottom margins if needed if self.unscaled_margins[2] ~= self.unscaled_margins[4] then diff --git a/plugins/profiles.koplugin/main.lua b/plugins/profiles.koplugin/main.lua index 3368008b8..0e4c84284 100644 --- a/plugins/profiles.koplugin/main.lua +++ b/plugins/profiles.koplugin/main.lua @@ -399,9 +399,9 @@ function Profiles:getProfileFromCurrentBookSettings(new_name) "word_expansion", "visible_pages", "h_page_margins", - "sync_t_b_page_margins", "t_page_margin", "b_page_margin", + "sync_t_b_page_margins", "view_mode", "block_rendering_mode", "render_dpi",