Calendar view's day view: thicker separator at 00:00

When using the new option "Daily timeline starts at",
make the separator line between 23:00 and 00:00 thicker.
Also tweak time picker to pick minutes by units of 10,
and remove max hour (06:00) limitation.
reviewable/pr10296/r1
poire-z 1 year ago
parent b7c4e1c21b
commit 7c5c7bb9cf

@ -211,7 +211,7 @@ function DateTimeWidget:createLayout()
value = self.min,
value_min = self.min_min or 0,
value_max = self.min_max or 59,
value_step = 1,
value_step = self.min_step or 1,
value_hold_step = self.min_hold_step or 10,
width = number_picker_widgets_width,
}

@ -911,11 +911,21 @@ function CalendarDayView:refreshTimeline()
})
end
-- Horizontal lines
local idx_00h00
if self.reader_statistics.settings.calendar_day_start_hour and self.reader_statistics.settings.calendar_day_start_hour ~= 0 then
idx_00h00 = 24 - self.reader_statistics.settings.calendar_day_start_hour
end
for i=0, 24 do
local offset_y = self.timeline_offset + self.hour_height * i
local height = Size.border.default
if idx_00h00 and i == idx_00h00 then
-- Thicker separator between 23:00 and 00:00
offset_y = offset_y - math.floor(height/2) -- shift it a bit up
height = height * 2
end
table.insert(self.timeline, FrameContainer:new{
width = self.timeline_width,
height = Size.border.default,
height = height,
background = Blitbuffer.COLOR_LIGHT_GRAY,
bordersize = 0,
padding = 0,

@ -1088,7 +1088,9 @@ The max value ensures a page you stay on for a long time (because you fell aslee
local start_of_day_widget = DateTimeWidget:new{
hour = self.settings.calendar_day_start_hour or 0,
min = self.settings.calendar_day_start_minute or 0,
hour_max = 6,
min_max = 50,
min_step = 10, -- we have vertical lines every 10mn, keep them meaningful
min_hold_step = 30,
ok_text = _("Set time"),
title_text = _("Daily timeline starts at"),
info_text =_([[

Loading…
Cancel
Save