mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Statistics: fix ReaderProgress bad layout in RTL UI (#10389)
This commit is contained in:
@@ -224,6 +224,8 @@ function ReaderProgress:genWeekStats(stats_day)
|
||||
},
|
||||
}
|
||||
|
||||
-- Lines have L/R self.padding. Make this section even more indented/padded inside the lines
|
||||
local inner_width = self.screen_width - 4*self.padding
|
||||
local j = 1
|
||||
for i = 1, stats_day do
|
||||
diff_time = now_time - second_in_day * (i - 1)
|
||||
@@ -236,9 +238,8 @@ function ReaderProgress:genWeekStats(stats_day)
|
||||
date_format_show = datetime.shortDayOfWeekToLongTranslation[os.date("%a", diff_time)] .. os.date(" (%Y-%m-%d)", diff_time)
|
||||
local total_group = HorizontalGroup:new{
|
||||
align = "center",
|
||||
padding = Size.padding.small,
|
||||
LeftContainer:new{
|
||||
dimen = Geom:new{ w = self.screen_width , h = height * (1/3) },
|
||||
dimen = Geom:new{ w = inner_width , h = height * (1/3) },
|
||||
TextWidget:new{
|
||||
padding = Size.padding.small,
|
||||
text = date_format_show .. " — " .. datetime.secondsToClockDuration(user_duration_format, select_day_time, true, true),
|
||||
@@ -249,9 +250,9 @@ function ReaderProgress:genWeekStats(stats_day)
|
||||
local titles_group = HorizontalGroup:new{
|
||||
align = "center",
|
||||
LeftContainer:new{
|
||||
dimen = Geom:new{ w = self.screen_width , h = height * (1/3) },
|
||||
dimen = Geom:new{ w = inner_width , h = height * (1/3) },
|
||||
ProgressWidget:new{
|
||||
width = math.floor((self.screen_width * 0.005) + (self.screen_width * 0.9 * select_day_time / max_week_time)),
|
||||
width = math.floor(inner_width * select_day_time / max_week_time),
|
||||
height = Screen:scaleBySize(14),
|
||||
percentage = 1.0,
|
||||
ticks = nil,
|
||||
@@ -267,7 +268,7 @@ function ReaderProgress:genWeekStats(stats_day)
|
||||
end --for i=1
|
||||
table.insert(statistics_container, statistics_group)
|
||||
return CenterContainer:new{
|
||||
dimen = Geom:new{ w = math.floor(self.screen_width * 1.1), h = math.floor(self.screen_height * 0.5) },
|
||||
dimen = Geom:new{ w = self.screen_width, h = math.floor(self.screen_height * 0.5) },
|
||||
statistics_container,
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user