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

Resolves: tdf#122285 task panel too short

there are a bunch of resizes as base starts up, and base will position
the splitwin on the first time its big enough to place it and gets stuck
too high up, before it goes full size.

We don't want this jumping around on every subsequent user size, but we do
want it to get placed at the final size during the load.

So post the resize event to occur on idle, and when it finally gets a chance
to run we'll be at our final size and the placement is good

Change-Id: Iccb169bac93a5cf8bc931945bc7e1b71c6c9dd23
Reviewed-on: https://gerrit.libreoffice.org/65586
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 8e5d874a
...@@ -32,6 +32,7 @@ OSplitterView::OSplitterView(vcl::Window* _pParent) : Window(_pParent,WB_DIALOGC ...@@ -32,6 +32,7 @@ OSplitterView::OSplitterView(vcl::Window* _pParent) : Window(_pParent,WB_DIALOGC
,m_pSplitter( nullptr ) ,m_pSplitter( nullptr )
,m_pLeft(nullptr) ,m_pLeft(nullptr)
,m_pRight(nullptr) ,m_pRight(nullptr)
,m_pResizeId(nullptr)
{ {
ImplInitSettings(); ImplInitSettings();
} }
...@@ -43,6 +44,11 @@ OSplitterView::~OSplitterView() ...@@ -43,6 +44,11 @@ OSplitterView::~OSplitterView()
void OSplitterView::dispose() void OSplitterView::dispose()
{ {
if (m_pResizeId)
{
RemoveUserEvent(m_pResizeId);
m_pResizeId = nullptr;
}
m_pSplitter.clear(); m_pSplitter.clear();
m_pLeft.clear(); m_pLeft.clear();
m_pRight.clear(); m_pRight.clear();
...@@ -102,9 +108,10 @@ void OSplitterView::GetFocus() ...@@ -102,9 +108,10 @@ void OSplitterView::GetFocus()
m_pRight->GrabFocus(); m_pRight->GrabFocus();
} }
void OSplitterView::Resize() IMPL_LINK_NOARG(OSplitterView, ResizeHdl, void*, void)
{ {
Window::Resize(); m_pResizeId = nullptr;
OSL_ENSURE( m_pRight, "No init called!"); OSL_ENSURE( m_pRight, "No init called!");
Point aSplitPos; Point aSplitPos;
...@@ -142,7 +149,14 @@ void OSplitterView::Resize() ...@@ -142,7 +149,14 @@ void OSplitterView::Resize()
m_pRight->setPosSizePixel( aSplitPos.X(), aPlaygroundPos.Y() + aSplitPos.Y() + aSplitSize.Height(), m_pRight->setPosSizePixel( aSplitPos.X(), aPlaygroundPos.Y() + aSplitPos.Y() + aSplitSize.Height(),
aPlaygroundSize.Width() , aPlaygroundSize.Height() - aSplitSize.Height() - aSplitPos.Y()); aPlaygroundSize.Width() , aPlaygroundSize.Height() - aSplitSize.Height() - aSplitPos.Y());
} }
}
void OSplitterView::Resize()
{
Window::Resize();
if (m_pResizeId)
RemoveUserEvent(m_pResizeId);
m_pResizeId = PostUserEvent(LINK(this, OSplitterView, ResizeHdl), this, true);
} }
void OSplitterView::set(vcl::Window* _pRight,Window* _pLeft) void OSplitterView::set(vcl::Window* _pRight,Window* _pLeft)
......
...@@ -30,9 +30,11 @@ namespace dbaui ...@@ -30,9 +30,11 @@ namespace dbaui
VclPtr<Splitter> m_pSplitter; VclPtr<Splitter> m_pSplitter;
VclPtr<vcl::Window> m_pLeft; VclPtr<vcl::Window> m_pLeft;
VclPtr<vcl::Window> m_pRight; VclPtr<vcl::Window> m_pRight;
ImplSVEvent *m_pResizeId;
void ImplInitSettings(); void ImplInitSettings();
DECL_LINK( SplitHdl, Splitter*, void ); DECL_LINK(SplitHdl, Splitter*, void);
DECL_LINK(ResizeHdl, void*, void);
protected: protected:
virtual void DataChanged(const DataChangedEvent& rDCEvt) override; virtual void DataChanged(const DataChangedEvent& rDCEvt) override;
public: public:
......
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