[RTL UI] update widgets and apps for UI mirroring

Small tweaks all around to handle UI mirroring:
- swap existing symbols like arrows, or use alternative ones
- rotate some images, like chevrons and dogear icons
- flip some left and right swipe handling
- flip some geometry arithmetic like tap on left or right
  side of page or dict window
- use new ProgressWidget:getPercentageFromPosition() instead
  of geometry arithmetic
- BD.wrap() some concatenated string bits, like in reader
  and menu footers
- flip inverse_reading_order when UI is mirrored

More specific tweaks:
- ReaderGesture: reset some specific gestures when UI direction
  has changed (tap on top/bottom left/right corners, for
  bookmarks and FileManager "Plus menu").
- ReaderRolling: show markers on the correct side of page,
  in single or dual page mode.
- KoptOptions: swap left and right icons in Alignment toggle
- CheckMark: proper rendering in all 4 mirroring/rtl combinations.
- VirtualKeyboard: forbid any mirroring
- Move util.getMenuText into Menu.lua
This commit is contained in:
poire-z
2019-12-06 22:55:39 +01:00
parent 36ce82d8c2
commit 7952fa2c09
37 changed files with 557 additions and 195 deletions

View File

@@ -2,6 +2,7 @@
ReaderLink is an abstraction for document-specific link interfaces.
]]
local BD = require("ui/bidi")
local ButtonDialogTitle = require("ui/widget/buttondialogtitle")
local ConfirmBox = require("ui/widget/confirmbox")
local Device = require("device")
@@ -689,7 +690,8 @@ function ReaderLink:onGoBackLink(show_notification_if_empty)
end
function ReaderLink:onSwipe(arg, ges)
if ges.direction == "east" then
local direction = BD.flipDirectionIfMirroredUILayout(ges.direction)
if direction == "east" then
if isSwipeToGoBackEnabled() then
if #self.location_stack > 0 then
-- Remember if location stack is going to be empty, so we
@@ -709,7 +711,7 @@ function ReaderLink:onSwipe(arg, ges)
return true
end
end
elseif ges.direction == "west" then
elseif direction == "west" then
local ret = false
if isSwipeToFollowNearestLinkEnabled() then
ret = self:onGoToPageLink(ges, isSwipeIgnoreExternalLinksEnabled(), isFootnoteLinkInPopupEnabled())