diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2018-05-09 00:11:35 +0200 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2018-05-09 00:11:35 +0200 |
commit | 015bb675d6eb177900c8ac94a6d35edc5ad90576 (patch) | |
tree | edde4153ce9b2ba6bdaf9d3c0af0966ed6dfd717 /wx+/popup_dlg.cpp | |
parent | 9.8 (diff) | |
download | FreeFileSync-015bb675d6eb177900c8ac94a6d35edc5ad90576.tar.gz FreeFileSync-015bb675d6eb177900c8ac94a6d35edc5ad90576.tar.bz2 FreeFileSync-015bb675d6eb177900c8ac94a6d35edc5ad90576.zip |
9.9
Diffstat (limited to 'wx+/popup_dlg.cpp')
-rwxr-xr-x | wx+/popup_dlg.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/wx+/popup_dlg.cpp b/wx+/popup_dlg.cpp index 5babaff3..6633d2ab 100755 --- a/wx+/popup_dlg.cpp +++ b/wx+/popup_dlg.cpp @@ -15,18 +15,12 @@ using namespace zen; + namespace { -void setAsStandard(wxButton& btn) -{ - btn.SetDefault(); - btn.SetFocus(); -} - - void setBestInitialSize(wxTextCtrl& ctrl, const wxString& text, wxSize maxSize) { - const int scrollbarWidth = 30; + const int scrollbarWidth = fastFromDIP(20); if (maxSize.x <= scrollbarWidth) //implicitly checks for non-zero, too! return; maxSize.x -= scrollbarWidth; @@ -117,8 +111,9 @@ public: SetTitle(wxTheApp->GetAppDisplayName() + SPACED_DASH + titleTmp); } - int maxWidth = 500; - int maxHeight = 400; //try to determine better value based on actual display resolution: + int maxWidth = fastFromDIP(500); + int maxHeight = fastFromDIP(400); //try to determine better value based on actual display resolution: + //int [maxWidth, maxHeight] = wxSize(fastFromDIP(500), fastFromDIP(400)); if (parent) { @@ -139,7 +134,10 @@ public: if (!cfg.textDetail.empty()) { - const wxString& text = L"\n" + trimCpy(cfg.textDetail) + L"\n"; //add empty top/bottom lines *instead* of using border space! + wxString text; + if (!cfg.textMain.empty()) + text += L"\n"; + text += trimCpy(cfg.textDetail) + L"\n"; //add empty top/bottom lines *instead* of using border space! setBestInitialSize(*m_textCtrlTextDetail, text, wxSize(maxWidth, maxHeight)); m_textCtrlTextDetail->ChangeValue(text); } @@ -200,9 +198,10 @@ public: //set std order after button visibility was set setStandardButtonLayout(*bSizerStdButtons, stdBtns); - setAsStandard(*m_buttonAccept); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() Center(); //needs to be re-applied after a dialog size change! + + m_buttonAccept->SetFocus(); } private: |