Do layout immediately in resize

the wait for the idle is too long, keep idle for re-layout when
the container size doesnt change but the contents do

Change-Id: I6ed4806e96d10937e825192de86a3d602acf1689
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101943
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2020-09-02 14:34:22 +01:00
parent 782f4a674c
commit 8d84d38000
4 changed files with 9 additions and 9 deletions

View File

@@ -48,7 +48,7 @@ namespace dbaui
virtual void dispose() override;
virtual void GetFocus() override;
virtual void IdleResize() override;
virtual void Layout() override;
OTableEditorCtrl* GetEditorCtrl() const { return m_xEditorCtrl.get(); }
OTableFieldDescWin* GetDescWin() const { return m_xFieldDescWin.get(); }

View File

@@ -72,7 +72,7 @@ void OTableBorderWindow::dispose()
InterimItemWindow::dispose();
}
void OTableBorderWindow::IdleResize()
void OTableBorderWindow::Layout()
{
// dimensions of parent window
auto nOutputHeight = GetSizePixel().Height();
@@ -88,7 +88,7 @@ void OTableBorderWindow::IdleResize()
// set splitter
m_xHorzSplitter->set_position(nSplitPos);
InterimItemWindow::IdleResize();
InterimItemWindow::Layout();
if (nOldSplitPos != nSplitPos)
m_xHorzSplitter->set_position(nSplitPos);

View File

@@ -45,7 +45,7 @@ protected:
// returns true if keystroke is consumed
bool ChildKeyInput(const KeyEvent& rKEvt);
virtual void IdleResize();
virtual void Layout();
std::unique_ptr<weld::Builder> m_xBuilder;
VclPtr<vcl::Window> m_xVclContentArea;
@@ -57,7 +57,7 @@ private:
void StartIdleLayout();
DECL_LINK(DoResize, Timer*, void);
DECL_LINK(DoLayout, Timer*, void);
virtual void ImplPaintToDevice(::OutputDevice* pTargetOutDev, const Point& rPos) override;
};

View File

@@ -17,7 +17,7 @@ InterimItemWindow::InterimItemWindow(vcl::Window* pParent, const OUString& rUIXM
, m_pWidget(nullptr) // inheritors are expected to call InitControlBase
{
m_aLayoutIdle.SetPriority(TaskPriority::RESIZE);
m_aLayoutIdle.SetInvokeHandler(LINK(this, InterimItemWindow, DoResize));
m_aLayoutIdle.SetInvokeHandler(LINK(this, InterimItemWindow, DoLayout));
m_aLayoutIdle.SetDebugName("InterimItemWindow m_aLayoutIdle");
m_xVclContentArea = VclPtr<VclVBox>::Create(this);
@@ -67,11 +67,11 @@ void InterimItemWindow::queue_resize(StateChangedType eReason)
StartIdleLayout();
}
void InterimItemWindow::Resize() { StartIdleLayout(); }
void InterimItemWindow::Resize() { Layout(); }
IMPL_LINK_NOARG(InterimItemWindow, DoResize, Timer*, void) { IdleResize(); }
IMPL_LINK_NOARG(InterimItemWindow, DoLayout, Timer*, void) { Layout(); }
void InterimItemWindow::IdleResize()
void InterimItemWindow::Layout()
{
vcl::Window* pChild = GetWindow(GetWindowType::FirstChild);
assert(pChild);