diff options
Diffstat (limited to 'wx+/popup_dlg.cpp')
-rw-r--r-- | wx+/popup_dlg.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/wx+/popup_dlg.cpp b/wx+/popup_dlg.cpp index b5a194ad..9f29badc 100644 --- a/wx+/popup_dlg.cpp +++ b/wx+/popup_dlg.cpp @@ -91,6 +91,17 @@ void setBestInitialSize(wxRichTextCtrl& ctrl, const wxString& text, wxSize maxSi } +int zen::getTextCtrlHeight(wxTextCtrl& ctrl, double rowCount) +{ + const int rowHeight = + ctrl.GetTextExtent(L"X").GetHeight(); + + return std::round( + 2 + + rowHeight * rowCount); +} + + class zen::StandardPopupDialog : public PopupDialogGenerated { public: @@ -277,8 +288,8 @@ public: GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() #ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) + Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 + Hide(); //avoid old position flash when Center() moves window (asynchronously?) #endif Center(); //needs to be re-applied after a dialog size change! |