summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-11-20 15:30:01 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2019-11-24 20:28:06 +0100
commit4094a739428886e39e11c2a013c27d2286278a30 (patch)
tree39013df850cdf215614aa2d388c32e25bdc46652 /svx
parentfe9545f05a5d5ad871564a24a395d9893fe00da4 (diff)
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@gmail.com> Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx33
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.hxx4
-rw-r--r--svx/uiconfig/ui/sidebarpossize.ui62
3 files changed, 64 insertions, 35 deletions
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 358864fc92df..c6b5ccecc72c 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -41,6 +41,7 @@
#include <sal/log.hxx>
#include <svtools/unitconv.hxx>
#include <comphelper/lok.hxx>
+#include <sfx2/lokhelper.hxx>
using namespace css;
using namespace css::uno;
@@ -120,6 +121,7 @@ PosSizePropertyPanel::PosSizePropertyPanel(
get( mpDial, "orientationcontrol" );
get( mpFtFlip, "fliplabel" );
get( mpFlipTbx, "selectrotationtype" );
+ get( mpBtnEditChart, "btnEditChart" );
Initialize();
mpBindings->Update( SID_ATTR_TRANSFORM_WIDTH );
@@ -149,6 +151,7 @@ void PosSizePropertyPanel::dispose()
mpDial.clear();
mpFtFlip.clear();
mpFlipTbx.clear();
+ mpBtnEditChart.clear();
maTransfPosXControl.dispose();
maTransfPosYControl.dispose();
@@ -218,6 +221,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);
@@ -283,6 +288,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())
{
@@ -308,14 +315,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;
@@ -337,6 +354,9 @@ void PosSizePropertyPanel::HandleContextChange(
mpFtFlip->Show(bShowFlip);
mpFlipTbx->Show(bShowFlip);
+ // Edit Chart
+ mpBtnEditChart->Show(bShowEditChart);
+
if (mxSidebar.is())
mxSidebar->requestLayout();
}
@@ -539,6 +559,15 @@ IMPL_LINK( PosSizePropertyPanel, FlipHdl, ToolBox*, pBox, void )
}
}
+IMPL_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 97059186a510..07086e3d3608 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_LINK( 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>