Wide status bars can afford to give the text more room.

This commit is contained in:
Jeff Young 2022-08-22 17:57:55 +01:00
parent 4b63c7012d
commit 32461c91e9
1 changed files with 6 additions and 1 deletions

View File

@ -191,7 +191,12 @@ wxString KIUI::EllipsizeStatusText( wxWindow* aWindow, const wxString& aString )
msg.Replace( wxT( "\t" ), wxT( " " ) );
wxClientDC dc( aWindow );
return wxControl::Ellipsize( msg, dc, wxELLIPSIZE_END, aWindow->GetSize().GetWidth() / 3 );
int statusWidth = aWindow->GetSize().GetWidth();
// 30% of the first 800 pixels plus 60% of the remaining width
int textWidth = std::min( statusWidth, 800 ) * 0.3 + std::max( statusWidth - 800, 0 ) * 0.6;
return wxControl::Ellipsize( msg, dc, wxELLIPSIZE_END, textWidth );
}