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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Mar 10 23:15:09 UTC 2019


 vcl/source/gdi/FileDefinitionWidgetDraw.cxx   |   17 ++++++---
 vcl/source/gdi/WidgetDefinitionReader.cxx     |   48 ++++++++++++++------------
 vcl/uiconfig/theme_definitions/definition.xml |    8 ++++
 3 files changed, 46 insertions(+), 27 deletions(-)

New commits:
commit 7e5fe834e722d51b5e82ecddfe549ec21c7a225e
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Mar 10 21:54:04 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Mar 11 00:14:45 2019 +0100

    widget theme: add support for menubar, menupopup and tooltip
    
    But they are not used - for now.
    
    Change-Id: I93a74f5a9e52791fd08afbb5502427a0684d60cf
    Reviewed-on: https://gerrit.libreoffice.org/69021
    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 5c0920bca4d6..59f0947e7eea 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -121,12 +121,13 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr
             return true;
         case ControlType::Menubar:
         case ControlType::MenuPopup:
-            return false;
+            return true;
         case ControlType::Progress:
             return true;
         case ControlType::IntroProgress:
-        case ControlType::Tooltip:
             return false;
+        case ControlType::Tooltip:
+            return true;
         case ControlType::WindowBackground:
         case ControlType::Frame:
         case ControlType::ListNode:
@@ -581,17 +582,23 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart
         }
         break;
         case ControlType::Menubar:
-            break;
         case ControlType::MenuPopup:
-            break;
+        {
+            bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
+        }
+        break;
         case ControlType::Progress:
         {
             bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
         }
         break;
         case ControlType::IntroProgress:
-        case ControlType::Tooltip:
             break;
+        case ControlType::Tooltip:
+        {
+            bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
+        }
+        break;
         case ControlType::WindowBackground:
         case ControlType::Frame:
         {
diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx b/vcl/source/gdi/WidgetDefinitionReader.cxx
index f52757d37629..c183cb717e9c 100644
--- a/vcl/source/gdi/WidgetDefinitionReader.cxx
+++ b/vcl/source/gdi/WidgetDefinitionReader.cxx
@@ -139,28 +139,32 @@ ControlPart xmlStringToControlPart(OString const& sPart)
 
 bool getControlTypeForXmlString(OString const& rString, ControlType& reType)
 {
-    static std::unordered_map<OString, ControlType> aPartMap
-        = { { "pushbutton", ControlType::Pushbutton },
-            { "radiobutton", ControlType::Radiobutton },
-            { "checkbox", ControlType::Checkbox },
-            { "combobox", ControlType::Combobox },
-            { "editbox", ControlType::Editbox },
-            { "listbox", ControlType::Listbox },
-            { "scrollbar", ControlType::Scrollbar },
-            { "spinbox", ControlType::Spinbox },
-            { "slider", ControlType::Slider },
-            { "fixedline", ControlType::Fixedline },
-            { "progress", ControlType::Progress },
-            { "tabitem", ControlType::TabItem },
-            { "tabheader", ControlType::TabHeader },
-            { "tabpane", ControlType::TabPane },
-            { "tabbody", ControlType::TabBody },
-            { "frame", ControlType::Frame },
-            { "windowbackground", ControlType::WindowBackground },
-            { "toolbar", ControlType::Toolbar },
-            { "listnode", ControlType::ListNode },
-            { "listnet", ControlType::ListNet },
-            { "listheader", ControlType::ListHeader } };
+    static std::unordered_map<OString, ControlType> aPartMap = {
+        { "pushbutton", ControlType::Pushbutton },
+        { "radiobutton", ControlType::Radiobutton },
+        { "checkbox", ControlType::Checkbox },
+        { "combobox", ControlType::Combobox },
+        { "editbox", ControlType::Editbox },
+        { "listbox", ControlType::Listbox },
+        { "scrollbar", ControlType::Scrollbar },
+        { "spinbox", ControlType::Spinbox },
+        { "slider", ControlType::Slider },
+        { "fixedline", ControlType::Fixedline },
+        { "progress", ControlType::Progress },
+        { "tabitem", ControlType::TabItem },
+        { "tabheader", ControlType::TabHeader },
+        { "tabpane", ControlType::TabPane },
+        { "tabbody", ControlType::TabBody },
+        { "frame", ControlType::Frame },
+        { "windowbackground", ControlType::WindowBackground },
+        { "toolbar", ControlType::Toolbar },
+        { "listnode", ControlType::ListNode },
+        { "listnet", ControlType::ListNet },
+        { "listheader", ControlType::ListHeader },
+        { "menubar", ControlType::Menubar },
+        { "menupopup", ControlType::MenuPopup },
+        { "tooltip", ControlType::Tooltip },
+    };
 
     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 46346286756c..4789b9a844ed 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -452,4 +452,12 @@
         </part>
     </listheader>
 
+    <menubar>
+    </menubar>
+
+    <menupopup>
+    </menupopup>
+
+    <tooltip>
+    </tooltip>
 </widgets>


More information about the Libreoffice-commits mailing list