diff options
author | Andre Fischer <af@apache.org> | 2014-02-18 14:17:32 +0000 |
---|---|---|
committer | Andre Fischer <af@apache.org> | 2014-02-18 14:17:32 +0000 |
commit | 7e5783030c82f8ec87b88899869e9152cf5c3271 (patch) | |
tree | 128e97133215b09ff306a0ef2664b33dcda5d78e /svx/source | |
parent | 28c0c081d07e5a49ccd238e7f4e882347ab3690c (diff) |
124216: Detect changes of the UI scale.
Notes
Notes:
merged as: 5b9003372effe4ee4bc34f34ee20138ac6a6050f
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 23 | ||||
-rw-r--r-- | svx/source/sidebar/possize/PosSizePropertyPanel.hxx | 12 |
2 files changed, 35 insertions, 0 deletions
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index e59b5626a19f..a329fef56c46 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -996,6 +996,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( case SID_ATTR_METRIC: MetricState( eState, pState ); + UpdateUIScale(); break; default: @@ -1350,6 +1351,28 @@ void PosSizePropertyPanel::DisableControls() } + + +void PosSizePropertyPanel::UpdateUIScale (void) +{ + const Fraction aUIScale (mpView->GetModel()->GetUIScale()); + if (maUIScale != aUIScale) + { + // UI scale has changed. + + // Remember the new UI scale. + maUIScale = aUIScale; + + // The content of the position and size boxes is only updated when item changes are notified. + // Request such notifications without changing the actual item values. + GetBindings()->Invalidate(SID_ATTR_TRANSFORM_POS_X, sal_True, sal_False); + GetBindings()->Invalidate(SID_ATTR_TRANSFORM_POS_Y, sal_True, sal_False); + GetBindings()->Invalidate(SID_ATTR_TRANSFORM_WIDTH, sal_True, sal_False); + GetBindings()->Invalidate(SID_ATTR_TRANSFORM_HEIGHT, sal_True, sal_False); + } +} + + } } // end of namespace svx::sidebar // eof diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx index 1a5412e0f87c..095c8a182a9c 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx @@ -184,6 +184,18 @@ private: void DisableControls(); void AdaptWidthHeightScalePosition(bool bOriginal); void AdaptAngleFlipDialPosition(bool bOriginal); + + /** Check if the UI scale has changed and handle such a change. + UI scale is an SD only feature. The UI scale is represented by items + ATTR_OPTIONS_SCALE_X and + ATTR_OPTIONS_SCALE_Y. + As we have no direct access (there is no dependency of svx on sd) we have to + use a small trick (aka hack): + a) call this method whenever a change of the metric item is notified, + b) check if the UI scale has changed (strangely, the UI scale value is available at the SdrModel. + c) invalidate the items for position and size to trigger notifications of their current values. + */ + void UpdateUIScale (void); }; |