From 32461c91e90452c05389e8574e12e76479bf0bcf Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 22 Aug 2022 17:57:55 +0100 Subject: [PATCH] Wide status bars can afford to give the text more room. --- common/widgets/ui_common.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/widgets/ui_common.cpp b/common/widgets/ui_common.cpp index 7743297ac9..8fa1d284a8 100644 --- a/common/widgets/ui_common.cpp +++ b/common/widgets/ui_common.cpp @@ -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 ); }