mirror of https://github.com/BOINC/boinc.git
MGR: Fix sizes of task panes and buttons, ellipsing button text if needed
svn path=/trunk/boinc/; revision=25149
This commit is contained in:
parent
ed49749bae
commit
8f1069ed4e
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue