mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
KeyValuePage, Sortwidget: fix RTL mirrored layout
This commit is contained in:
@@ -41,7 +41,6 @@ local TitleBar = require("ui/widget/titlebar")
|
||||
local UIManager = require("ui/uimanager")
|
||||
local VerticalGroup = require("ui/widget/verticalgroup")
|
||||
local VerticalSpan = require("ui/widget/verticalspan")
|
||||
local WidgetContainer = require("ui/widget/container/widgetcontainer")
|
||||
local Input = Device.input
|
||||
local Screen = Device.screen
|
||||
local T = require("ffi/util").template
|
||||
@@ -301,7 +300,7 @@ function KeyValuePage:init()
|
||||
-- return button
|
||||
--- @todo: alternative icon if BD.mirroredUILayout()
|
||||
self.page_return_arrow = self.page_return_arrow or Button:new{
|
||||
icon = "back.top",
|
||||
icon = BD.mirroredUILayout() and "back.top.rtl" or "back.top",
|
||||
callback = function() self:onReturn() end,
|
||||
bordersize = 0,
|
||||
show_parent = self,
|
||||
@@ -353,6 +352,9 @@ function KeyValuePage:init()
|
||||
width = Size.span.horizontal_small,
|
||||
},
|
||||
self.page_return_arrow,
|
||||
HorizontalSpan:new{
|
||||
width = self.dimen.w - self.page_return_arrow:getSize().w - Size.span.horizontal_small,
|
||||
},
|
||||
}
|
||||
|
||||
self.page_info_left_chev:hide()
|
||||
@@ -407,17 +409,12 @@ function KeyValuePage:init()
|
||||
|
||||
local page_return = BottomContainer:new{
|
||||
dimen = self.dimen:copy(),
|
||||
WidgetContainer:new{
|
||||
dimen = Geom:new{
|
||||
w = self.dimen.w,
|
||||
h = self.return_button:getSize().h,
|
||||
},
|
||||
self.return_button,
|
||||
}
|
||||
self.return_button,
|
||||
}
|
||||
|
||||
self.title_bar = TitleBar:new{
|
||||
title = self.title,
|
||||
fullscreen = self.covers_fullscreen,
|
||||
width = self.width,
|
||||
align = "left",
|
||||
with_bottom_line = true,
|
||||
|
||||
@@ -11,6 +11,7 @@ local Geom = require("ui/geometry")
|
||||
local GestureRange = require("ui/gesturerange")
|
||||
local HorizontalGroup = require("ui/widget/horizontalgroup")
|
||||
local InputContainer = require("ui/widget/container/inputcontainer")
|
||||
local LeftContainer = require("ui/widget/container/leftcontainer")
|
||||
local LineWidget = require("ui/widget/linewidget")
|
||||
local OverlapGroup = require("ui/widget/overlapgroup")
|
||||
local Size = require("ui/size")
|
||||
@@ -68,16 +69,22 @@ function SortItemWidget:init()
|
||||
self[1] = FrameContainer:new{
|
||||
padding = 0,
|
||||
bordersize = 0,
|
||||
HorizontalGroup:new {
|
||||
align = "center",
|
||||
CenterContainer:new{
|
||||
dimen = Geom:new{ w = checked_widget:getSize().w },
|
||||
self.checkmark_widget,
|
||||
LeftContainer:new{ -- needed only for auto UI mirroring
|
||||
dimen = Geom:new{
|
||||
w = self.width,
|
||||
h = self.height,
|
||||
},
|
||||
TextWidget:new{
|
||||
text = self.item.text,
|
||||
max_width = text_max_width,
|
||||
face = self.face,
|
||||
HorizontalGroup:new {
|
||||
align = "center",
|
||||
CenterContainer:new{
|
||||
dimen = Geom:new{ w = checked_widget:getSize().w },
|
||||
self.checkmark_widget,
|
||||
},
|
||||
TextWidget:new{
|
||||
text = self.item.text,
|
||||
max_width = text_max_width,
|
||||
face = self.face,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
57
resources/icons/mdlight/back.top.rtl.svg
Normal file
57
resources/icons/mdlight/back.top.rtl.svg
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
width="48"
|
||||
height="48"
|
||||
viewBox="0 0 48 48"
|
||||
enable-background="new 0 0 24.00 24.00"
|
||||
xml:space="preserve"
|
||||
id="svg4"
|
||||
sodipodi:docname="appbar.arrow.left.up.svg"
|
||||
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1914"
|
||||
inkscape:window-height="1004"
|
||||
id="namedview6"
|
||||
showgrid="true"
|
||||
inkscape:snap-page="true"
|
||||
inkscape:zoom="16.4375"
|
||||
inkscape:cx="11.984791"
|
||||
inkscape:cy="24"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="54"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg4"
|
||||
inkscape:document-rotation="0"><inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid831"
|
||||
originx="0"
|
||||
originy="0" /></sodipodi:namedview><metadata
|
||||
id="metadata10"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs8" />
|
||||
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 5,36 H 33 V 7.3333333"
|
||||
id="path835"
|
||||
sodipodi:nodetypes="ccc" /><path
|
||||
id="path841"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.7;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
d="M 22.6666666,17.666666 33,7.3333333 43.333333,17.666666"
|
||||
sodipodi:nodetypes="ccc" /></svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
Reference in New Issue
Block a user