From 8f1069ed4e7fac3fa75e0cb0b3b4ef76c6888765 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Wed, 25 Jan 2012 12:18:43 +0000 Subject: [PATCH] MGR: Fix sizes of task panes and buttons, ellipsing button text if needed svn path=/trunk/boinc/; revision=25149 --- clientgui/BOINCTaskCtrl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clientgui/BOINCTaskCtrl.cpp b/clientgui/BOINCTaskCtrl.cpp index 8cac2104cf..d180a8b534 100644 --- a/clientgui/BOINCTaskCtrl.cpp +++ b/clientgui/BOINCTaskCtrl.cpp @@ -188,9 +188,8 @@ wxInt32 CBOINCTaskCtrl::UpdateControls() { if (!pItem->m_pButton) { pItem->m_pButton = new wxButton; pItem->m_strNameEllipsed = pItem->m_strName; - pItem->m_pButton->Create(this, pItem->m_iEventID, wxEmptyString, wxDefaultPosition, wxSize(TASKBUTTONWIDTH, -1), 0); EllipseStringIfNeeded(pItem->m_strNameEllipsed, pItem->m_pButton); - pItem->m_pButton->SetLabel(pItem->m_strNameEllipsed); + pItem->m_pButton->Create(this, pItem->m_iEventID, pItem->m_strNameEllipsed, wxDefaultPosition, wxSize(TASKBUTTONWIDTH, -1), 0); pItem->m_pButton->SetHelpText(pItem->m_strDescription); #if wxUSE_TOOLTIPS pItem->m_pButton->SetToolTip(pItem->m_strName + wxT(": ") + pItem->m_strDescription); @@ -254,8 +253,7 @@ bool CBOINCTaskCtrl::OnRestoreState(wxConfigBase* pConfig) { void CBOINCTaskCtrl::EllipseStringIfNeeded(wxString& s, wxWindow *win) { int w, h; - wxSize sz = win->GetSize(); - int maxWidth = sz.GetWidth() - 10; + int maxWidth = TASKBUTTONWIDTH - 10; win->GetTextExtent(s, &w, &h);