FIX: enable focus navigation in SpinInput/TextInput

Change-Id: I32671cb8aa23f85b868284c41a66c583161e1b89
This commit is contained in:
chunmao.guo 2022-07-27 19:33:30 +08:00 committed by Lane.Wei
parent a302a58c9e
commit 7a5bca3c30
4 changed files with 47 additions and 20 deletions

View file

@ -61,7 +61,6 @@ void TextInput::Create(wxWindow * parent,
{
text_ctrl = nullptr;
wxWindow::Create(parent, wxID_ANY, pos, size, style);
wxWindow::SetLabel(label);
style &= ~wxRIGHT;
state_handler.attach({&border_color, &text_color, &background_color});
@ -246,6 +245,9 @@ void TextInput::messureSize()
wxClientDC dc(this);
labelSize = dc.GetTextExtent(wxWindow::GetLabel());
wxSize textSize = text_ctrl->GetSize();
#ifdef __WXOSX__
textSize.y -= 3; // TODO:
#endif
int h = textSize.y + 8;
if (size.y < h) {
size.y = h;