Skip to content

Commit ec1e7fb

Browse files
committed
Fix hidden toolbar buttons showing after picking up items on cursor
1 parent a810b89 commit ec1e7fb

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

ConsolePort/ConsolePort.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
## Title: Console Port
77
## Notes: Game controller addon
88
## AddonCompartmentFunc: ConsolePort
9-
## Version: 2.9.30
9+
## Version: 2.9.31
1010

1111
## Author: Sebastian Lindfors
1212
## X-Website: https://github.com/seblindfors/ConsolePort

ConsolePort_Bar/View/Toolbar/Toolbar.lua

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ function PopoutFrame:Layout()
350350

351351
container:ClearAllPoints()
352352
container:SetPoint(orientation, toolbar, orientation, 0, delta * (TOOLBAR_WATCH_UNIT + 1))
353-
self:ClearAllPoints()
354-
self:SetPoint(orientation)
353+
self:UpdatePoint(self.isActive)
355354

356355
GridLayoutFrameMixin.Layout(self)
357356
container:SetSize(self:GetWidth() + 64, self:GetHeight() + 64)
@@ -387,10 +386,17 @@ function PopoutFrame:SlideOut()
387386
self:GetParent().SlideOut:Play()
388387
end
389388

390-
function PopoutFrame:SetActive(active)
389+
function PopoutFrame:UpdatePoint(active)
391390
local anchor = self.inverted and 'TOP' or 'BOTTOM';
392-
local delta = self.inverted and -1 or 1;
391+
local delta = self.inverted and -1 or 1;
392+
self:ClearAllPoints()
393393
self:SetPoint(anchor, 0, active and 0 or -delta * self:GetHeight())
394+
end
395+
396+
function PopoutFrame:SetActive(active)
397+
self:UpdatePoint(active)
398+
self.isActive = active;
399+
if not self.MicroButtons then return end;
394400
for button in pairs(self.MicroButtons) do
395401
-- Show help tip frames when the micro buttons are hidden by clipping,
396402
-- which is why this is true when the popout is NOT active.

0 commit comments

Comments
 (0)