Skip to content

Commit

Permalink
Clean up code showing the bottom buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
InfusOnWoW authored and Stanzilla committed May 23, 2023
1 parent 7709a10 commit 1be55ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 3 additions & 8 deletions WeakAurasOptions/OptionsFrames/OptionsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ function OptionsPrivate.CreateFrame()
self.toolbarContainer:Hide()
self.filterInput:Hide();
self.tipFrame:Hide()
self:HideTip()
self.bottomRightResizer:Hide()
else
WeakAurasOptionsTitleText:Show()
Expand All @@ -254,15 +255,11 @@ function OptionsPrivate.CreateFrame()
OptionsPrivate.SetTitle()
self.buttonsContainer.frame:Show()
self.container.frame:Show()
if self.tipFrameIsVisible then
self.tipFrame:Show()
else
self.tipFrame:Hide()
end
self:ShowTip()
else
self.buttonsContainer.frame:Hide()
self.container.frame:Hide()
self.tipFrame:Hide()
self:HideTip()
end

if self.window == "texture" then
Expand Down Expand Up @@ -483,14 +480,12 @@ function OptionsPrivate.CreateFrame()
end

frame.ShowTip = function(self)
self.tipFrameIsVisible = true
self.tipFrame:Show()
self.buttonsContainer.frame:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", 17, 30)
self.container.frame:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -17, 28)
end

frame.HideTip = function(self)
self.tipFrameIsVisible = false
self.tipFrame:Hide()
self.buttonsContainer.frame:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 17, 12)
self.container.frame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -17, 10)
Expand Down
2 changes: 2 additions & 0 deletions WeakAurasOptions/OptionsFrames/TextEditor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ local function ConstructTextEditor(frame)
function group.CancelClose(self)
editor.editBox:SetScript("OnTextChanged", self.oldOnTextChanged)
editor:ClearFocus()
frame:HideTip()
frame.window = "default"
frame:UpdateFrameVisible()
end
Expand Down Expand Up @@ -768,6 +769,7 @@ local function ConstructTextEditor(frame)

editor.editBox:SetScript("OnTextChanged", self.oldOnTextChanged)
editor:ClearFocus()

frame.window = "default"
frame:UpdateFrameVisible()
WeakAuras.FillOptions()
Expand Down

0 comments on commit 1be55ec

Please sign in to comment.