summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-05-22 18:00:27 +0200
committerJan Holesovsky <kendy@suse.cz>2012-05-22 18:49:49 +0200
commitbc1fd830be6165c364805c2ad09854ecc8e863a6 (patch)
tree7572ba603f6c5a7ce6a95fb614f0e9b67013da4f /svx
parent51fdf273e9893d3d05c99a09e1c2e5835a78e891 (diff)
zoom slider: Implemented design by Mirek M.
Simpler, and more light-weight now. Change-Id: I1d512f92714b0836dc75a187024af263e208484f
Diffstat (limited to 'svx')
-rw-r--r--svx/source/stbctrls/stbctrls.src6
-rw-r--r--svx/source/stbctrls/zoomsliderctrl.cxx50
2 files changed, 16 insertions, 40 deletions
diff --git a/svx/source/stbctrls/stbctrls.src b/svx/source/stbctrls/stbctrls.src
index dea916dba6e7..745a8dbcbfc0 100644
--- a/svx/source/stbctrls/stbctrls.src
+++ b/svx/source/stbctrls/stbctrls.src
@@ -269,7 +269,7 @@ Image RID_SVXBMP_SLIDERBUTTON
{
ImageBitmap = Bitmap
{
- File = "navigationball_10.png" ;
+ File = "slidezoombutton_10.png" ;
};
MaskColor = STD_MASKCOLOR;
};
@@ -277,7 +277,7 @@ Image RID_SVXBMP_SLIDERDECREASE
{
ImageBitmap = Bitmap
{
- File = "slidezoomout_11.png" ;
+ File = "slidezoomout_10.png" ;
};
MaskColor = STD_MASKCOLOR;
};
@@ -285,7 +285,7 @@ Image RID_SVXBMP_SLIDERINCREASE
{
ImageBitmap = Bitmap
{
- File = "slidezoomin_11.png" ;
+ File = "slidezoomin_10.png" ;
};
MaskColor = STD_MASKCOLOR;
};
diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx
index 66b5d4dc404d..71381d162b81 100644
--- a/svx/source/stbctrls/zoomsliderctrl.cxx
+++ b/svx/source/stbctrls/zoomsliderctrl.cxx
@@ -32,6 +32,7 @@
#include <vcl/status.hxx>
#include <vcl/menu.hxx>
#include <vcl/image.hxx>
+#include <vcl/svapp.hxx>
#include <svx/zoomslideritem.hxx>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
@@ -78,8 +79,8 @@ struct SvxZoomSliderControl::SvxZoomSliderControl_Impl
const long nButtonWidth = 10;
const long nButtonHeight = 10;
-const long nIncDecWidth = 11;
-const long nIncDecHeight = 11;
+const long nIncDecWidth = 10;
+const long nIncDecHeight = 10;
const long nSliderHeight = 2;
const long nSnappingHeight = 4;
const long nSliderXOffset = 20;
@@ -268,16 +269,17 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt )
Rectangle aRect = rUsrEvt.GetRect();
Rectangle aSlider = aRect;
- aSlider.Top() += (aControlRect.GetHeight() - nSliderHeight)/2 - 1;
- aSlider.Bottom() = aSlider.Top() + nSliderHeight;
+ aSlider.Top() += (aControlRect.GetHeight() - nSliderHeight)/2;
+ aSlider.Bottom() = aSlider.Top() + nSliderHeight - 1;
aSlider.Left() += nSliderXOffset;
aSlider.Right() -= nSliderXOffset;
Color aOldLineColor = pDev->GetLineColor();
Color aOldFillColor = pDev->GetFillColor();
- pDev->SetLineColor( Color( COL_GRAY ) );
- pDev->SetFillColor( Color( COL_GRAY ) );
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+ pDev->SetLineColor( rStyleSettings.GetShadowColor() );
+ pDev->SetFillColor( rStyleSettings.GetShadowColor() );
// draw snapping points:
std::vector< long >::iterator aSnappingPointIter;
@@ -285,40 +287,14 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt )
aSnappingPointIter != mpImpl->maSnappingPointOffsets.end();
++aSnappingPointIter )
{
- Rectangle aSnapping( aRect );
- aSnapping.Bottom() = aSlider.Top();
- aSnapping.Top() = aSnapping.Bottom() - nSnappingHeight;
- aSnapping.Left() += *aSnappingPointIter;
- aSnapping.Right() = aSnapping.Left();
- pDev->DrawRect( aSnapping );
-
- aSnapping.Top() += nSnappingHeight + nSliderHeight;
- aSnapping.Bottom() += nSnappingHeight + nSliderHeight;
- pDev->DrawRect( aSnapping );
+ long nSnapPosX = aRect.Left() + *aSnappingPointIter;
+
+ pDev->DrawRect( Rectangle( nSnapPosX - 1, aSlider.Top() - nSnappingHeight,
+ nSnapPosX, aSlider.Bottom() + nSnappingHeight ) );
}
// draw slider
- Rectangle aFirstLine( aSlider );
- aFirstLine.Bottom() = aFirstLine.Top();
-
- Rectangle aSecondLine( aSlider );
- aSecondLine.Top() = aSecondLine.Bottom();
-
- Rectangle aLeft( aSlider );
- aLeft.Right() = aLeft.Left();
-
- Rectangle aRight( aSlider );
- aRight.Left() = aRight.Right();
-
- pDev->SetLineColor( Color ( COL_WHITE ) );
- pDev->SetFillColor( Color ( COL_WHITE ) );
- pDev->DrawRect( aSecondLine );
- pDev->DrawRect( aRight );
-
- pDev->SetLineColor( Color( COL_GRAY ) );
- pDev->SetFillColor( Color( COL_GRAY ) );
- pDev->DrawRect( aFirstLine );
- pDev->DrawRect( aLeft );
+ pDev->DrawRect( aSlider );
// draw slider button
Point aImagePoint = aRect.TopLeft();