summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-06-20 13:00:58 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2019-06-22 20:53:22 +0200
commit466cc6c63c4020519d47ec442739f22d7779e901 (patch)
tree61a2ab7c0f0c7600a0e22dd4c4b6068dfdebff0c /include
parentQt5 directly show tooltips + respect the help area (diff)
downloadcore-466cc6c63c4020519d47ec442739f22d7779e901.tar.gz
core-466cc6c63c4020519d47ec442739f22d7779e901.zip
tdf#105884 Qt5 implement TabControl theming
Drawing a QTabWidget is a really complex procedure. The main problems I had were the adjustment of the frame, which I totally missed in the Qt code for a long time. Then there is the frame gap, which Qt draws by simply overlapping the items a bit with the frame. And all the calculations need the tabs together with the pane. None of it really fits very good into the way VCL handles drawing the TabControl and since I needed a way back from the plugin into VCL for the nOverlap value, there is this hack using a static. I hope nOverlap never changes. Change-Id: I8fe6eb12d39a2ac7f6fb89424586cac76e12545b Reviewed-on: https://gerrit.libreoffice.org/74480 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 430b406e5e8249983fc030aa0f867372f5da74d2) Reviewed-on: https://gerrit.libreoffice.org/74575
Diffstat (limited to 'include')
-rw-r--r--include/vcl/salnativewidgets.hxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
index 03d9a0eee00e..2a67ceb47b24 100644
--- a/include/vcl/salnativewidgets.hxx
+++ b/include/vcl/salnativewidgets.hxx
@@ -181,6 +181,9 @@ enum class ControlPart
// hardcoded 2 pixel overlap between adjacent tabs
TabsDrawRtl = 3000,
+// Qt doesn't have a separate header to draw
+ TabPaneWithHeader = 3001,
+
// For themes that do not want to have the focus
// rectangle part drawn by VCL but take care of the
// whole inner control part by themselves
@@ -340,6 +343,29 @@ class VCL_DLLPUBLIC SliderValue : public ImplControlValue
SliderValue & operator =(SliderValue &&) = delete; // due to ImplControlValue
};
+class VCL_DLLPUBLIC TabPaneValue : public ImplControlValue
+{
+public:
+ tools::Rectangle m_aTabHeaderRect;
+ tools::Rectangle m_aSelectedTabRect;
+ // increased tab size, so it'll overlab the frame rect when draing
+ // static value, as there is currently no sane way to return additional data
+ static int m_nOverlap;
+
+ TabPaneValue(const tools::Rectangle &rTabHeaderRect, const tools::Rectangle &rSelectedTabRect)
+ : ImplControlValue(ControlType::TabPane, 0)
+ , m_aTabHeaderRect(rTabHeaderRect)
+ , m_aSelectedTabRect(rSelectedTabRect)
+ {
+ }
+ TabPaneValue* clone() const override;
+
+ TabPaneValue(TabPaneValue const &) = default;
+ TabPaneValue(TabPaneValue &&) = default;
+ TabPaneValue & operator =(TabPaneValue const &) = delete;
+ TabPaneValue & operator =(TabPaneValue &&) = delete;
+};
+
/* TabitemValue:
*
* Value container for tabitems.