summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2019-11-14 16:42:40 +0300
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2019-11-21 12:20:04 +0100
commit342a5890dbcddccb4013e201e3ff3d9e6967e733 (patch)
tree58746f93614ca4a2e87a5f9bdfd3e1f204f48335 /sw
parent60b1a93a990a9978a30dee929526faf8db629a7f (diff)
tdf#84929 sw UI: stay at footer when showing control
Scenario: a new document where the first thing the user wants to do is create a footer. Scroll down to the bottom of the page (this does mean that you can't see the top of the page, right? None of my screens show an entire page by default anyway...) and click in the footer area. The screen jumps back to the top of the page and the user needs to scroll to the bottom again in order to enable the footer. So, in the very specific case of the control being turned on (because I don't care about a jump if the control is being turned off) don't process a return to the cursor position. Regression potential: The only use case I can think of is someone trying to drag a section by starting too low on the page. The early return will quickly cancel any kind of drag attempt. Basically if the user clicks in the footer area without intending to get the separator bar, it might act differently than what previously happened. I don't really see this scenario as a problem. One additional limitation could be added to only apply this if it is dealing with the footer, since in the case of a header there would be no screen-jump. Change-Id: I11cd3089b85d8eb49063b902e6bf8bf2e1412aa7 Reviewed-on: https://gerrit.libreoffice.org/82701 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index c90f73542edf..0cf38b1632b2 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2837,10 +2837,17 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if (!(bWasInHeader && eControl == Header) &&
!(bWasInFooter && eControl == Footer))
{
- rSh.SetShowHeaderFooterSeparator(eControl, !rSh.IsShowHeaderFooterSeparator(eControl));
+ const bool bSeparatorWasVisible = rSh.IsShowHeaderFooterSeparator(eControl);
+ rSh.SetShowHeaderFooterSeparator(eControl, !bSeparatorWasVisible);
// Repaint everything
Invalidate();
+
+ // If the control had not been showing, do not return to the cursor position,
+ // because the user may have scrolled to turn on the separator control and
+ // if the cursor is now off-screen, then the user would need to scroll back again to use the control.
+ if ( !bSeparatorWasVisible && rSh.GetViewOptions()->IsUseHeaderFooterMenu() && !Application::IsHeadlessModeEnabled() )
+ return;
}
}
}