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
@@ -269,7 +269,7 @@ Image RID_SVXBMP_SLIDERBUTTON
269{ 269{
270 ImageBitmap = Bitmap 270 ImageBitmap = Bitmap
271 { 271 {
272 File = "navigationball_10.png" ; 272 File = "slidezoombutton_10.png" ;
273 }; 273 };
274 MaskColor = STD_MASKCOLOR; 274 MaskColor = STD_MASKCOLOR;
275}; 275};
@@ -277,7 +277,7 @@ Image RID_SVXBMP_SLIDERDECREASE
277{ 277{
278 ImageBitmap = Bitmap 278 ImageBitmap = Bitmap
279 { 279 {
280 File = "slidezoomout_11.png" ; 280 File = "slidezoomout_10.png" ;
281 }; 281 };
282 MaskColor = STD_MASKCOLOR; 282 MaskColor = STD_MASKCOLOR;
283}; 283};
@@ -285,7 +285,7 @@ Image RID_SVXBMP_SLIDERINCREASE
285{ 285{
286 ImageBitmap = Bitmap 286 ImageBitmap = Bitmap
287 { 287 {
288 File = "slidezoomin_11.png" ; 288 File = "slidezoomin_10.png" ;
289 }; 289 };
290 MaskColor = STD_MASKCOLOR; 290 MaskColor = STD_MASKCOLOR;
291}; 291};
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 @@
32#include <vcl/status.hxx> 32#include <vcl/status.hxx>
33#include <vcl/menu.hxx> 33#include <vcl/menu.hxx>
34#include <vcl/image.hxx> 34#include <vcl/image.hxx>
35#include <vcl/svapp.hxx>
35#include <svx/zoomslideritem.hxx> 36#include <svx/zoomslideritem.hxx>
36#include <svx/dialmgr.hxx> 37#include <svx/dialmgr.hxx>
37#include <svx/dialogs.hrc> 38#include <svx/dialogs.hrc>
@@ -78,8 +79,8 @@ struct SvxZoomSliderControl::SvxZoomSliderControl_Impl
78 79
79const long nButtonWidth = 10; 80const long nButtonWidth = 10;
80const long nButtonHeight = 10; 81const long nButtonHeight = 10;
81const long nIncDecWidth = 11; 82const long nIncDecWidth = 10;
82const long nIncDecHeight = 11; 83const long nIncDecHeight = 10;
83const long nSliderHeight = 2; 84const long nSliderHeight = 2;
84const long nSnappingHeight = 4; 85const long nSnappingHeight = 4;
85const long nSliderXOffset = 20; 86const long nSliderXOffset = 20;
@@ -268,16 +269,17 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt )
268 Rectangle aRect = rUsrEvt.GetRect(); 269 Rectangle aRect = rUsrEvt.GetRect();
269 Rectangle aSlider = aRect; 270 Rectangle aSlider = aRect;
270 271
271 aSlider.Top() += (aControlRect.GetHeight() - nSliderHeight)/2 - 1; 272 aSlider.Top() += (aControlRect.GetHeight() - nSliderHeight)/2;
272 aSlider.Bottom() = aSlider.Top() + nSliderHeight; 273 aSlider.Bottom() = aSlider.Top() + nSliderHeight - 1;
273 aSlider.Left() += nSliderXOffset; 274 aSlider.Left() += nSliderXOffset;
274 aSlider.Right() -= nSliderXOffset; 275 aSlider.Right() -= nSliderXOffset;
275 276
276 Color aOldLineColor = pDev->GetLineColor(); 277 Color aOldLineColor = pDev->GetLineColor();
277 Color aOldFillColor = pDev->GetFillColor(); 278 Color aOldFillColor = pDev->GetFillColor();
278 279
279 pDev->SetLineColor( Color( COL_GRAY ) ); 280 const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
280 pDev->SetFillColor( Color( COL_GRAY ) ); 281 pDev->SetLineColor( rStyleSettings.GetShadowColor() );
282 pDev->SetFillColor( rStyleSettings.GetShadowColor() );
281 283
282 // draw snapping points: 284 // draw snapping points:
283 std::vector< long >::iterator aSnappingPointIter; 285 std::vector< long >::iterator aSnappingPointIter;
@@ -285,40 +287,14 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt )
285 aSnappingPointIter != mpImpl->maSnappingPointOffsets.end(); 287 aSnappingPointIter != mpImpl->maSnappingPointOffsets.end();
286 ++aSnappingPointIter ) 288 ++aSnappingPointIter )
287 { 289 {
288 Rectangle aSnapping( aRect ); 290 long nSnapPosX = aRect.Left() + *aSnappingPointIter;
289 aSnapping.Bottom() = aSlider.Top(); 291
290 aSnapping.Top() = aSnapping.Bottom() - nSnappingHeight; 292 pDev->DrawRect( Rectangle( nSnapPosX - 1, aSlider.Top() - nSnappingHeight,
291 aSnapping.Left() += *aSnappingPointIter; 293 nSnapPosX, aSlider.Bottom() + nSnappingHeight ) );
292 aSnapping.Right() = aSnapping.Left();
293 pDev->DrawRect( aSnapping );
294
295 aSnapping.Top() += nSnappingHeight + nSliderHeight;
296 aSnapping.Bottom() += nSnappingHeight + nSliderHeight;
297 pDev->DrawRect( aSnapping );
298 } 294 }
299 295
300 // draw slider 296 // draw slider
301 Rectangle aFirstLine( aSlider ); 297 pDev->DrawRect( aSlider );
302 aFirstLine.Bottom() = aFirstLine.Top();
303
304 Rectangle aSecondLine( aSlider );
305 aSecondLine.Top() = aSecondLine.Bottom();
306
307 Rectangle aLeft( aSlider );
308 aLeft.Right() = aLeft.Left();
309
310 Rectangle aRight( aSlider );
311 aRight.Left() = aRight.Right();
312
313 pDev->SetLineColor( Color ( COL_WHITE ) );
314 pDev->SetFillColor( Color ( COL_WHITE ) );
315 pDev->DrawRect( aSecondLine );
316 pDev->DrawRect( aRight );
317
318 pDev->SetLineColor( Color( COL_GRAY ) );
319 pDev->SetFillColor( Color( COL_GRAY ) );
320 pDev->DrawRect( aFirstLine );
321 pDev->DrawRect( aLeft );
322 298
323 // draw slider button 299 // draw slider button
324 Point aImagePoint = aRect.TopLeft(); 300 Point aImagePoint = aRect.TopLeft();