[Libreoffice-commits] core.git: 2 commits - sfx2/source svx/source
heiko tietze
tietze.heiko at gmail.com
Sun Apr 15 16:52:33 UTC 2018
sfx2/source/control/recentdocsview.cxx | 19 +++++++++----------
svx/source/stbctrls/zoomsliderctrl.cxx | 17 ++++++++++-------
2 files changed, 19 insertions(+), 17 deletions(-)
New commits:
commit 04ee7404f3d00d6748324b6f60736a9326920b64
Author: heiko tietze <tietze.heiko at gmail.com>
Date: Sun Apr 15 12:02:20 2018 +0200
tdf#108556 - Start center welcome text should respect window width
Wordwrap on second line added
Change-Id: I1b50173eca4fa1c19d25291413fa0bebbcad9190
Reviewed-on: https://gerrit.libreoffice.org/52906
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Heiko Tietze <tietze.heiko at gmail.com>
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 0318b6bcf140..31591e3db568 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -346,22 +346,21 @@ void RecentDocsView::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
long nTextHeight = rRenderContext.GetTextHeight();
- long nTextWidth1 = rRenderContext.GetTextWidth(maWelcomeLine1);
- long nTextWidth2 = rRenderContext.GetTextWidth(maWelcomeLine2);
-
const Size& rImgSize = maWelcomeImage.GetSizePixel();
const Size& rSize = GetSizePixel();
const int nX = (rSize.Width() - rImgSize.Width())/2;
- const int nY = (rSize.Height() - 3 * nTextHeight - rImgSize.Height())/2;
-
+ int nY = (rSize.Height() - 3 * nTextHeight - rImgSize.Height())/2;
Point aImgPoint(nX, nY);
- Point aStr1Point((rSize.Width() - nTextWidth1)/2, nY + rImgSize.Height());
- Point aStr2Point((rSize.Width() - nTextWidth2)/2, nY + rImgSize.Height() + 1.5 * nTextHeight);
-
rRenderContext.DrawImage(aImgPoint, rImgSize, maWelcomeImage);
- rRenderContext.DrawText(aStr1Point, maWelcomeLine1);
- rRenderContext.DrawText(aStr2Point, maWelcomeLine2);
+
+ nY = nY + rImgSize.Height();
+ rRenderContext.DrawText(tools::Rectangle(0, nY, rSize.Width(), nY + nTextHeight),
+ maWelcomeLine1,
+ DrawTextFlags::Center);
+ rRenderContext.DrawText(tools::Rectangle(0, nY + 1.5 * nTextHeight, rSize.Width(), rSize.Height()),
+ maWelcomeLine2,
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak | DrawTextFlags::Center);
rRenderContext.Pop();
}
commit 7d10bcb23624db11ca6445f5cb33a28660f16fd4
Author: heiko tietze <tietze.heiko at gmail.com>
Date: Sun Apr 15 16:39:40 2018 +0200
tdf#50507 - zoom slider always looks like disabled
Slider smaller, in darkshadow color and with a tiny shadow
Change-Id: I0e5253648749fb4190c03ab458498d64dc0388c5
Reviewed-on: https://gerrit.libreoffice.org/52912
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Heiko Tietze <tietze.heiko at gmail.com>
diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx
index 449a1a9bc6fc..a8afa60b4cb7 100644
--- a/svx/source/stbctrls/zoomsliderctrl.cxx
+++ b/svx/source/stbctrls/zoomsliderctrl.cxx
@@ -235,8 +235,8 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt )
tools::Rectangle aRect = rUsrEvt.GetRect();
tools::Rectangle aSlider = aRect;
- long nSliderHeight = 2 * pDev->GetDPIScaleFactor();
- long nSnappingHeight = 4 * pDev->GetDPIScaleFactor();
+ long nSliderHeight = 1 * pDev->GetDPIScaleFactor();
+ long nSnappingHeight = 2 * pDev->GetDPIScaleFactor();
aSlider.AdjustTop((aControlRect.GetHeight() - nSliderHeight)/2 );
aSlider.SetBottom( aSlider.Top() + nSliderHeight - 1 );
@@ -247,9 +247,15 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt )
Color aOldFillColor = pDev->GetFillColor();
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- pDev->SetLineColor( rStyleSettings.GetShadowColor() );
- pDev->SetFillColor( rStyleSettings.GetShadowColor() );
+ pDev->SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ pDev->SetFillColor( rStyleSettings.GetDarkShadowColor() );
+ // draw slider
+ pDev->DrawRect( aSlider );
+ // shadow
+ pDev->SetLineColor( rStyleSettings.GetShadowColor() );
+ pDev->DrawLine(Point(aSlider.Left()+1,aSlider.Bottom()+1), Point(aSlider.Right()+1,aSlider.Bottom()+1));
+ pDev->SetLineColor( rStyleSettings.GetDarkShadowColor() );
// draw snapping points:
for ( std::vector< long >::const_iterator aSnappingPointIter = mxImpl->maSnappingPointOffsets.begin(),
@@ -263,9 +269,6 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt )
nSnapPosX, aSlider.Bottom() + nSnappingHeight ) );
}
- // draw slider
- pDev->DrawRect( aSlider );
-
// draw slider button
Point aImagePoint = aRect.TopLeft();
aImagePoint.AdjustX(Zoom2Offset( mxImpl->mnCurrentZoom ) );
More information about the Libreoffice-commits
mailing list