From 1be55ec8a750a7bb5d25baf17313e657ddf76365 Mon Sep 17 00:00:00 2001 From: Infus Date: Sun, 21 May 2023 17:45:10 +0200 Subject: [PATCH] Clean up code showing the bottom buttons --- WeakAurasOptions/OptionsFrames/OptionsFrame.lua | 11 +++-------- WeakAurasOptions/OptionsFrames/TextEditor.lua | 2 ++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua index 4be3179ae0..946ab206c4 100644 --- a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua +++ b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua @@ -246,6 +246,7 @@ function OptionsPrivate.CreateFrame() self.toolbarContainer:Hide() self.filterInput:Hide(); self.tipFrame:Hide() + self:HideTip() self.bottomRightResizer:Hide() else WeakAurasOptionsTitleText:Show() @@ -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 @@ -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) diff --git a/WeakAurasOptions/OptionsFrames/TextEditor.lua b/WeakAurasOptions/OptionsFrames/TextEditor.lua index 24f899cad9..1ec0a06b81 100644 --- a/WeakAurasOptions/OptionsFrames/TextEditor.lua +++ b/WeakAurasOptions/OptionsFrames/TextEditor.lua @@ -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 @@ -768,6 +769,7 @@ local function ConstructTextEditor(frame) editor.editBox:SetScript("OnTextChanged", self.oldOnTextChanged) editor:ClearFocus() + frame.window = "default" frame:UpdateFrameVisible() WeakAuras.FillOptions()