mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
- tab buttons are now scrollable via the mouse wheel
- added the SetActiveSkin function to the util library
This commit is contained in:
parent
846f7cb60f
commit
5877855d4e
@ -138,7 +138,9 @@ function tabs:mousepressed(x, y, button)
|
||||
return
|
||||
end
|
||||
|
||||
if self.hover == true and button == "l" then
|
||||
if self.hover == true then
|
||||
|
||||
if button == "l" then
|
||||
|
||||
local baseparent = self:GetBaseParent()
|
||||
|
||||
@ -148,6 +150,32 @@ function tabs:mousepressed(x, y, button)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if button == "wu" then
|
||||
|
||||
local buttonheight = self:GetHeightOfButtons()
|
||||
local col = loveframes.util.BoundingBox(self.x, x, self.y, y, self.width, 1, buttonheight, 1)
|
||||
local visible = self.internals[#self.internals - 1]:GetVisible()
|
||||
|
||||
if col == true and visible == true then
|
||||
self.offsetx = self.offsetx + 5
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if button == "wd" then
|
||||
|
||||
local buttonheight = self:GetHeightOfButtons()
|
||||
local col = loveframes.util.BoundingBox(self.x, x, self.y, y, self.width, 1, buttonheight, 1)
|
||||
local visible = self.internals[#self.internals]:GetVisible()
|
||||
|
||||
if col == true and visible == true then
|
||||
self.offsetx = self.offsetx - 5
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
for k, v in ipairs(self.internals) do
|
||||
v:mousepressed(x, y, button)
|
||||
end
|
||||
|
14
util.lua
14
util.lua
@ -6,6 +6,20 @@
|
||||
-- util library
|
||||
loveframes.util = {}
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: SetActiveSkin(name)
|
||||
- desc: sets the active skin
|
||||
--]]---------------------------------------------------------
|
||||
function loveframes.util.SetActiveSkin(name)
|
||||
|
||||
loveframes.config["ACTIVESKIN"] = name
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: GetActiveSkin()
|
||||
- desc: gets the active skin
|
||||
--]]---------------------------------------------------------
|
||||
function loveframes.util.GetActiveSkin()
|
||||
|
||||
local index = loveframes.config["ACTIVESKIN"]
|
||||
|
Loading…
Reference in New Issue
Block a user