From 48f47fbc2908a3889590dac7c7362da3cb0c2436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80?= Date: Thu, 14 Dec 2017 15:29:03 +0300 Subject: [PATCH] Add auto-resize for OPENMAIL button --- Mail.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Mail.lua b/Mail.lua index 3f04ccd..cdf7d3c 100644 --- a/Mail.lua +++ b/Mail.lua @@ -185,11 +185,13 @@ do end function Inbox_Load() - local btn = CreateFrame('Button', nil, InboxFrame, 'UIPanelButtonTemplate') + local btn = CreateFrame('Button', 'OpenMailButton', InboxFrame, 'UIPanelButtonTemplate') btn:SetPoint('BOTTOM', -10, 90) - btn:SetWidth(120) - btn:SetHeight(25) btn:SetText(OPENMAIL) + local text_width = OpenMailButtonText:GetStringWidth() + if text_width < 60 then text_width = 60 end + btn:SetWidth(text_width+30) + btn:SetHeight(25) btn:SetScript('OnClick', Inbox_OpenAll) end