diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-09-26 15:47:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-09-26 20:51:18 +0200 |
commit | f35825e85f59e0fd155c68d63260169cd3cb38c9 (patch) | |
tree | 1ce4e03a7ca22ce4a936e419b0cfa1905721ff5d /svx | |
parent | 94223ae823a2e3e81da5ab0dc827c33f3a23882c (diff) |
Resolves: tdf#127218 allow changes dialog to shrink when button text changes
original the dialog has super wide button contents when the initial size
is calculated, and then the buttons are changed afterwards, but the dialog
remains at its initial size.
Change-Id: Ib29ab9ebdec01a93561a8b304572df60b6ad5ad2
Reviewed-on: https://gerrit.libreoffice.org/79634
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/ctredlin.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 67e84c7e8b9d..705eefdb1b96 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -25,8 +25,6 @@ #include <sfx2/module.hxx> #include <svtools/ctrlbox.hxx> #include <unotools/textsearch.hxx> -#include <vcl/svlbitm.hxx> -#include <vcl/viewdataentry.hxx> #include <unotools/charclass.hxx> #include <editeng/unolingu.hxx> @@ -282,13 +280,14 @@ void SvxTPage::ActivatePage() { } -SvxTPView::SvxTPView(weld::Container* pParent, weld::Builder* pTopLevel) +SvxTPView::SvxTPView(weld::Container* pParent, weld::Window* pDialog, weld::Builder* pTopLevel) : SvxTPage(pParent, "svx/ui/redlineviewpage.ui", "RedlineViewPage") , bEnableAccept(true) , bEnableAcceptAll(true) , bEnableReject(true) , bEnableRejectAll(true) , bEnableUndo(true) + , m_pDialog(pDialog) , m_xAccept(pTopLevel->weld_button("accept")) , m_xReject(pTopLevel->weld_button("reject")) , m_xAcceptAll(pTopLevel->weld_button("acceptall")) @@ -414,6 +413,12 @@ void SvxTPView::EnableClearFormatButton(weld::Button& rButton, bool bFlag) rButton.set_label(sText.copy(0, nPos - 1)); } } + + if (m_pDialog) + { + // tdf#127218 allow dialog to shrink + m_pDialog->resize_to_request(); + } } void SvxTPView::EnableClearFormat(bool bFlag) @@ -956,7 +961,7 @@ IMPL_LINK_NOARG(SvxTPFilter, RefHandle, weld::Button&, void) aRefLink.Call(this); } -SvxAcceptChgCtr::SvxAcceptChgCtr(weld::Container* pParent, weld::Builder* pTopLevel) +SvxAcceptChgCtr::SvxAcceptChgCtr(weld::Container* pParent, weld::Window* pDialog, weld::Builder* pTopLevel) : m_xBuilder(Application::CreateBuilder(pParent, "svx/ui/redlinecontrol.ui")) , m_xTabCtrl(m_xBuilder->weld_notebook("RedlineControl")) { @@ -964,7 +969,7 @@ SvxAcceptChgCtr::SvxAcceptChgCtr(weld::Container* pParent, weld::Builder* pTopLe m_xTabCtrl->connect_leave_page(LINK(this, SvxAcceptChgCtr, DeactivatePageHdl)); m_xTPFilter.reset(new SvxTPFilter(m_xTabCtrl->get_page("filter"))); - m_xTPView.reset(new SvxTPView(m_xTabCtrl->get_page("view"), pTopLevel)); + m_xTPView.reset(new SvxTPView(m_xTabCtrl->get_page("view"), pDialog, pTopLevel)); m_xTPFilter->SetRedlinTable(m_xTPView->GetTableControl()); m_xTabCtrl->set_current_page("view"); m_xTabCtrl->show(); |