summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2021-01-01 16:04:43 +0530
committerPranam Lashkari <lpranam@collabora.com>2021-01-06 12:17:10 +0100
commita4aa110f2ffd2b9439a1bcb5abcacf7704ff41a4 (patch)
tree6547c6651c0291ab73f14168382d32449c09076a /svx
parent3286d9a70bda46da2685a23ff6f353fbb1e055f4 (diff)
Stop modifying size values in sidebar when user still editing
Change-Id: Ie630a40e14f7dce7260da7bb9ba6f8cbc4984b83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108555 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx97
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.hxx22
2 files changed, 107 insertions, 12 deletions
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index e5cc427a0f2a..764502642c93 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -190,12 +190,35 @@ namespace
void PosSizePropertyPanel::Initialize()
{
//Position : Horizontal / Vertical
- mpMtrPosX->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangePosXHdl ) );
- mpMtrPosY->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangePosYHdl ) );
+ mpMtrPosX->SetLoseFocusHdl( LINK( this, PosSizePropertyPanel, ChangePosXHdl ) );
+ mpMtrPosX->SetEnterHdl(LINK( this, PosSizePropertyPanel, ChangePosXHdl ) );
+ mpMtrPosX->SetUpHdl( LINK( this, PosSizePropertyPanel, ChangePosXUpDownHdl ) );
+ mpMtrPosX->SetDownHdl( LINK( this, PosSizePropertyPanel, ChangePosXUpDownHdl ) );
+
+ mpMtrPosY->SetLoseFocusHdl( LINK( this, PosSizePropertyPanel, ChangePosYHdl ) );
+ mpMtrPosY->SetEnterHdl( LINK( this, PosSizePropertyPanel, ChangePosYHdl ) );
+ mpMtrPosY->SetUpHdl( LINK( this, PosSizePropertyPanel, ChangePosYUpDownHdl ) );
+ mpMtrPosY->SetDownHdl( LINK( this, PosSizePropertyPanel, ChangePosYUpDownHdl ) );
+
//Size : Width / Height
- mpMtrWidth->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangeWidthHdl ) );
- mpMtrHeight->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangeHeightHdl ) );
+ mpMtrWidth->SetLoseFocusHdl( LINK( this, PosSizePropertyPanel, ChangeWidthHdl ) );
+ mpMtrWidth->SetEnterHdl( LINK( this, PosSizePropertyPanel, ChangeWidthHdl ) );
+ mpMtrWidth->SetUpHdl( LINK( this, PosSizePropertyPanel, ChangeWidthUpDownHdl ) );
+ mpMtrWidth->SetDownHdl( LINK( this, PosSizePropertyPanel, ChangeWidthUpDownHdl ) );
+
+ mpMtrHeight->SetLoseFocusHdl( LINK( this, PosSizePropertyPanel, ChangeHeightHdl ) );
+ mpMtrHeight->SetEnterHdl( LINK( this, PosSizePropertyPanel, ChangeHeightHdl ) );
+ mpMtrHeight->SetUpHdl( LINK( this, PosSizePropertyPanel, ChangeHeightUpDownHdl ) );
+ mpMtrHeight->SetDownHdl( LINK( this, PosSizePropertyPanel, ChangeHeightUpDownHdl ) );
+
+ if (SfxLokHelper::getDeviceFormFactor() == LOKDeviceFormFactor::MOBILE)
+ {
+ mpMtrPosX->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangePosXMobileHdl ) );
+ mpMtrPosY->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangePosYMobileHdl ) );
+ mpMtrWidth->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangeWidthMobileHdl ) );
+ mpMtrHeight->SetModifyHdl( LINK( this, PosSizePropertyPanel, ChangeHeightMobileHdl ) );
+ }
//Size : Keep ratio
mpCbxScale->SetClickHdl( LINK( this, PosSizePropertyPanel, ClickAutoHdl ) );
@@ -353,7 +376,7 @@ void PosSizePropertyPanel::HandleContextChange(
}
-IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeWidthHdl, Edit&, void )
+void PosSizePropertyPanel::AdjustWidth()
{
if( mpCbxScale->IsChecked() &&
mpCbxScale->IsEnabled() )
@@ -374,8 +397,22 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeWidthHdl, Edit&, void )
executeSize();
}
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeWidthHdl, Control&, void )
+{
+ AdjustWidth();
+}
+
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeWidthMobileHdl, Edit&, void )
+{
+ AdjustWidth();
+}
+
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeWidthUpDownHdl, SpinField&, void )
+{
+ AdjustWidth();
+}
-IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeHeightHdl, Edit&, void )
+void PosSizePropertyPanel::AdjustHeight()
{
if( mpCbxScale->IsChecked() &&
mpCbxScale->IsEnabled() )
@@ -396,8 +433,22 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeHeightHdl, Edit&, void )
executeSize();
}
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeHeightHdl, Control&, void )
+{
+ AdjustHeight();
+}
+
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeHeightMobileHdl, Edit&, void )
+{
+ AdjustHeight();
+}
+
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangeHeightUpDownHdl, SpinField&, void )
+{
+ AdjustHeight();
+}
-IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXHdl, Edit&, void )
+void PosSizePropertyPanel::AdjustXPos()
{
if ( mpMtrPosX->IsValueModified())
{
@@ -413,8 +464,22 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXHdl, Edit&, void )
}
}
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXHdl, Control&, void )
+{
+ AdjustXPos();
+}
+
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXMobileHdl, Edit&, void )
+{
+ AdjustXPos();
+}
+
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXUpDownHdl, SpinField&, void )
+{
+ AdjustXPos();
+}
-IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYHdl, Edit&, void )
+void PosSizePropertyPanel::AdjustYPos()
{
if ( mpMtrPosY->IsValueModified() )
{
@@ -431,6 +496,22 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYHdl, Edit&, void )
}
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYHdl, Control&, void )
+{
+ AdjustYPos();
+}
+
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYMobileHdl, Edit&, void )
+{
+ AdjustYPos();
+}
+
+IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYUpDownHdl, SpinField&, void )
+{
+ AdjustYPos();
+}
+
+
IMPL_LINK_NOARG( PosSizePropertyPanel, ClickAutoHdl, Button*, void )
{
if ( mpCbxScale->IsChecked() )
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
index 26854fa4873c..c70070b4b793 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SVX_SOURCE_SIDEBAR_POSSIZE_POSSIZEPROPERTYPANEL_HXX
#include <vcl/ctrl.hxx>
+#include <vcl/spinfld.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
@@ -157,10 +158,18 @@ private:
css::uno::Reference<css::ui::XSidebar> mxSidebar;
- DECL_LINK( ChangePosXHdl, Edit&, void );
- DECL_LINK( ChangePosYHdl, Edit&, void );
- DECL_LINK( ChangeWidthHdl, Edit&, void );
- DECL_LINK( ChangeHeightHdl, Edit&, void );
+ DECL_LINK( ChangePosXHdl, Control&, void );
+ DECL_LINK( ChangePosYHdl, Control&, void );
+ DECL_LINK( ChangePosXMobileHdl, Edit&, void );
+ DECL_LINK( ChangePosYMobileHdl, Edit&, void );
+ DECL_LINK( ChangePosXUpDownHdl, SpinField&, void );
+ DECL_LINK( ChangePosYUpDownHdl, SpinField&, void );
+ DECL_LINK( ChangeWidthHdl, Control&, void );
+ DECL_LINK( ChangeHeightHdl, Control&, void );
+ DECL_LINK( ChangeWidthMobileHdl, Edit&, void );
+ DECL_LINK( ChangeHeightMobileHdl, Edit&, void );
+ DECL_LINK( ChangeWidthUpDownHdl, SpinField&, void );
+ DECL_LINK( ChangeHeightUpDownHdl, SpinField&, void );
DECL_LINK( ClickAutoHdl, Button*, void );
DECL_LINK( AngleModifiedHdl, Edit&, void );
DECL_LINK( RotationHdl, svx::DialControl*, void );
@@ -186,6 +195,11 @@ private:
c) invalidate the items for position and size to trigger notifications of their current values.
*/
void UpdateUIScale();
+
+ void AdjustWidth();
+ void AdjustHeight();
+ void AdjustXPos();
+ void AdjustYPos();
};