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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Mar 7 20:22:13 UTC 2019


 vcl/Package_theme_definitions.mk                         |    4 +
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx              |   34 +++++++++++
 vcl/uiconfig/theme_definitions/combobox-disabled.svgx    |    4 +
 vcl/uiconfig/theme_definitions/combobox.svgx             |    4 +
 vcl/uiconfig/theme_definitions/common-rect-disabled.svgx |    3 
 vcl/uiconfig/theme_definitions/common-rect.svgx          |    3 
 vcl/uiconfig/theme_definitions/definition.xml            |   46 +++++++--------
 7 files changed, 76 insertions(+), 22 deletions(-)

New commits:
commit ce4c486456673e475cb0ae932bc706a7130d21f5
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu Mar 7 14:10:24 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Mar 7 21:21:41 2019 +0100

    widget theme - update combobox/listbox, draw from svg
    
    Change-Id: Ie5e28883d70ad61340c58bcacd8c2ffb2ced1536
    Reviewed-on: https://gerrit.libreoffice.org/68865
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/Package_theme_definitions.mk b/vcl/Package_theme_definitions.mk
index b51f60555165..9c75aa34ba7b 100644
--- a/vcl/Package_theme_definitions.mk
+++ b/vcl/Package_theme_definitions.mk
@@ -32,6 +32,8 @@ $(eval $(call gb_Package_add_files,vcl_theme_definitions,$(LIBO_SHARE_FOLDER)/th
 	spinbox-right-rollover.svgx \
 	spinbox-right-disabled.svgx \
 	spinbox-entire.svgx \
+	common-rect.svgx \
+	common-rect-disabled.svgx \
 	pushbutton-default.svgx \
 	pushbutton-rollover.svgx \
 	tabitem-first.svgx \
@@ -42,6 +44,8 @@ $(eval $(call gb_Package_add_files,vcl_theme_definitions,$(LIBO_SHARE_FOLDER)/th
 	tabitem-last-selected.svgx \
 	scrollbar-horizontal.svgx \
 	scrollbar-vertical.svgx \
+	combobox.svgx \
+	combobox-disabled.svgx \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 0067fed75954..54aa111431d9 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -723,6 +723,40 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
             }
         }
         break;
+        case ControlType::Combobox:
+        case ControlType::Listbox:
+        {
+            auto const& pPart = m_aWidgetDefinition.getDefinition(eType, ControlPart::ButtonDown);
+            Size aComboButtonSize(pPart->mnWidth, pPart->mnHeight);
+
+            if (ePart == ControlPart::ButtonDown)
+            {
+                Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
+                                 - aComboButtonSize.Width(),
+                             aLocation.Y());
+                rNativeContentRegion = tools::Rectangle(aPoint, aComboButtonSize);
+                rNativeBoundingRegion = rNativeContentRegion;
+                return true;
+            }
+            else if (ePart == ControlPart::SubEdit)
+            {
+                Size aSize(rBoundingControlRegion.GetWidth() - aComboButtonSize.Width(),
+                           aComboButtonSize.Height());
+                rNativeContentRegion = tools::Rectangle(aLocation, aSize);
+                rNativeContentRegion.expand(1);
+                rNativeBoundingRegion = rNativeContentRegion;
+                return true;
+            }
+            else if (ePart == ControlPart::Entire)
+            {
+                Size aSize(rBoundingControlRegion.GetWidth(), aComboButtonSize.Height());
+                rNativeContentRegion = tools::Rectangle(aLocation, aSize);
+                rNativeBoundingRegion = rNativeContentRegion;
+                rNativeBoundingRegion.expand(1);
+                return true;
+            }
+        }
+        break;
 
         default:
             break;
diff --git a/vcl/uiconfig/theme_definitions/combobox-disabled.svgx b/vcl/uiconfig/theme_definitions/combobox-disabled.svgx
new file mode 100644
index 000000000000..ccb892d77f90
--- /dev/null
+++ b/vcl/uiconfig/theme_definitions/combobox-disabled.svgx
@@ -0,0 +1,4 @@
+<svg version="1.1" viewBox="0 0 35 36" xmlns="http://www.w3.org/2000/svg">
+ <path d="m6.8098e-4 -4e-7v1.2272l-6.8092e-4 33.546v1.2272h33.75c0.68524 0 1.2499-0.55442 1.2499-1.2272v-33.546c0-0.67283-0.56468-1.2272-1.2499-1.2272z" fill="#8e8e93"/>
+ <path d="m17.5 19.091-4.6667-5.0907-1.3333 1.4546 6 6.5454 6-6.5454-1.3333-1.4546z" fill="#f5f5f5"/>
+</svg>
diff --git a/vcl/uiconfig/theme_definitions/combobox.svgx b/vcl/uiconfig/theme_definitions/combobox.svgx
new file mode 100644
index 000000000000..b4a1627f3882
--- /dev/null
+++ b/vcl/uiconfig/theme_definitions/combobox.svgx
@@ -0,0 +1,4 @@
+<svg version="1.1" viewBox="0 0 35 36" xmlns="http://www.w3.org/2000/svg">
+ <path d="m6.8098e-4 -4e-7v1.2272l-6.8092e-4 33.546v1.2272h33.75c0.68524 0 1.2499-0.55442 1.2499-1.2272v-33.546c0-0.67283-0.56468-1.2272-1.2499-1.2272z" fill="#0273f8"/>
+ <path d="m17.5 19.091-4.6667-5.0907-1.3333 1.4546 6 6.5454 6-6.5454-1.3333-1.4546z" fill="#f5f5f5"/>
+</svg>
diff --git a/vcl/uiconfig/theme_definitions/common-rect-disabled.svgx b/vcl/uiconfig/theme_definitions/common-rect-disabled.svgx
new file mode 100644
index 000000000000..e4c1f63599d7
--- /dev/null
+++ b/vcl/uiconfig/theme_definitions/common-rect-disabled.svgx
@@ -0,0 +1,3 @@
+<svg version="1.1" viewBox="0 0 44 26" xmlns="http://www.w3.org/2000/svg">
+ <rect x=".5" y=".5" width="43" height="25" rx="2" ry="2" fill="#fff" stroke="#8e8e93"/>
+</svg>
diff --git a/vcl/uiconfig/theme_definitions/common-rect.svgx b/vcl/uiconfig/theme_definitions/common-rect.svgx
new file mode 100644
index 000000000000..24a3b12c2d58
--- /dev/null
+++ b/vcl/uiconfig/theme_definitions/common-rect.svgx
@@ -0,0 +1,3 @@
+<svg version="1.1" viewBox="0 0 44 26" xmlns="http://www.w3.org/2000/svg">
+ <rect x=".5" y=".5" width="43" height="25" rx="2" ry="2" fill="#fff" stroke="#007aff"/>
+</svg>
diff --git a/vcl/uiconfig/theme_definitions/definition.xml b/vcl/uiconfig/theme_definitions/definition.xml
index 99df7524b8d2..8c9b1af285d9 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -124,24 +124,24 @@
 
     <combobox>
         <part value="Entire">
-            <state>
-                <external source="spinbox-entire.svgx" />
+            <state enabled="true">
+                <external source="common-rect.svgx" />
+            </state>
+            <state enabled="false">
+                <external source="common-rect-disabled.svgx" />
             </state>
         </part>
         <part value="SubEdit">
             <state>
             </state>
         </part>
-        <part value="ButtonUp">
-            <state>
-                <line stroke="#C7C7C7" stroke-width="4" x1="0.2" y1="0.6" x2="0.5" y2="0.4"/>
-                <line stroke="#C7C7C7" stroke-width="4" x1="0.5" y1="0.4" x2="0.8" y2="0.6"/>
+
+        <part value="ButtonDown" width="35" height="36">
+            <state enabled="true">
+                <image source="combobox.svgx" />
             </state>
-        </part>
-        <part value="ButtonDown">
-            <state>
-                <line stroke="#C7C7C7" stroke-width="4" x1="0.2" y1="0.4" x2="0.5" y2="0.6"/>
-                <line stroke="#C7C7C7" stroke-width="4" x1="0.5" y1="0.6" x2="0.8" y2="0.4"/>
+            <state enabled="false">
+                <image source="combobox-disabled.svgx" />
             </state>
         </part>
     </combobox>
@@ -157,8 +157,11 @@
 
     <listbox>
         <part value="Entire">
-            <state>
-                <rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1" />
+            <state enabled="true">
+                <external source="common-rect.svgx" />
+            </state>
+            <state enabled="false">
+                <external source="common-rect-disabled.svgx" />
             </state>
         </part>
         <part value="ListboxWindow">
@@ -166,21 +169,20 @@
                 <rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1" />
             </state>
         </part>
-        <part value="Focus">
+        <part value="SubEdit">
             <state>
-                <rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1" />
             </state>
         </part>
-        <part value="ButtonUp">
-            <state>
-                <line stroke="#007AFF" stroke-width="4" x1="0.2" y1="0.6" x2="0.5" y2="0.4"/>
-                <line stroke="#007AFF" stroke-width="4" x1="0.5" y1="0.4" x2="0.8" y2="0.6"/>
+        <part value="ButtonDown" width="35" height="36">
+            <state enabled="true">
+                <image source="combo.svgx" />
+            </state>
+            <state enabled="false">
+                <image source="combo-disabled.svgx" />
             </state>
         </part>
-        <part value="ButtonDown">
+        <part value="Focus">
             <state>
-                <line stroke="#007AFF" stroke-width="4" x1="0.2" y1="0.4" x2="0.5" y2="0.6"/>
-                <line stroke="#007AFF" stroke-width="4" x1="0.5" y1="0.6" x2="0.8" y2="0.4"/>
             </state>
         </part>
     </listbox>


More information about the Libreoffice-commits mailing list