diff Core.lua @ 50:8e2138877ebf

Added neat(er) tooltips for both the mail opener status toggler as the config button. Added an option below the filters to disable the shift click functionality of the open all button.
author Zerotorescue
date Sun, 12 Sep 2010 21:06:05 +0200
parents 1805df31794d
children fcc7112cc365
line wrap: on
line diff
--- a/Core.lua	Sun Sep 12 20:35:37 2010 +0200
+++ b/Core.lua	Sun Sep 12 21:06:05 2010 +0200
@@ -160,9 +160,10 @@
 	-- ADDON / MAIL OPENING STATUS TOGGLER
 	
 	-- Make the open all checkbox
-	local check = CreateFrame("CheckButton", "cbMailOpenerEnable", MailFrame, "ChatConfigCheckButtonTemplate");
+	local check = CreateFrame("CheckButton", "cbMailOpenerEnable", MailFrame, "OptionsCheckButtonTemplate");
 	check:SetHeight(26);
 	check:SetWidth(26);
+	check:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 68, -13);
 	check:SetChecked(true);
 	check:SetHitRectInsets(0, -80, 0, 0);
 	check:SetScript("OnClick", function(self)
@@ -200,14 +201,26 @@
 			end
 		end
 	end);
-	check.tooltip = "Toggle automatic mail opening on or off (you can force this by holding shift when opening the mailbox.\n\nHold the |cffffffffSHIFT|r key to disable the entire addon.";
-	check:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 68, -13);
+	check.tooltipTitle = "Mail Opener status";
+	check.tooltip = "Toggle automatic mail opening |cff00ff00on|r or |cffff0000off|r (you can also enforce this by holding shift when opening the mailbox).\n\nYou can also hold the |cfffed000shift|r key while clicking this checkbox to disable the entire addon instead.";
+	check:SetScript("OnEnter", function(self)
+		GameTooltip:SetOwner(self, "ANCHOR_BOTTOM")
+		GameTooltip:SetPoint("BOTTOM", self, "BOTTOM")
+		GameTooltip:SetText(self.tooltipTitle, 1, .82, 0, 1)
+		
+		if type(self.tooltip) == "string" then
+			GameTooltip:AddLine(self.tooltip, 1, 1, 1, 1);
+		end
+		
+		GameTooltip:Show();
+	end);
+	button:SetScript("OnLeave", function(self)
+		GameTooltip:Hide();
+	end);
 	
 	-- Get reference to the text field
 	local checkboxText = _G[check:GetName() .. "Text"];
 	checkboxText:SetText("Mail Opener");
-	-- We like this color more
-	checkboxText:SetTextColor(1, 0.8, 0, 1);
 	
 	self.cbOpenAll = check;
 	
@@ -231,6 +244,22 @@
 		--BETA:	MailOpener:ShowBetaPopup();
 		--BETA:end
 	end);
+	button.tooltipTitle = "Mail Opener Config";
+	button.tooltip = "Click to open the configuration window for Mail Opener.";
+	button:SetScript("OnEnter", function(self)
+		GameTooltip:SetOwner(self, "ANCHOR_BOTTOM")
+		GameTooltip:SetPoint("BOTTOM", self, "TOP")
+		GameTooltip:SetText(self.tooltipTitle, 1, .82, 0, 1)
+		
+		if type(self.tooltip) == "string" then
+			GameTooltip:AddLine(self.tooltip, 1, 1, 1, 1);
+		end
+		
+		GameTooltip:Show();
+	end);
+	button:SetScript("OnLeave", function(self)
+		GameTooltip:Hide();
+	end);
 	
 	self.btnConfig = button;