Skip to content

Commit

Permalink
Adjust width of the status tracking bars, instead of re-anchoring them
Browse files Browse the repository at this point in the history
This should make resizing the status tracking bar more reliable.

Fixes #149
  • Loading branch information
Nevcairiel committed Jan 28, 2023
1 parent 166891c commit 4345b5c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions StatusTrackingBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ function StatusBarMod:OnEnable()

-- add additional anchors to the textures to allow re-sizing the bars
if self.bar.manager.MainStatusTrackingBarContainer then
self.bar.manager.MainStatusTrackingBarContainer:SetPoint("LEFT", self.bar.manager, "LEFT")
self.bar.manager.MainStatusTrackingBarContainer:SetPoint("RIGHT", self.bar.manager, "RIGHT")
self.bar.manager.SecondaryStatusTrackingBarContainer:SetPoint("LEFT", self.bar.manager, "LEFT")
self.bar.manager.SecondaryStatusTrackingBarContainer:SetPoint("RIGHT", self.bar.manager, "RIGHT")
self.bar.manager.MainStatusTrackingBarContainer:SetWidth(self.db.profile.width)
self.bar.manager.SecondaryStatusTrackingBarContainer:SetWidth(self.db.profile.width)
else
self.bar.manager.BottomBarFrameTexture:SetPoint("BOTTOMRIGHT")
self.bar.manager.TopBarFrameTexture:SetPoint("BOTTOMRIGHT", self.bar.manager.BottomBarFrameTexture, "TOPRIGHT", 0, -3)
Expand Down Expand Up @@ -87,6 +85,9 @@ StatusBar.offsetX = 7
StatusBar.offsetY = 2
function StatusBar:PerformLayout()
self.manager:SetWidth(self.config.width)
self.manager.MainStatusTrackingBarContainer:SetWidth(self.config.width)
self.manager.SecondaryStatusTrackingBarContainer:SetWidth(self.config.width)

self.manager:UpdateBarsShown()

StatusBar.width = self.config.width + 8
Expand Down

0 comments on commit 4345b5c

Please sign in to comment.