summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-08-30 23:34:09 +0200
committerJan Holesovsky <kendy@collabora.com>2018-11-08 09:14:34 +0100
commita2a49146cded46fb89f1a2a28e4c2aa838c2e48d (patch)
tree23a70a7b987b024a07fd9efe803392b5c80f5979 /vcl
parent26a620c8508cfdb5577b7a737b4ea0577555f4af (diff)
custom widgets: get the region from the lib. + custom tab width
This implements getting the region rectangle from the widget library so it is possible to redefine the size of the widgets if needed. Additionally increase a tab width which are too small by default. Change-Id: If662c44e02631715efd137ecbfc4a5770fa9f6ab
Diffstat (limited to 'vcl')
-rw-r--r--vcl/headless/CustomWidgetDraw.cxx17
-rw-r--r--vcl/inc/WidgetThemeLibrary.hxx4
2 files changed, 13 insertions, 8 deletions
diff --git a/vcl/headless/CustomWidgetDraw.cxx b/vcl/headless/CustomWidgetDraw.cxx
index a512a62bb178..ab4dec19b44e 100644
--- a/vcl/headless/CustomWidgetDraw.cxx
+++ b/vcl/headless/CustomWidgetDraw.cxx
@@ -275,15 +275,16 @@ bool CustomWidgetDraw::drawNativeControl(ControlType eType, ControlPart ePart,
return bOK;
}
-bool CustomWidgetDraw::getNativeControlRegion(ControlType /*eType*/, ControlPart /*ePart*/,
- const tools::Rectangle& /*rBoundingControlRegion*/,
- ControlState /*eState*/,
- const ImplControlValue& /*aValue*/,
- const OUString& /*aCaption*/,
- tools::Rectangle& /*rNativeBoundingRegion*/,
- tools::Rectangle& /*rNativeContentRegion*/)
+bool CustomWidgetDraw::getNativeControlRegion(
+ ControlType eType, ControlPart ePart, const tools::Rectangle& rBoundingControlRegion,
+ ControlState eState, const ImplControlValue& /*aValue*/, const OUString& /*aCaption*/,
+ tools::Rectangle& rNativeBoundingRegion, tools::Rectangle& rNativeContentRegion)
{
- return false;
+ if (s_pWidgetImplementation == nullptr)
+ return false;
+
+ return s_pWidgetImplementation->getRegion(eType, ePart, eState, rBoundingControlRegion,
+ rNativeBoundingRegion, rNativeContentRegion);
}
} // end vcl namespace
diff --git a/vcl/inc/WidgetThemeLibrary.hxx b/vcl/inc/WidgetThemeLibrary.hxx
index 6d4ab9dde196..53d5e5769ffa 100644
--- a/vcl/inc/WidgetThemeLibrary.hxx
+++ b/vcl/inc/WidgetThemeLibrary.hxx
@@ -42,6 +42,10 @@ public:
virtual ~WidgetThemeLibrary();
virtual bool isNativeControlSupported(ControlType eType, ControlPart ePart);
+ virtual bool getRegion(ControlType eType, ControlPart ePart, ControlState eState,
+ const tools::Rectangle& rBoundingControlRegion,
+ tools::Rectangle& rNativeBoundingRegion,
+ tools::Rectangle& rNativeContentRegion);
virtual bool drawPushButton(ControlDrawParameters const& rParameters, long nWidth,
long nHeight);