Hard code text control margins for GTK 2
Using GTKGetPreferredSize() doesn't always seem to return the correct values, resulting in making the control too big, so just hard code the smaller margins there.
This commit is contained in:
parent
489e4c869e
commit
4f6ddcf511
1 changed files with 8 additions and 0 deletions
|
|
@ -2150,8 +2150,16 @@ wxSize wxTextCtrl::DoGetSizeFromTextSize(int xlen, int ylen) const
|
|||
{
|
||||
// default height
|
||||
tsize.y = GTKGetPreferredSize(m_widget).y;
|
||||
#ifdef __WXGTK3__
|
||||
// Add the margins we have previously set.
|
||||
tsize.IncBy( GTKGetEntryMargins(GetEntry()) );
|
||||
#else
|
||||
// For GTK 2 these margins are too big, so hard code something more
|
||||
// reasonable, this is not great but should be fine considering
|
||||
// that it's very unlikely that GTK 2 is going to evolve, making
|
||||
// this inappropriate.
|
||||
tsize.IncBy(20, 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue