[RTL UI] Bidi-wrap filenames, paths, urls, metadata

bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
This commit is contained in:
poire-z
2020-01-04 01:18:51 +01:00
parent a31abf79de
commit 0599c440cc
50 changed files with 378 additions and 182 deletions

View File

@@ -182,8 +182,16 @@ function SortWidget:init()
self.item_height = Size.item.height_big
-- group for footer
local footer_left_text = ""
local footer_right_text = ""
local footer_first_up_text = "◀◀"
local footer_last_down_text = "▶▶"
if BD.mirroredUILayout() then
footer_left_text, footer_right_text = footer_right_text, footer_left_text
footer_first_up_text, footer_last_down_text = footer_last_down_text, footer_first_up_text
end
self.footer_left = Button:new{
text = "",
text = footer_left_text,
width = self.width_widget * 13 / 100,
callback = function() self:prevPage() end,
text_font_size = 28,
@@ -192,7 +200,7 @@ function SortWidget:init()
radius = 0,
}
self.footer_right = Button:new{
text = "",
text = footer_right_text,
width = self.width_widget * 13 / 100,
callback = function() self:nextPage() end,
text_font_size = 28,
@@ -201,7 +209,7 @@ function SortWidget:init()
radius = 0,
}
self.footer_first_up = Button:new{
text = "◀◀",
text = footer_first_up_text,
width = self.width_widget * 13 / 100,
callback = function()
if self.marked > 0 then
@@ -216,7 +224,7 @@ function SortWidget:init()
radius = 0,
}
self.footer_last_down = Button:new{
text = "▶▶",
text = footer_last_down_text,
width = self.width_widget * 13 / 100,
callback = function()
if self.marked > 0 then
@@ -415,13 +423,18 @@ function SortWidget:_populateItems()
)
end
self.footer_page:setText(T(_("%1/%2"), self.show_page, self.pages), self.width_widget * 22 / 100)
self.footer_page:setText(T(_("%1 / %2"), self.show_page, self.pages), self.width_widget * 22 / 100)
local footer_first_up_text = "◀◀"
local footer_last_down_text = "▶▶"
if BD.mirroredUILayout() then
footer_first_up_text, footer_last_down_text = footer_last_down_text, footer_first_up_text
end
if self.marked > 0 then
self.footer_first_up:setText("", self.width_widget * 13 / 100)
self.footer_last_down:setText("", self.width_widget * 13 / 100)
else
self.footer_first_up:setText("◀◀", self.width_widget * 13 / 100)
self.footer_last_down:setText("▶▶", self.width_widget * 13 / 100)
self.footer_first_up:setText(footer_first_up_text, self.width_widget * 13 / 100)
self.footer_last_down:setText(footer_last_down_text, self.width_widget * 13 / 100)
end
self.footer_left:enableDisable(self.show_page > 1)
self.footer_right:enableDisable(self.show_page < self.pages)