Quantcast

Fix dialog so position is not saved

James Whitehead II [10-09-10 - 17:34]
Fix dialog so position is not saved
Filename
BindConfig.lua
Clique.xml
diff --git a/BindConfig.lua b/BindConfig.lua
index 1be8743..6fb27b1 100755
--- a/BindConfig.lua
+++ b/BindConfig.lua
@@ -39,6 +39,9 @@ function CliqueConfig:SetupGUI()

     self.dialog = _G["CliqueDialog"]
     self.dialog.title = _G["CliqueDialogTitleText"]
+    self.dialog:SetUserPlaced(false)
+    self.dialog:ClearAllPoints()
+    self.dialog:SetPoint("CENTER", self, "CENTER", 30, 0)

     self.dialog.title:SetText(L["Set binding"])
     self.dialog.button_accept:SetText(L["Accept"])
diff --git a/Clique.xml b/Clique.xml
index fbd0a44..30a357c 100755
--- a/Clique.xml
+++ b/Clique.xml
@@ -167,7 +167,7 @@
             </Layer>
         </Layers>
         <Frames>
-            <Button>
+            <Button name="$parentDragButton">
                 <Size x="0" y="20"/>
                 <Anchors>
                     <Anchor point="TOPLEFT"/>
@@ -178,15 +178,16 @@
                         self:RegisterForClicks("LeftButton")
                     </OnLoad>
                     <OnMouseDown>
-                        self:GetParent():StartMoving()
+                        CliqueDialog:SetUserPlaced(false)
+                        CliqueDialog:StartMoving()
                     </OnMouseDown>
                     <OnMouseUp>
-                        self:GetParent():StopMovingOrSizing()
-                        self:SetUserPlaced(false)
+                        CliqueDialog:SetUserPlaced(false)
+                        CliqueDialog:StopMovingOrSizing()
                     </OnMouseUp>
                     <OnHide>
-                        self:GetParent():StopMovingOrSizing()
-                        self:SetUserPlaced(false)
+                        CliqueDialog:SetUserPlaced(false)
+                        CliqueDialog:StopMovingOrSizing()
                     </OnHide>
                 </Scripts>
             </Button>