Hide gallery buttons at start or end of gallery
This commit is contained in:
parent
b4a680447c
commit
e79efcb370
32
init.lua
32
init.lua
@ -556,22 +556,26 @@ doc.widgets.gallery = function(imagedata, playername, x, y, aspect_ratio, width,
|
|||||||
totalimagewidth = width - bw*2
|
totalimagewidth = width - bw*2
|
||||||
iw = totalimagewidth / rows
|
iw = totalimagewidth / rows
|
||||||
ih = iw * aspect_ratio
|
ih = iw * aspect_ratio
|
||||||
formstring = formstring .. "button["..x..","..y..";"..bw..","..ih..";doc_button_gallery_prev;"..F("<").."]"
|
if imageindex > 1 then
|
||||||
local tt
|
formstring = formstring .. "button["..x..","..y..";"..bw..","..ih..";doc_button_gallery_prev;"..F("<").."]"
|
||||||
if rows == 1 then
|
local tt
|
||||||
tt = F("Show previous image")
|
if rows == 1 then
|
||||||
else
|
tt = F("Show previous image")
|
||||||
tt = F("Show previous gallery page")
|
else
|
||||||
|
tt = F("Show previous gallery page")
|
||||||
|
end
|
||||||
|
formstring = formstring .. "tooltip[doc_button_gallery_prev;"..tt.."]"
|
||||||
end
|
end
|
||||||
formstring = formstring .. "tooltip[doc_button_gallery_prev;"..tt.."]"
|
if (imageindex + rows) <= #imagedata then
|
||||||
local rightx = buttonoffset + (x + rows * iw)
|
local rightx = buttonoffset + (x + rows * iw)
|
||||||
formstring = formstring .. "button["..rightx..","..y..";"..bw..","..ih..";doc_button_gallery_next;"..F(">").."]"
|
formstring = formstring .. "button["..rightx..","..y..";"..bw..","..ih..";doc_button_gallery_next;"..F(">").."]"
|
||||||
if rows == 1 then
|
if rows == 1 then
|
||||||
tt = F("Show next image")
|
tt = F("Show next image")
|
||||||
else
|
else
|
||||||
tt = F("Show next gallery page")
|
tt = F("Show next gallery page")
|
||||||
|
end
|
||||||
|
formstring = formstring .. "tooltip[doc_button_gallery_next;"..tt.."]"
|
||||||
end
|
end
|
||||||
formstring = formstring .. "tooltip[doc_button_gallery_next;"..tt.."]"
|
|
||||||
buttonoffset = bw
|
buttonoffset = bw
|
||||||
else
|
else
|
||||||
totalimagewidth = width
|
totalimagewidth = width
|
||||||
|
Loading…
x
Reference in New Issue
Block a user