summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-18 14:42:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-02-18 15:48:31 +0000
commit4f034adcb79684bc4138e2f9708defd8a3532f74 (patch)
tree3f18328920f396bdd04162d8b1b6358a3fdc95a6
parentcee3b45977d34f290e50a8fbc8b0dd60ef10faae (diff)
Resolves: tdf#97953 spinbuttons are not suitable for reuse as up/down arrows
Change-Id: Ibcd7bd4099210a26513caac6e3b16a88a4c8abad
-rw-r--r--vcl/inc/spin.hxx9
-rw-r--r--vcl/source/control/spinfld.cxx11
-rw-r--r--vcl/source/window/toolbox.cxx4
3 files changed, 22 insertions, 2 deletions
diff --git a/vcl/inc/spin.hxx b/vcl/inc/spin.hxx
index 9b5c080b907e..0ccfca50def8 100644
--- a/vcl/inc/spin.hxx
+++ b/vcl/inc/spin.hxx
@@ -24,11 +24,20 @@
class Rectangle;
+// Draw Spinners as found in a SpinButton. Some themes like gtk3 will draw +- elements here,
+// so these are only suitable in the context of SpinButtons
void ImplDrawSpinButton(vcl::RenderContext& rRenderContext, vcl::Window* pWindow,
const Rectangle& rUpperRect, const Rectangle& rLowerRect,
bool bUpperIn, bool bLowerIn, bool bUpperEnabled = true, bool bLowerEnabled = true,
bool bHorz = false, bool bMirrorHorz = false);
+// Draw Up/Down buttons suitable for use in any context
+void ImplDrawUpDownButtons(vcl::RenderContext& rRenderContext,
+ const Rectangle& rUpperRect, const Rectangle& rLowerRect,
+ bool bUpperIn, bool bLowerIn, bool bUpperEnabled = true, bool bLowerEnabled = true,
+ bool bHorz = false, bool bMirrorHorz = false);
+
+
#endif // INCLUDED_VCL_INC_SPIN_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 032bdc163637..c8a601dc61de 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -197,6 +197,17 @@ void ImplDrawSpinButton(vcl::RenderContext& rRenderContext, vcl::Window* pWindow
if (bNativeOK)
return;
+ ImplDrawUpDownButtons(rRenderContext,
+ rUpperRect, rLowerRect,
+ bUpperIn, bLowerIn, bUpperEnabled, bLowerEnabled,
+ bHorz, bMirrorHorz);
+}
+
+void ImplDrawUpDownButtons(vcl::RenderContext& rRenderContext,
+ const Rectangle& rUpperRect, const Rectangle& rLowerRect,
+ bool bUpperIn, bool bLowerIn, bool bUpperEnabled, bool bLowerEnabled,
+ bool bHorz, bool bMirrorHorz)
+{
DecorationView aDecoView(&rRenderContext);
SymbolType eType1, eType2;
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index e65d04f96773..2dbad9063798 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -2906,8 +2906,8 @@ void ToolBox::ImplDrawSpin(vcl::RenderContext& rRenderContext, bool bUpperIn, bo
bTmpLower = false;
}
- ImplDrawSpinButton(rRenderContext, this, maUpperRect, maLowerRect,
- bUpperIn, bLowerIn, bTmpUpper, bTmpLower, !mbHorz);
+ ImplDrawUpDownButtons(rRenderContext, maUpperRect, maLowerRect,
+ bUpperIn, bLowerIn, bTmpUpper, bTmpLower, !mbHorz);
}
void ToolBox::ImplDrawSeparator(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, const Rectangle& rRect)