summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-03 21:25:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-04 10:32:32 +0200
commitc371d8ba8960e7830027d4d8d9155bab94722952 (patch)
tree0554c4e69348262e335be02cca2d5c0768f21c58 /svx
parentb9c10ee923308f336a694bbc0212396ed5317b6a (diff)
expand async to allow it to resize to optimal size
Change-Id: I87c413108a41f994c0e8d86f469fc361d4cd42e5 Reviewed-on: https://gerrit.libreoffice.org/70220 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/ClassificationDialog.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index d83a6b044a54..9cde1e8c7249 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -23,8 +23,8 @@
#include <config_folders.h>
#include <tools/XmlWriter.hxx>
#include <tools/XmlWalker.hxx>
-#include <vcl/builderfactory.hxx>
#include <vcl/event.hxx>
+#include <vcl/svapp.hxx>
#include <sfx2/objsh.hxx>
#include <officecfg/Office/Common.hxx>
@@ -232,15 +232,26 @@ ClassificationDialog::ClassificationDialog(weld::Window* pParent, const bool bPe
m_xRecentlyUsedListBox->set_size_request(m_xRecentlyUsedListBox->get_approximate_digit_width() * 5, -1);
m_xRecentlyUsedListBox->connect_changed(LINK(this, ClassificationDialog, SelectRecentlyUsedHdl));
- bool bExpand = officecfg::Office::Common::Classification::IntellectualPropertySectionExpanded::get();
- m_xIntellectualPropertyExpander->set_expanded(bExpand);
m_xIntellectualPropertyExpander->connect_expanded(LINK(this, ClassificationDialog, ExpandedHdl));
+ if (officecfg::Office::Common::Classification::IntellectualPropertySectionExpanded::get())
+ m_nAsyncExpandEvent = Application::PostUserEvent(LINK(this, ClassificationDialog, OnAsyncExpandHdl));
+ else
+ m_nAsyncExpandEvent = nullptr;
m_xEditWindow->SetModifyHdl(LINK(this, ClassificationDialog, EditWindowModifiedHdl));
}
+//do it async so gtk has a chance to shrink it to best size, otherwise its larger than min
+IMPL_LINK_NOARG(ClassificationDialog, OnAsyncExpandHdl, void*, void)
+{
+ m_nAsyncExpandEvent = nullptr;
+ m_xIntellectualPropertyExpander->set_expanded(true);
+}
+
ClassificationDialog::~ClassificationDialog()
{
+ if (m_nAsyncExpandEvent)
+ Application::RemoveUserEvent(m_nAsyncExpandEvent);
}
short ClassificationDialog::run()