From c3fd6ae38bbee99a555155131e17eee0bf54bf2d Mon Sep 17 00:00:00 2001 From: yparitcher Date: Sun, 20 Dec 2020 20:02:07 -0500 Subject: [PATCH] Margins: allow direct input (more_options) --- frontend/ui/data/creoptions.lua | 28 +++++++++++++++++++++++++--- frontend/ui/widget/configdialog.lua | 4 ++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/frontend/ui/data/creoptions.lua b/frontend/ui/data/creoptions.lua index 8b55423c2..1f54539ef 100644 --- a/frontend/ui/data/creoptions.lua +++ b/frontend/ui/data/creoptions.lua @@ -65,7 +65,6 @@ Note that this may not be ensured under some conditions: in scroll mode, when a name = "h_page_margins", name_text = _("L/R Margins"), buttonprogress = true, - fine_tune = true, values = { DCREREADER_CONFIG_H_MARGIN_SIZES_SMALL, DCREREADER_CONFIG_H_MARGIN_SIZES_MEDIUM, @@ -93,6 +92,17 @@ Note that this may not be ensured under some conditions: in scroll mode, when a }, delay_repaint = true, name_text_hold_callback = optionsutil.showValuesHMargins, + more_options = true, + more_options_param = { + left_min = 0, + left_max = 140, + left_step = 1, + left_hold_step = 5, + right_min = 0, + right_max = 140, + right_step = 1, + right_hold_step = 5, + }, }, { name = "sync_t_b_page_margins", @@ -115,7 +125,6 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m name = "t_page_margin", name_text = _("Top Margin"), buttonprogress = true, - fine_tune = true, values = { DCREREADER_CONFIG_T_MARGIN_SIZES_SMALL, DCREREADER_CONFIG_T_MARGIN_SIZES_MEDIUM, @@ -143,12 +152,18 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m }, delay_repaint = true, name_text_hold_callback = optionsutil.showValues, + more_options = true, + more_options_param = { + value_min = 0, + value_max = 140, + value_step = 1, + value_hold_step = 5, + }, }, { name = "b_page_margin", name_text = _("Bottom Margin"), buttonprogress = true, - fine_tune = true, values = { DCREREADER_CONFIG_B_MARGIN_SIZES_SMALL, DCREREADER_CONFIG_B_MARGIN_SIZES_MEDIUM, @@ -177,6 +192,13 @@ In the top menu → Settings → Status bar, you can choose whether the bottom m delay_repaint = true, name_text_hold_callback = optionsutil.showValues, help_text = _([[In the top menu → Settings → Status bar, you can choose whether the bottom margin applies from the bottom of the screen, or from above the status bar.]]), + more_options = true, + more_options_param = { + value_min = 0, + value_max = 140, + value_step = 1, + value_hold_step = 5, + }, }, } }, diff --git a/frontend/ui/widget/configdialog.lua b/frontend/ui/widget/configdialog.lua index ee0ce917d..240d442eb 100644 --- a/frontend/ui/widget/configdialog.lua +++ b/frontend/ui/widget/configdialog.lua @@ -1280,6 +1280,10 @@ function ConfigDialog:onConfigMoreChoose(values, name, event, args, name_text, d end } end + if delay_repaint then + self._dialog_closed = true + self:closeDialog() + end UIManager:show(widget) end if not delay_repaint then -- immediate refresh