[Libreoffice-commits] core.git: 2 commits - include/vcl officecfg/registry svx/uiconfig vcl/source

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Fri Nov 13 00:17:23 PST 2015


 include/vcl/builder.hxx                                              |    4 
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    6 +
 svx/uiconfig/ui/sidebarpossize.ui                                    |   53 ++--------
 vcl/source/window/builder.cxx                                        |   11 +-
 vcl/source/window/toolbox2.cxx                                       |    4 
 5 files changed, 33 insertions(+), 45 deletions(-)

New commits:
commit 0e41564b2fa5192ef1e8ec5e51ad3c04dfa52afd
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Fri Nov 13 09:13:40 2015 +0100

    Flip buttons: Make the tooltip an uno command property
    
    Change-Id: I3d6984b3b51e7eb2affa7fafebf8b745e60b3f20

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index e7297aa..df59ee8 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -4189,6 +4189,9 @@
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Flip Horizontally</value>
         </prop>
+        <prop oor:name="TooltipLabel" oor:type="xs:string">
+          <value xml:lang="en-US">Flip the selected object horizontally.</value>
+        </prop>
         <prop oor:name="Properties" oor:type="xs:int">
           <value>1</value>
         </prop>
@@ -4197,6 +4200,9 @@
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Flip Vertically</value>
         </prop>
+        <prop oor:name="TooltipLabel" oor:type="xs:string">
+          <value xml:lang="en-US">Flip the selected object vertically.</value>
+        </prop>
         <prop oor:name="Properties" oor:type="xs:int">
           <value>1</value>
         </prop>
diff --git a/svx/uiconfig/ui/sidebarpossize.ui b/svx/uiconfig/ui/sidebarpossize.ui
index eeedf5d..db61d5a 100644
--- a/svx/uiconfig/ui/sidebarpossize.ui
+++ b/svx/uiconfig/ui/sidebarpossize.ui
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
 <interface>
-  <!-- interface-requires gtk+ 3.0 -->
-  <!-- interface-requires LibreOffice 1.0 -->
+  <requires lib="gtk+" version="3.12"/>
+  <requires lib="LibreOffice" version="1.0"/>
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">-180</property>
-    <property name="upper">359.99</property>
+    <property name="upper">359.99000000000001</property>
     <property name="step_increment">5</property>
     <property name="page_increment">20</property>
   </object>
@@ -38,15 +39,13 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
-                    <property name="xalign">0</property>
                     <property name="label" translatable="yes">_Horizontal:</property>
                     <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
                     <property name="top_attach">0</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -57,7 +56,6 @@
                     <property name="tooltip_markup" translatable="yes">Enter the value for the horizontal position.</property>
                     <property name="tooltip_text" translatable="yes">Enter the value for the horizontal position.</property>
                     <property name="invisible_char">•</property>
-                    <property name="invisible_char_set">True</property>
                     <accessibility>
                       <relation type="labelled-by" target="horizontallabel"/>
                     </accessibility>
@@ -70,8 +68,6 @@
                   <packing>
                     <property name="left_attach">0</property>
                     <property name="top_attach">1</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -79,15 +75,13 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
-                    <property name="xalign">0</property>
                     <property name="label" translatable="yes">_Vertical:</property>
                     <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="top_attach">0</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -98,7 +92,6 @@
                     <property name="tooltip_markup" translatable="yes">Enter the value for the vertical position.</property>
                     <property name="tooltip_text" translatable="yes">Enter the value for the vertical position.</property>
                     <property name="invisible_char">•</property>
-                    <property name="invisible_char_set">True</property>
                     <accessibility>
                       <relation type="labelled-by" target="verticallabel"/>
                     </accessibility>
@@ -111,8 +104,6 @@
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="top_attach">1</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -120,15 +111,13 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
-                    <property name="xalign">0</property>
                     <property name="label" translatable="yes">_Width:</property>
                     <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
                     <property name="top_attach">2</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -140,7 +129,6 @@
                     <property name="tooltip_markup" translatable="yes">Enter a width for the selected object.</property>
                     <property name="tooltip_text" translatable="yes">Enter a width for the selected object.</property>
                     <property name="invisible_char">•</property>
-                    <property name="invisible_char_set">True</property>
                     <accessibility>
                       <relation type="labelled-by" target="widthlabel"/>
                     </accessibility>
@@ -153,8 +141,6 @@
                   <packing>
                     <property name="left_attach">0</property>
                     <property name="top_attach">3</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -162,15 +148,13 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
-                    <property name="xalign">0</property>
                     <property name="label" translatable="yes">H_eight:</property>
                     <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="top_attach">2</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -182,7 +166,6 @@
                     <property name="tooltip_markup" translatable="yes">Enter a height for the selected object.</property>
                     <property name="tooltip_text" translatable="yes">Enter a height for the selected object.</property>
                     <property name="invisible_char">•</property>
-                    <property name="invisible_char_set">True</property>
                     <accessibility>
                       <relation type="labelled-by" target="heightlabel"/>
                     </accessibility>
@@ -195,8 +178,6 @@
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="top_attach">3</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
               </object>
@@ -229,9 +210,9 @@
               <object class="GtkLabel" id="rotationlabel">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="xalign">0</property>
                 <property name="label" translatable="yes">_Rotation:</property>
                 <property name="use_underline">True</property>
+                <property name="xalign">0</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -299,10 +280,10 @@
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="hexpand">True</property>
-                            <property name="xalign">0</property>
                             <property name="label" translatable="yes">_Flip:</property>
                             <property name="use_underline">True</property>
                             <property name="justify">right</property>
+                            <property name="xalign">0</property>
                           </object>
                           <packing>
                             <property name="expand">True</property>
@@ -315,16 +296,10 @@
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="halign">end</property>
-                            <accessibility>
-                              <relation type="labelled-by" target="fliplabel"/>
-                            </accessibility>
                             <child>
                               <object class="GtkToolButton" id="flipvertical">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="has_tooltip">True</property>
-                                <property name="tooltip_markup" translatable="yes">Flip the selected object vertically.</property>
-                                <property name="tooltip_text" translatable="yes">Flip the selected object vertically.</property>
                                 <property name="action_name">.uno:FlipVertical</property>
                                 <property name="use_underline">True</property>
                               </object>
@@ -337,9 +312,6 @@
                               <object class="GtkToolButton" id="fliphorizontal">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="has_tooltip">True</property>
-                                <property name="tooltip_markup" translatable="yes">Flip the selected object horizontally.</property>
-                                <property name="tooltip_text" translatable="yes">Flip the selected object horizontally.</property>
                                 <property name="action_name">.uno:FlipHorizontal</property>
                                 <property name="use_underline">True</property>
                               </object>
@@ -348,6 +320,9 @@
                                 <property name="homogeneous">True</property>
                               </packing>
                             </child>
+                            <accessibility>
+                              <relation type="labelled-by" target="fliplabel"/>
+                            </accessibility>
                           </object>
                           <packing>
                             <property name="expand">True</property>
@@ -387,8 +362,6 @@
       <packing>
         <property name="left_attach">0</property>
         <property name="top_attach">0</property>
-        <property name="width">1</property>
-        <property name="height">1</property>
       </packing>
     </child>
   </object>
commit e746cf656d71b78216b65c3352a8441829bbf6db
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Fri Nov 13 09:11:34 2015 +0100

    Vcl: Add TooltipLabel to vcl buttons also
    
    Change-Id: I332041e2d1d53f56cd38c1cd1ca325252535a53c

diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index b844f58..fee4545 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -107,7 +107,9 @@ public:
     static void     reorderWithinParent(vcl::Window &rWindow, sal_uInt16 nNewPosition);
 
     /// Get label of the command (like of .uno:Save) from the description service
-    static          OUString getCommandLabel(const OUString& rCommand, const css::uno::Reference<css::uno::XComponentContext>& rContext, const OUString& rModuleId);
+    static OUString getCommandProperty(const OUString aProperty, const OUString& rCommand,
+                                       const css::uno::Reference<css::uno::XComponentContext>& rContext,
+                                       const OUString& rModuleId);
 
     /// Get image of the command (like of .uno:Save) from the description service
     static Image    getCommandImage(
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index e39eb6f..626327f 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -892,10 +892,14 @@ namespace
         uno::Reference<frame::XModuleManager2> xModuleManager(frame::ModuleManager::create(xContext));
         OUString aModuleId(xModuleManager->identify(rFrame));
 
-        OUString aLabel(VclBuilder::getCommandLabel(aCommand, xContext, aModuleId));
+        OUString aLabel(VclBuilder::getCommandProperty("Label", aCommand, xContext, aModuleId));
         if (!aLabel.isEmpty())
             pButton->SetText(aLabel);
 
+        OUString aTooltip(VclBuilder::getCommandProperty("Tooltip", aCommand, xContext, aModuleId));
+        if (!aTooltip.isEmpty())
+            pButton->SetQuickHelpText(aTooltip);
+
         Image aImage(VclBuilder::getCommandImage(aCommand, /* bLarge = */ false, xContext, rFrame, aModuleId));
         pButton->SetModeImage(aImage);
 
@@ -2164,7 +2168,8 @@ void VclBuilder::reorderWithinParent(std::vector<vcl::Window*>& rChilds, bool bI
     }
 }
 
-OUString VclBuilder::getCommandLabel(const OUString& rCommand, const uno::Reference<uno::XComponentContext>& rContext, const OUString& rModuleId)
+OUString VclBuilder::getCommandProperty(const OUString aProperty, const OUString& rCommand,
+                                     const uno::Reference<uno::XComponentContext>& rContext, const OUString& rModuleId)
 {
     if (rCommand.isEmpty())
         return OUString();
@@ -2181,7 +2186,7 @@ OUString VclBuilder::getCommandLabel(const OUString& rCommand, const uno::Refere
             {
                 for ( sal_Int32 i = 0; i < aProperties.getLength(); i++ )
                 {
-                    if (aProperties[i].Name == "Label")
+                    if (aProperties[i].Name == aProperty)
                     {
                         OUString aLabel;
                         if (aProperties[i].Value >>= aLabel)
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index b2b6adf..0efb1f8 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -606,7 +606,8 @@ void ToolBox::InsertItem(const OUString& rCommand, const uno::Reference<frame::X
     uno::Reference<frame::XModuleManager2> xModuleManager(frame::ModuleManager::create(xContext));
     OUString aModuleId(xModuleManager->identify(rFrame));
 
-    OUString aLabel(VclBuilder::getCommandLabel(rCommand, xContext, aModuleId));
+    OUString aLabel(VclBuilder::getCommandProperty("Label", rCommand, xContext, aModuleId));
+    OUString aTooltip(VclBuilder::getCommandProperty("TooltipLabel", rCommand, xContext, aModuleId));
     Image aImage(VclBuilder::getCommandImage(rCommand, (GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE), xContext, rFrame, aModuleId));
 
     // let's invent an ItemId
@@ -615,6 +616,7 @@ void ToolBox::InsertItem(const OUString& rCommand, const uno::Reference<frame::X
 
     InsertItem(nItemId, aImage, aLabel, nBits, nPos);
     SetItemCommand(nItemId, rCommand);
+    SetQuickHelpText(nItemId, aTooltip);
 
     // set the minimal size
     ImplToolItem* pItem = ImplGetItem( nItemId );


More information about the Libreoffice-commits mailing list