add a "Zoom" toggle to the bar configuration to be able to use the Zoomed button style without ButtonFacade installed
This commit is contained in:
@@ -13,6 +13,7 @@ local defaults = Bartender4:Merge({
|
|||||||
ID = "DreamLayout",
|
ID = "DreamLayout",
|
||||||
Backdrop = true,
|
Backdrop = true,
|
||||||
Gloss = false,
|
Gloss = false,
|
||||||
|
Zoom = false,
|
||||||
},
|
},
|
||||||
}, Bartender4.Bar.defaults)
|
}, Bartender4.Bar.defaults)
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ do
|
|||||||
optionMap = {
|
optionMap = {
|
||||||
rows = "Rows",
|
rows = "Rows",
|
||||||
padding = "Padding",
|
padding = "Padding",
|
||||||
|
zoom = "Zoom",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- retrieves a valid bar object from the barregistry table
|
-- retrieves a valid bar object from the barregistry table
|
||||||
@@ -102,6 +104,15 @@ function ButtonBar:GetOptionObject()
|
|||||||
set = optSetter,
|
set = optSetter,
|
||||||
get = optGetter,
|
get = optGetter,
|
||||||
},
|
},
|
||||||
|
zoom = {
|
||||||
|
order = 59,
|
||||||
|
name = "Zoom",
|
||||||
|
type = "toggle",
|
||||||
|
desc = "Toggle Button Zoom\nFor more style options you need to install ButtonFacade",
|
||||||
|
get = optGetter,
|
||||||
|
set = optSetter,
|
||||||
|
hidden = function() return LBF and true or false end,
|
||||||
|
},
|
||||||
rows = {
|
rows = {
|
||||||
order = 70,
|
order = 70,
|
||||||
name = "Rows",
|
name = "Rows",
|
||||||
@@ -150,6 +161,15 @@ function ButtonBar:SetRows(rows)
|
|||||||
self:UpdateButtonLayout()
|
self:UpdateButtonLayout()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ButtonBar:GetZoom()
|
||||||
|
return self.config.skin.Zoom
|
||||||
|
end
|
||||||
|
|
||||||
|
function ButtonBar:SetZoom(zoom)
|
||||||
|
self.config.skin.Zoom = zoom
|
||||||
|
self:UpdateButtonLayout()
|
||||||
|
end
|
||||||
|
|
||||||
local math_floor = math.floor
|
local math_floor = math.floor
|
||||||
-- align the buttons and correct the size of the bar overlay frame
|
-- align the buttons and correct the size of the bar overlay frame
|
||||||
ButtonBar.button_width = 36
|
ButtonBar.button_width = 36
|
||||||
@@ -182,6 +202,17 @@ function ButtonBar:UpdateButtonLayout()
|
|||||||
buttons[i]:ClearSetPoint("TOPLEFT", buttons[i-1], "TOPRIGHT", pad, 0)
|
buttons[i]:ClearSetPoint("TOPLEFT", buttons[i-1], "TOPRIGHT", pad, 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not LBF then
|
||||||
|
for i = 1, #buttons do
|
||||||
|
local button = buttons[i]
|
||||||
|
if button.icon and self.config.skin.Zoom then
|
||||||
|
button.icon:SetTexCoord(0.07,0.93,0.07,0.93)
|
||||||
|
elseif button.icon then
|
||||||
|
button.icon:SetTexCoord(0,1,0,1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Button)
|
function ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Button)
|
||||||
|
|||||||
Reference in New Issue
Block a user