diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-08 12:33:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-24 13:04:21 +0200 |
commit | faa4ebb2cdc99505e9be7e1cbed83b19acfd3c4a (patch) | |
tree | 0d6ee926ac5cc5b12262ecc9f47e2e40cc5d3e8d /svx | |
parent | 808da2c918e662c19618c9f4035e8c9a802bb887 (diff) |
tdf#127411 improve sizing of status items in the status bar
Change-Id: I6ea3fbb893d0141010ee1abd1720d6cdad97b528
Reviewed-on: https://gerrit.libreoffice.org/80440
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/stbctrls/pszctrl.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index ddb66bd5253a..084d251c91dd 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -462,22 +462,26 @@ void SvxPosSizeStatusBarControl::ImplUpdateItemText() // set only strings as text at the statusBar, so that the Help-Tips // can work with the text, when it is too long for the statusBar OUString aText; + int nCharsWidth = -1; if ( pImpl->bPos || pImpl->bSize ) { aText = GetMetricStr_Impl( pImpl->aPos.X()); aText += " / "; aText += GetMetricStr_Impl( pImpl->aPos.Y()); + // widest X/Y string looks like "-999,99" + nCharsWidth = 1 + 6 + 3 + 6; // icon + x + slash + y if ( pImpl->bSize ) { aText += " "; aText += GetMetricStr_Impl( pImpl->aSize.Width() ); aText += " x "; aText += GetMetricStr_Impl( pImpl->aSize.Height() ); + nCharsWidth += 1 + 1 + 4 + 3 + 4; // icon + space + w + x + h } } else if ( pImpl->bTable ) aText = pImpl->aStr; - GetStatusBar().SetItemText( GetId(), aText ); + GetStatusBar().SetItemText( GetId(), aText, nCharsWidth ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |