mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-20 11:30:48 +00:00
api: remove obsolete code-path in bar layout
This commit is contained in:
+11
-12
@@ -786,7 +786,7 @@ end
|
|||||||
-- [ Bar Layout Formfactor ] --
|
-- [ Bar Layout Formfactor ] --
|
||||||
-- 'option' string option as used in pfUI_config.bars[bar].option
|
-- 'option' string option as used in pfUI_config.bars[bar].option
|
||||||
-- returns: integer formfactor
|
-- returns: integer formfactor
|
||||||
local formfactors = {} -- we'll use memoization so we only compute once, then lookup.
|
local formfactors = {}
|
||||||
setmetatable(formfactors, {__mode = "v"}) -- weak table so values not referenced are collected on next gc
|
setmetatable(formfactors, {__mode = "v"}) -- weak table so values not referenced are collected on next gc
|
||||||
function pfUI.api.BarLayoutFormfactor(option)
|
function pfUI.api.BarLayoutFormfactor(option)
|
||||||
if formfactors[option] then
|
if formfactors[option] then
|
||||||
@@ -805,18 +805,14 @@ function pfUI.api.BarLayoutFormfactor(option)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- [ Bar Layout Size ] --
|
-- [ Bar Layout Size ] --
|
||||||
-- 'bar' frame reference,
|
-- 'bar' frame reference,
|
||||||
-- 'barsize' integer number of buttons,
|
-- 'barsize' integer number of buttons,
|
||||||
-- 'formfactor' string formfactor in cols x rows,
|
-- 'formfactor' string formfactor in cols x rows,
|
||||||
-- 'visiblesize' integer buttons actually spawned
|
-- 'padding' the spacing between buttons
|
||||||
function pfUI.api.BarLayoutSize(bar,barsize,formfactor,iconsize,bordersize,padding)
|
function pfUI.api.BarLayoutSize(bar,barsize,formfactor,iconsize,bordersize,padding)
|
||||||
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutSize: barsize "..tostring(barsize).." is invalid")
|
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutSize: barsize "..tostring(barsize).." is invalid")
|
||||||
local formfactor = pfUI.api.BarLayoutFormfactor(formfactor)
|
local formfactor = pfUI.api.BarLayoutFormfactor(formfactor)
|
||||||
local cols, rows = unpack(pfGridmath[barsize][formfactor])
|
local cols, rows = unpack(pfGridmath[barsize][formfactor])
|
||||||
if (visiblesize) and (visiblesize < barsize) then
|
|
||||||
cols = math.min(cols,visiblesize)
|
|
||||||
rows = math.min(math.ceil(visiblesize/cols),visiblesize)
|
|
||||||
end
|
|
||||||
local width = (iconsize + bordersize*2+padding) * cols + padding
|
local width = (iconsize + bordersize*2+padding) * cols + padding
|
||||||
local height = (iconsize + bordersize*2+padding) * rows + padding
|
local height = (iconsize + bordersize*2+padding) * rows + padding
|
||||||
bar._size = {width,height}
|
bar._size = {width,height}
|
||||||
@@ -824,10 +820,13 @@ function pfUI.api.BarLayoutSize(bar,barsize,formfactor,iconsize,bordersize,paddi
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- [ Bar Button Anchor ] --
|
-- [ Bar Button Anchor ] --
|
||||||
-- 'button' frame reference
|
-- 'button' frame reference
|
||||||
-- 'basename' name of button frame without index
|
-- 'basename' name of button frame without index
|
||||||
-- 'buttonindex' index number of button on bar
|
-- 'buttonindex' index number of button on bar
|
||||||
-- 'formfactor' string formfactor in cols x rows
|
-- 'formfactor' string formfactor in cols x rows
|
||||||
|
-- 'iconsize' size of the button
|
||||||
|
-- 'bordersize' default bordersize
|
||||||
|
-- 'padding' the spacing between buttons
|
||||||
function pfUI.api.BarButtonAnchor(button,basename,buttonindex,barsize,formfactor,iconsize,bordersize,padding)
|
function pfUI.api.BarButtonAnchor(button,basename,buttonindex,barsize,formfactor,iconsize,bordersize,padding)
|
||||||
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarButtonAnchor: barsize "..tostring(barsize).." is invalid")
|
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarButtonAnchor: barsize "..tostring(barsize).." is invalid")
|
||||||
local formfactor = pfUI.api.BarLayoutFormfactor(formfactor)
|
local formfactor = pfUI.api.BarLayoutFormfactor(formfactor)
|
||||||
|
|||||||
Reference in New Issue
Block a user