Kaydet (Commit) c371d8ba authored tarafından Caolán McNamara's avatar Caolán McNamara

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: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b9c10ee9
......@@ -30,6 +30,7 @@ private:
const bool m_bPerParagraph;
const std::function<void()> m_aParagraphSignHandler;
ImplSVEvent* m_nAsyncExpandEvent;
sal_Int32 m_nCurrentSelectedCategory;
std::vector<std::vector<ClassificationResult>> m_aRecentlyUsedValuesCollection;
......@@ -61,6 +62,7 @@ private:
DECL_LINK(EditWindowModifiedHdl, LinkParamNone*, void);
DECL_STATIC_LINK(ClassificationDialog, ExpandedHdl, weld::Expander&, void);
DECL_STATIC_LINK(ClassificationDialog, KeyInput, const KeyEvent&, bool);
DECL_LINK(OnAsyncExpandHdl, void*, void);
void insertField(ClassificationType eType, OUString const & rString, OUString const & rFullString, OUString const & rIdentifier = OUString());
void insertCategoryField(sal_Int32 nID);
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment