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

Muhammet Kara (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 13 09:40:45 UTC 2019


 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |   34 ++++++++++
 svx/source/sidebar/possize/PosSizePropertyPanel.hxx |    4 +
 svx/uiconfig/ui/sidebarpossize.ui                   |   62 +++++++++-----------
 3 files changed, 65 insertions(+), 35 deletions(-)

New commits:
commit 376cd2ceaeedd12a8050c5acd142cd9b9d5e731a
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Wed Nov 20 15:30:01 2019 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Fri Dec 13 10:40:05 2019 +0100

    Add Edit Chart button for online's mobile view
    
    To improve UX by providing mobile viewers a way to
    enter into edit mode of a chart via single tap
    
    Change-Id: I3cfb82df166c571a401f195a7f7c806fd6df604e
    Reviewed-on: https://gerrit.libreoffice.org/83614
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/85091
    Tested-by: Jenkins

diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index abbb315b9ffd..036ce3fad157 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -27,6 +27,7 @@
 #include <svx/svxids.hrc>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/bindings.hxx>
+#include <sfx2/lokhelper.hxx>
 #include <sfx2/module.hxx>
 #include <sfx2/viewsh.hxx>
 #include <sfx2/objsh.hxx>
@@ -48,6 +49,7 @@
 #include <svx/transfrmhelper.hxx>
 
 #include <svtools/unitconv.hxx>
+#include <comphelper/lok.hxx>
 
 using namespace css;
 using namespace css::uno;
@@ -106,6 +108,7 @@ PosSizePropertyPanel::PosSizePropertyPanel(
     get( mpDial,      "orientationcontrol" );
     get( mpFtFlip,    "fliplabel" );
     get( mpFlipTbx,   "selectrotationtype" );
+    get( mpBtnEditChart,   "btnEditChart" );
     Initialize();
 
     mpBindings->Update( SID_ATTR_METRIC );
@@ -135,6 +138,7 @@ void PosSizePropertyPanel::dispose()
     mpDial.clear();
     mpFtFlip.clear();
     mpFlipTbx.clear();
+    mpBtnEditChart.clear();
 
     maTransfPosXControl.dispose();
     maTransfPosYControl.dispose();
@@ -204,6 +208,8 @@ void PosSizePropertyPanel::Initialize()
     //flip:
     mpFlipTbx->SetSelectHdl( LINK( this, PosSizePropertyPanel, FlipHdl) );
 
+    mpBtnEditChart->SetClickHdl( LINK( this, PosSizePropertyPanel, ClickChartEditHdl ) );
+
     mpMtrAngle->InsertValue(0, FieldUnit::CUSTOM);
     mpMtrAngle->InsertValue(4500, FieldUnit::CUSTOM);
     mpMtrAngle->InsertValue(9000, FieldUnit::CUSTOM);
@@ -269,6 +275,8 @@ void PosSizePropertyPanel::HandleContextChange(
     bool bShowPosition = false;
     bool bShowAngle = false;
     bool bShowFlip = false;
+    bool bShowEditChart = false;
+    bool bIsMobile = comphelper::LibreOfficeKit::isActive() && comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView());
 
     switch (maContext.GetCombinedContext_DI())
     {
@@ -294,14 +302,24 @@ void PosSizePropertyPanel::HandleContextChange(
             bShowFlip = true;
             break;
 
+        case CombinedEnumContext(Application::WriterVariants, Context::OLE):
+            if (bIsMobile)
+                bShowEditChart = true;
+            break;
+
+        case CombinedEnumContext(Application::Calc, Context::OLE):
+        case CombinedEnumContext(Application::DrawImpress, Context::OLE):
+            bShowPosition = true;
+            if (bIsMobile)
+                bShowEditChart = true;
+            break;
+
         case CombinedEnumContext(Application::Calc, Context::Chart):
         case CombinedEnumContext(Application::Calc, Context::Form):
         case CombinedEnumContext(Application::Calc, Context::Media):
-        case CombinedEnumContext(Application::Calc, Context::OLE):
         case CombinedEnumContext(Application::Calc, Context::MultiObject):
         case CombinedEnumContext(Application::DrawImpress, Context::Media):
         case CombinedEnumContext(Application::DrawImpress, Context::Form):
-        case CombinedEnumContext(Application::DrawImpress, Context::OLE):
         case CombinedEnumContext(Application::DrawImpress, Context::ThreeDObject):
         case CombinedEnumContext(Application::DrawImpress, Context::MultiObject):
             bShowPosition = true;
@@ -323,6 +341,9 @@ void PosSizePropertyPanel::HandleContextChange(
     mpFtFlip->Show(bShowFlip);
     mpFlipTbx->Show(bShowFlip);
 
+    // Edit Chart
+    mpBtnEditChart->Show(bShowEditChart);
+
     if (mxSidebar.is())
         mxSidebar->requestLayout();
 }
@@ -497,6 +518,15 @@ IMPL_LINK( PosSizePropertyPanel, FlipHdl, ToolBox*, pBox, void )
     }
 }
 
+IMPL_STATIC_LINK_NOARG( PosSizePropertyPanel, ClickChartEditHdl, Button*, void )
+{
+    SfxViewShell* pCurSh = SfxViewShell::Current();
+    if ( pCurSh)
+    {
+        pCurSh->DoVerb( -1 );
+    }
+}
+
 
 void PosSizePropertyPanel::NotifyItemUpdate(
     sal_uInt16 nSID,
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
index 2ac505428c36..3bc3f96f4151 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
@@ -107,6 +107,9 @@ private:
     VclPtr<FixedText>        mpFtFlip;
     VclPtr<ToolBox>          mpFlipTbx;
 
+    //edit charts button for online's mobile view
+    VclPtr<PushButton>       mpBtnEditChart;
+
     // Internal variables
     basegfx::B2DRange                       maRect;
     basegfx::B2DRange                       maWorkArea;
@@ -153,6 +156,7 @@ private:
     DECL_LINK( AngleModifiedHdl, Edit&, void );
     DECL_LINK( RotationHdl, svx::DialControl*, void );
     DECL_LINK( FlipHdl, ToolBox *, void );
+    DECL_STATIC_LINK( PosSizePropertyPanel, ClickChartEditHdl, Button*, void );
 
     void Initialize();
     void executeSize();
diff --git a/svx/uiconfig/ui/sidebarpossize.ui b/svx/uiconfig/ui/sidebarpossize.ui
index 3f584ac4d31f..8605a49d387e 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.22.1 -->
 <interface domain="svx">
   <requires lib="gtk+" version="3.18"/>
   <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" context="sidebarpossize|horizontallabel">Position _X:</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>
@@ -60,15 +59,13 @@
                     </accessibility>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="horizontalpos:0in-atkobject">
-                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|horizontalpos-atkobject">Horizontal</property>
+                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|horizontalpos">Horizontal</property>
                       </object>
                     </child>
                   </object>
                   <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>
@@ -76,15 +73,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" context="sidebarpossize|verticallabel">Position _Y:</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,15 +93,13 @@
                     </accessibility>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="verticalpos:0in-atkobject">
-                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|verticalpos-atkobject">Vertical</property>
+                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|verticalpos">Vertical</property>
                       </object>
                     </child>
                   </object>
                   <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>
@@ -114,15 +107,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" context="sidebarpossize|widthlabel">_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>
@@ -137,15 +128,13 @@
                     </accessibility>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="selectwidth:0in-atkobject">
-                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|selectwidth-atkobject">Width</property>
+                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|selectwidth">Width</property>
                       </object>
                     </child>
                   </object>
                   <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>
@@ -153,15 +142,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" context="sidebarpossize|heightlabel">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>
@@ -176,15 +163,13 @@
                     </accessibility>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="selectheight:0in-atkobject">
-                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|selectheight-atkobject">Height</property>
+                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|selectheight">Height</property>
                       </object>
                     </child>
                   </object>
                   <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>
@@ -216,9 +201,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" context="sidebarpossize|rotationlabel">_Rotation:</property>
                 <property name="use_underline">True</property>
+                <property name="xalign">0</property>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -243,7 +228,7 @@
                     </accessibility>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="orientationcontrol-atkobject">
-                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|orientationcontrol-atkobject">Rotation</property>
+                        <property name="AtkObject::accessible-name" translatable="yes" context="sidebarpossize|orientationcontrol">Rotation</property>
                       </object>
                     </child>
                   </object>
@@ -285,10 +270,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" context="sidebarpossize|fliplabel">_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>
@@ -301,9 +286,6 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</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>
@@ -332,6 +314,9 @@
                                 <property name="homogeneous">True</property>
                               </packing>
                             </child>
+                            <accessibility>
+                              <relation type="labelled-by" target="fliplabel"/>
+                            </accessibility>
                           </object>
                           <packing>
                             <property name="expand">True</property>
@@ -448,6 +433,19 @@
                 <property name="position">4</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkButton" id="btnEditChart">
+                <property name="label" translatable="yes" context="sidebarpossize|btnEditChart">Edit Chart</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">5</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -459,8 +457,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>


More information about the Libreoffice-commits mailing list