diff options
author | Gábor Stefanik <netrolller.3d@gmail.com> | 2012-04-12 14:08:02 +0200 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-04-12 14:10:52 +0200 |
commit | 5f2825dde8a44773fc6ce19f2dd4e328c4e88eaf (patch) | |
tree | 30d46e51d8cb541dd67950fbbbe56b83ee758560 | |
parent | fdo#48584 Shift+F3 should be the shourtcut for Edit > Duplicate in Draw (diff) | |
download | core-5f2825dde8a44773fc6ce19f2dd4e328c4e88eaf.tar.gz core-5f2825dde8a44773fc6ce19f2dd4e328c4e88eaf.zip |
fdo#34392 recompute column widths after font scale change in startcenter
-rw-r--r-- | framework/source/services/backingwindow.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index ca0e9e7fd9a0..0b07e6fedec6 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -273,6 +273,8 @@ void BackingWindow::DataChanged( const DataChangedEvent& rDCEvt ) { initBackground(); Invalidate(); + // fdo#34392: Resize buttons to match the new text size. + Resize(); } } @@ -797,6 +799,23 @@ void BackingWindow::Resize() long nYPos = maControlRect.Top() + mnBtnTop; + // Recompute column widths + mnTextColumnWidth[0] = maWriterButton.GetTextWidth( maWriterButton.GetText() ) + maButtonImageSize.Width() + 8; + if( mnTextColumnWidth[0] < maCalcButton.GetTextWidth( maCalcButton.GetText() ) + maButtonImageSize.Width() + 8 ) + mnTextColumnWidth[0] = maCalcButton.GetTextWidth( maCalcButton.GetText() ) + maButtonImageSize.Width() + 8; + if( mnTextColumnWidth[0] < maImpressButton.GetTextWidth( maImpressButton.GetText() ) + maButtonImageSize.Width() + 8 ) + mnTextColumnWidth[0] = maImpressButton.GetTextWidth( maImpressButton.GetText() ) + maButtonImageSize.Width() + 8; + if( mnTextColumnWidth[0] < maOpenButton.GetTextWidth( maOpenButton.GetText() ) + maButtonImageSize.Width() + 26 ) + mnTextColumnWidth[0] = maOpenButton.GetTextWidth( maOpenButton.GetText() ) + maButtonImageSize.Width() + 26; + + mnTextColumnWidth[1] = maDrawButton.GetTextWidth( maDrawButton.GetText() ) + maButtonImageSize.Width() + 8; + if( mnTextColumnWidth[1] < maDBButton.GetTextWidth( maDBButton.GetText() ) + maButtonImageSize.Width() + 8 ) + mnTextColumnWidth[1] = maDBButton.GetTextWidth( maDBButton.GetText() ) + maButtonImageSize.Width() + 8; + if( mnTextColumnWidth[1] < maMathButton.GetTextWidth( maMathButton.GetText() ) + maButtonImageSize.Width() + 8 ) + mnTextColumnWidth[1] = maMathButton.GetTextWidth( maMathButton.GetText() ) + maButtonImageSize.Width() + 8; + if( mnTextColumnWidth[1] < maTemplateButton.GetTextWidth( maTemplateButton.GetText() ) + maButtonImageSize.Width() + 8 ) + mnTextColumnWidth[1] = maTemplateButton.GetTextWidth( maTemplateButton.GetText() ) + maButtonImageSize.Width() + 8; + maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) ); maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) ); nYPos += nBDelta - nDiff; |