summaryrefslogtreecommitdiff
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
parent51fdf273e9893d3d05c99a09e1c2e5835a78e891 (diff)
zoom slider: Implemented design by Mirek M.
Simpler, and more light-weight now. Change-Id: I1d512f92714b0836dc75a187024af263e208484f
-rw-r--r--icon-themes/galaxy/svx/res/slidezoombutton_10.pngbin0 -> 268 bytes
-rw-r--r--icon-themes/galaxy/svx/res/slidezoomin_10.pngbin0 -> 191 bytes
-rw-r--r--icon-themes/galaxy/svx/res/slidezoomin_11.pngbin373 -> 0 bytes
-rw-r--r--icon-themes/galaxy/svx/res/slidezoomout_10.pngbin0 -> 174 bytes
-rw-r--r--icon-themes/galaxy/svx/res/slidezoomout_11.pngbin354 -> 0 bytes
-rw-r--r--icon-themes/hicontrast/svx/res/slidezoomin_11.pngbin119 -> 0 bytes
-rw-r--r--icon-themes/hicontrast/svx/res/slidezoomout_11.pngbin119 -> 0 bytes
-rw-r--r--icon-themes/human/svx/res/slidezoomin_11.pngbin562 -> 0 bytes
-rw-r--r--icon-themes/human/svx/res/slidezoomout_11.pngbin539 -> 0 bytes
-rw-r--r--icon-themes/oxygen/svx/res/slidezoomin_11.pngbin562 -> 0 bytes
-rw-r--r--icon-themes/oxygen/svx/res/slidezoomout_11.pngbin539 -> 0 bytes
-rw-r--r--svx/source/stbctrls/stbctrls.src6
-rw-r--r--svx/source/stbctrls/zoomsliderctrl.cxx50
13 files changed, 16 insertions, 40 deletions
diff --git a/icon-themes/galaxy/svx/res/slidezoombutton_10.png b/icon-themes/galaxy/svx/res/slidezoombutton_10.png
new file mode 100644
index 000000000000..da237b0c2569
--- /dev/null
+++ b/icon-themes/galaxy/svx/res/slidezoombutton_10.png
Binary files differ
diff --git a/icon-themes/galaxy/svx/res/slidezoomin_10.png b/icon-themes/galaxy/svx/res/slidezoomin_10.png
new file mode 100644
index 000000000000..0cafa0c5335e
--- /dev/null
+++ b/icon-themes/galaxy/svx/res/slidezoomin_10.png
Binary files differ
diff --git a/icon-themes/galaxy/svx/res/slidezoomin_11.png b/icon-themes/galaxy/svx/res/slidezoomin_11.png
deleted file mode 100644
index 9983b5662340..000000000000
--- a/icon-themes/galaxy/svx/res/slidezoomin_11.png
+++ /dev/null
Binary files differ
diff --git a/icon-themes/galaxy/svx/res/slidezoomout_10.png b/icon-themes/galaxy/svx/res/slidezoomout_10.png
new file mode 100644
index 000000000000..d730b61a3760
--- /dev/null
+++ b/icon-themes/galaxy/svx/res/slidezoomout_10.png
Binary files differ
diff --git a/icon-themes/galaxy/svx/res/slidezoomout_11.png b/icon-themes/galaxy/svx/res/slidezoomout_11.png
deleted file mode 100644
index a0813f9e071e..000000000000
--- a/icon-themes/galaxy/svx/res/slidezoomout_11.png
+++ /dev/null
Binary files differ
diff --git a/icon-themes/hicontrast/svx/res/slidezoomin_11.png b/icon-themes/hicontrast/svx/res/slidezoomin_11.png
deleted file mode 100644
index 67a0bf12ffbe..000000000000
--- a/icon-themes/hicontrast/svx/res/slidezoomin_11.png
+++ /dev/null
Binary files differ
diff --git a/icon-themes/hicontrast/svx/res/slidezoomout_11.png b/icon-themes/hicontrast/svx/res/slidezoomout_11.png
deleted file mode 100644
index b2dabbd9f2da..000000000000
--- a/icon-themes/hicontrast/svx/res/slidezoomout_11.png
+++ /dev/null
Binary files differ
diff --git a/icon-themes/human/svx/res/slidezoomin_11.png b/icon-themes/human/svx/res/slidezoomin_11.png
deleted file mode 100644
index deee8a81af59..000000000000
--- a/icon-themes/human/svx/res/slidezoomin_11.png
+++ /dev/null
Binary files differ
diff --git a/icon-themes/human/svx/res/slidezoomout_11.png b/icon-themes/human/svx/res/slidezoomout_11.png
deleted file mode 100644
index 06c71288017e..000000000000
--- a/icon-themes/human/svx/res/slidezoomout_11.png
+++ /dev/null
Binary files differ
diff --git a/icon-themes/oxygen/svx/res/slidezoomin_11.png b/icon-themes/oxygen/svx/res/slidezoomin_11.png
deleted file mode 100644
index deee8a81af59..000000000000
--- a/icon-themes/oxygen/svx/res/slidezoomin_11.png
+++ /dev/null
Binary files differ
diff --git a/icon-themes/oxygen/svx/res/slidezoomout_11.png b/icon-themes/oxygen/svx/res/slidezoomout_11.png
deleted file mode 100644
index 06c71288017e..000000000000
--- a/icon-themes/oxygen/svx/res/slidezoomout_11.png
+++ /dev/null
Binary files differ
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
@@ -266,29 +266,29 @@ Image RID_SVXBMP_SIGNET_NOTVALIDATED
Image RID_SVXBMP_SLIDERBUTTON
{
ImageBitmap = Bitmap
{
- File = "navigationball_10.png" ;
+ File = "slidezoombutton_10.png" ;
};
MaskColor = STD_MASKCOLOR;
};
Image RID_SVXBMP_SLIDERDECREASE
{
ImageBitmap = Bitmap
{
- File = "slidezoomout_11.png" ;
+ File = "slidezoomout_10.png" ;
};
MaskColor = STD_MASKCOLOR;
};
Image RID_SVXBMP_SLIDERINCREASE
{
ImageBitmap = Bitmap
{
- File = "slidezoomin_11.png" ;
+ File = "slidezoomin_10.png" ;
};
MaskColor = STD_MASKCOLOR;
};
Image RID_SVXBMP_DOC_MODIFIED_YES
{
ImageBitmap = Bitmap
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
@@ -29,12 +29,13 @@
// include ---------------------------------------------------------------
#include <svx/zoomsliderctrl.hxx>
#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>
#include <basegfx/tools/zoomtools.hxx>
@@ -75,14 +76,14 @@ 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;
const long nSnappingEpsilon = 5; // snapping epsilon in pixels
const long nSnappingPointsMinDist = nSnappingEpsilon; // minimum distance of two adjacent snapping points
@@ -265,63 +266,38 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt )
const Rectangle aControlRect = getControlRect();
OutputDevice* pDev = rUsrEvt.GetDevice();
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;
for ( aSnappingPointIter = mpImpl->maSnappingPointOffsets.begin();
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();
aImagePoint.X() += Zoom2Offset( mpImpl->mnCurrentZoom );
aImagePoint.X() -= nButtonWidth/2;
aImagePoint.Y() += (aControlRect.GetHeight() - nButtonHeight)/2;