[Libreoffice-commits] core.git: vcl/source vcl/uiconfig

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Mar 5 19:25:20 UTC 2019


 vcl/source/gdi/FileDefinitionWidgetDraw.cxx   |   21 ++++++++++++++-
 vcl/source/gdi/WidgetDefinitionReader.cxx     |    4 ++
 vcl/uiconfig/theme_definitions/definition.xml |   35 ++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 2 deletions(-)

New commits:
commit 67b6b526dd759d28c554880b2e728ca99c6cce7b
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Feb 19 14:26:40 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Mar 5 20:24:51 2019 +0100

    Draw basic tabbar widgets from the theme definition
    
    Change-Id: I51f8868abff3f3e38bd70ea1fc99a9cf5aca92a6
    Reviewed-on: https://gerrit.libreoffice.org/68752
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 7fa086bbd854..f2db60e4b5f0 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -45,6 +45,10 @@ FileDefinitionWidgetDraw::FileDefinitionWidgetDraw(SalGraphics& rGraphics)
     ImplSVData* pSVData = ImplGetSVData();
     pSVData->maNWFData.mbNoFocusRects = true;
     pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true;
+    pSVData->maNWFData.mbNoActiveTabTextRaise = true;
+    pSVData->maNWFData.mbCenteredTabs = true;
+    pSVData->maNWFData.mbProgressNeedsErase = true;
+    pSVData->maNWFData.mnStatusBarLowerRightOffset = 10;
 }
 
 bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, ControlPart ePart)
@@ -71,11 +75,12 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr
                 return false;
             return true;
         case ControlType::SpinButtons:
+            return false;
         case ControlType::TabItem:
         case ControlType::TabPane:
         case ControlType::TabHeader:
         case ControlType::TabBody:
-            return false;
+            return true;
         case ControlType::Scrollbar:
             if (ePart == ControlPart::DrawBackgroundHorz
                 || ePart == ControlPart::DrawBackgroundVert)
@@ -402,9 +407,15 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart
         }
         break;
         case ControlType::SpinButtons:
+            break;
         case ControlType::TabItem:
+        case ControlType::TabHeader:
         case ControlType::TabPane:
         case ControlType::TabBody:
+        {
+            bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
+        }
+        break;
         case ControlType::Scrollbar:
         {
             bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
@@ -568,6 +579,14 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
         case ControlType::Radiobutton:
             rNativeContentRegion = tools::Rectangle(Point(), Size(32, 32));
             return true;
+        case ControlType::TabItem:
+        {
+            rNativeBoundingRegion = tools::Rectangle(rBoundingControlRegion.TopLeft(),
+                                                     Size(rBoundingControlRegion.GetWidth() + 20,
+                                                          rBoundingControlRegion.GetHeight() + 6));
+            rNativeContentRegion = rNativeBoundingRegion;
+            return true;
+        }
         default:
             break;
     }
diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx b/vcl/source/gdi/WidgetDefinitionReader.cxx
index 3d210b1d88cd..351d0fcdc9ef 100644
--- a/vcl/source/gdi/WidgetDefinitionReader.cxx
+++ b/vcl/source/gdi/WidgetDefinitionReader.cxx
@@ -137,7 +137,9 @@ bool getControlTypeForXmlString(OString const& rString, ControlType& reType)
             { "checkbox", ControlType::Checkbox },     { "combobox", ControlType::Combobox },
             { "editbox", ControlType::Editbox },       { "scrollbar", ControlType::Scrollbar },
             { "spinbox", ControlType::Spinbox },       { "slider", ControlType::Slider },
-            { "fixedline", ControlType::Fixedline },   { "progress", ControlType::Progress } };
+            { "fixedline", ControlType::Fixedline },   { "progress", ControlType::Progress },
+            { "tabitem", ControlType::TabItem },       { "tabheader", ControlType::TabHeader },
+            { "tabpane", ControlType::TabPane },       { "tabbody", ControlType::TabBody } };
 
     auto const& rIterator = aPartMap.find(rString);
     if (rIterator != aPartMap.end())
diff --git a/vcl/uiconfig/theme_definitions/definition.xml b/vcl/uiconfig/theme_definitions/definition.xml
index 8aa959ab314e..13859cfa3833 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -222,4 +222,39 @@
         </part>
     </progress>
 
+    <tabitem>
+        <part value="Entire">
+            <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="true" button-value="any">
+                <rect stroke="#007AFF" fill="#007AFF" stroke-width="1" rx="1" ry="1"/>
+            </state>
+            <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="false" button-value="any">
+                <rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1"/>
+            </state>
+        </part>
+    </tabitem>
+
+    <tabheader>
+        <part value="Entire">
+            <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+                <rect stroke="#FF0000" fill="#FFFFFF" stroke-width="1" rx="1" ry="1"/>
+            </state>
+        </part>
+    </tabheader>
+
+    <tabpane>
+        <part value="Entire">
+            <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+                <rect stroke="#00FF00" fill="#FFFFFF" stroke-width="1" rx="1" ry="1"/>
+            </state>
+        </part>
+    </tabpane>
+
+    <tabbody>
+        <part value="Entire">
+            <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+                <rect stroke="#FFFFFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1"/>
+            </state>
+        </part>
+    </tabbody>
+
 </widgets>


More information about the Libreoffice-commits mailing list