Margins: allow direct input (more_options)

reviewable/pr7046/r1
yparitcher 3 years ago
parent d845741b15
commit c3fd6ae38b

@ -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,
},
},
}
},

@ -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

Loading…
Cancel
Save