summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-05-22 16:00:27 (GMT)
committerJan Holesovsky <kendy@suse.cz>2012-05-22 16:49:49 (GMT)
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 0000000..da237b0
--- /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 0000000..0cafa0c
--- /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 9983b56..0000000
--- 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 0000000..d730b61
--- /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 a0813f9..0000000
--- 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 67a0bf1..0000000
--- 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 b2dabbd..0000000
--- 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 deee8a8..0000000
--- 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 06c7128..0000000
--- 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 deee8a8..0000000
--- 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 06c7128..0000000
--- 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 dea916d..745a8db 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 66b5d4d..71381d1 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();