diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-17 10:32:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-17 22:06:55 +0100 |
commit | 83057749a921286add0b7e588f67cd3522125665 (patch) | |
tree | 44196c674bedaa29fbe08642339db6f606ea0925 /cui | |
parent | df24517ed069092ee34eba77d045cb68b51530b0 (diff) |
Resolves: tdf#130045 dial control frame not hidden along with the control
Change-Id: Idcdf3d748849fbe1ba1a6cce278373e349ba1e5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86967
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/align.hxx | 4 | ||||
-rw-r--r-- | cui/source/inc/transfrm.hxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/align.cxx | 22 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 15 | ||||
-rw-r--r-- | cui/uiconfig/ui/rotationtabpage.ui | 2 |
5 files changed, 25 insertions, 22 deletions
diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx index ebfdd984d3b2..857ade2cc7b7 100644 --- a/cui/source/inc/align.hxx +++ b/cui/source/inc/align.hxx @@ -79,7 +79,6 @@ private: weld::TriStateEnabled m_aHyphenState; weld::TriStateEnabled m_aShrinkState; - DialControl m_aCtrlDial; SvtValueSet m_aVsRefEdge; std::unique_ptr<weld::ComboBox> m_xLbHorAlign; @@ -111,7 +110,8 @@ private: std::unique_ptr<weld::Widget> m_xPropertiesFrame; std::unique_ptr<weld::CustomWeld> m_xVsRefEdge; - std::unique_ptr<weld::CustomWeld> m_xCtrlDial; + std::unique_ptr<DialControl> m_xCtrlDial; + std::unique_ptr<weld::CustomWeld> m_xCtrlDialWin; }; diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx index 3c5506ef3c4e..862baafae3c1 100644 --- a/cui/source/inc/transfrm.hxx +++ b/cui/source/inc/transfrm.hxx @@ -174,7 +174,6 @@ private: MapUnit ePoolUnit; FieldUnit eDlgUnit; - svx::DialControl m_aCtlAngle; SvxRectCtl m_aCtlRect; std::unique_ptr<weld::Widget> m_xFlPosition; @@ -183,7 +182,8 @@ private: std::unique_ptr<weld::CustomWeld> m_xCtlRect; std::unique_ptr<weld::Widget> m_xFlAngle; std::unique_ptr<weld::MetricSpinButton> m_xNfAngle; - std::unique_ptr<weld::CustomWeld> m_xCtlAngle; + std::unique_ptr<svx::DialControl> m_xCtlAngle; + std::unique_ptr<weld::CustomWeld> m_xCtlAngleWin; public: SvxAngleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs); diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index 9c0886097fe1..efa1b35a9efc 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -132,10 +132,11 @@ AlignmentTabPage::AlignmentTabPage(weld::Container* pPage, weld::DialogControlle , m_xOrientFrame(m_xBuilder->weld_widget("orientation")) , m_xPropertiesFrame(m_xBuilder->weld_widget("properties")) , m_xVsRefEdge(new weld::CustomWeld(*m_xBuilder, "references", m_aVsRefEdge)) - , m_xCtrlDial(new weld::CustomWeld(*m_xBuilder, "dialcontrol", m_aCtrlDial)) + , m_xCtrlDial(new DialControl(m_xBuilder->weld_scrolled_window("anglepreview"))) + , m_xCtrlDialWin(new weld::CustomWeld(*m_xBuilder, "dialcontrol", *m_xCtrlDial)) { - m_aCtrlDial.SetLinkedField(m_xNfRotate.get()); - m_aCtrlDial.SetText(m_xFtABCD->get_label()); + m_xCtrlDial->SetLinkedField(m_xNfRotate.get()); + m_xCtrlDial->SetText(m_xFtABCD->get_label()); InitVsRefEgde(); @@ -160,6 +161,7 @@ AlignmentTabPage::AlignmentTabPage(weld::Container* pPage, weld::DialogControlle AlignmentTabPage::~AlignmentTabPage() { + m_xCtrlDialWin.reset(); m_xCtrlDial.reset(); m_xVsRefEdge.reset(); m_xLbFrameDir.reset(); @@ -258,7 +260,7 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) *rSet, SID_ATTR_ALIGN_DEGREES)); assert(pAngleItem); std::unique_ptr<SdrAngleItem> pNewAngleItem(pAngleItem->Clone()); - pNewAngleItem->SetValue(m_aCtrlDial.GetRotation()); + pNewAngleItem->SetValue(m_xCtrlDial->GetRotation()); rSet->Put(*pNewAngleItem); bChanged = true; } @@ -538,21 +540,21 @@ void AlignmentTabPage::Reset(const SfxItemSet* pCoreAttrs) { case SfxItemState::UNKNOWN: m_xNfRotate->hide(); - m_xCtrlDial->hide(); + m_xCtrlDialWin->hide(); break; case SfxItemState::DISABLED: case SfxItemState::READONLY: m_xNfRotate->set_sensitive(false); - m_xCtrlDial->set_sensitive(false); + m_xCtrlDialWin->set_sensitive(false); break; case SfxItemState::DONTCARE: - m_aCtrlDial.SetNoRotation(); + m_xCtrlDial->SetNoRotation(); break; case SfxItemState::DEFAULT: case SfxItemState::SET: { const SdrAngleItem& rAlignItem = static_cast<const SdrAngleItem&>(pCoreAttrs->Get(nWhich)); - m_aCtrlDial.SetRotation(rAlignItem.GetValue()); + m_xCtrlDial->SetRotation(rAlignItem.GetValue()); break; } } @@ -694,7 +696,7 @@ void AlignmentTabPage::UpdateEnableControls() // visibility of frames m_xAlignmentFrame->set_visible(m_xLbHorAlign->get_visible() || m_xEdIndent->get_visible() || m_xLbVerAlign->get_visible()); - m_xOrientFrame->set_visible(m_xCtrlDial->get_visible() || m_xVsRefEdge->get_visible() || + m_xOrientFrame->set_visible(m_xCtrlDialWin->get_visible() || m_xVsRefEdge->get_visible() || m_xCbStacked->get_visible() || m_xCbAsianMode->get_visible()); m_xPropertiesFrame->set_visible(m_xBtnWrap->get_visible() || m_xBtnHyphen->get_visible() || m_xBtnShrink->get_visible() || m_xLbFrameDir->get_visible()); @@ -707,7 +709,7 @@ void AlignmentTabPage::UpdateEnableControls() // windows to be disabled, if stacked text is turned OFF m_xCbAsianMode->set_sensitive(bStackedText); // rotation/stacked disabled for fill alignment/stacked - m_xCtrlDial->set_sensitive(!bHorFill && !bStackedText); + m_xCtrlDialWin->set_sensitive(!bHorFill && !bStackedText); m_xNfRotate->set_sensitive(!bHorFill && !bStackedText); } diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index aad88fb32555..90def10a4323 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -177,14 +177,15 @@ SvxAngleTabPage::SvxAngleTabPage(weld::Container* pPage, weld::DialogController* , m_xCtlRect(new weld::CustomWeld(*m_xBuilder, "CTL_RECT", m_aCtlRect)) , m_xFlAngle(m_xBuilder->weld_widget("FL_ANGLE")) , m_xNfAngle(m_xBuilder->weld_metric_spin_button("NF_ANGLE", FieldUnit::DEGREE)) - , m_xCtlAngle(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", m_aCtlAngle)) + , m_xCtlAngle(new svx::DialControl(m_xBuilder->weld_scrolled_window("anglepreview"))) + , m_xCtlAngleWin(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", *m_xCtlAngle)) { // calculate PoolUnit SfxItemPool* pPool = rOutAttrs.GetPool(); DBG_ASSERT( pPool, "no pool (!)" ); ePoolUnit = pPool->GetMetric(SID_ATTR_TRANSFORM_POS_X); - m_aCtlAngle.SetLinkedField(m_xNfAngle.get(), 2); + m_xCtlAngle->SetLinkedField(m_xNfAngle.get(), 2); } SvxAngleTabPage::~SvxAngleTabPage() @@ -243,13 +244,13 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet) { bool bModified = false; - if (m_aCtlAngle.IsValueModified() || m_xMtrPosX->get_value_changed_from_saved() || m_xMtrPosY->get_value_changed_from_saved()) + if (m_xCtlAngle->IsValueModified() || m_xMtrPosX->get_value_changed_from_saved() || m_xMtrPosY->get_value_changed_from_saved()) { const double fUIScale(double(pView->GetModel()->GetUIScale())); const double fTmpX((GetCoreValue(*m_xMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale); const double fTmpY((GetCoreValue(*m_xMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale); - rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_aCtlAngle.GetRotation())); + rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_xCtlAngle->GetRotation())); rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), basegfx::fround(fTmpX))); rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY))); @@ -289,13 +290,13 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs) pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ANGLE ); if(pItem) { - m_aCtlAngle.SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue()); + m_xCtlAngle->SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue()); } else { - m_aCtlAngle.SetRotation(0); + m_xCtlAngle->SetRotation(0); } - m_aCtlAngle.SaveValue(); + m_xCtlAngle->SaveValue(); m_xMtrPosX->save_value(); m_xMtrPosY->save_value(); } diff --git a/cui/uiconfig/ui/rotationtabpage.ui b/cui/uiconfig/ui/rotationtabpage.ui index a36cbf0b220e..a4f1b0eb6d73 100644 --- a/cui/uiconfig/ui/rotationtabpage.ui +++ b/cui/uiconfig/ui/rotationtabpage.ui @@ -270,7 +270,7 @@ </packing> </child> <child> - <object class="GtkScrolledWindow"> + <object class="GtkScrolledWindow" id="anglepreview"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="halign">center</property> |