sw/source/uibase/docvw/edtwin.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit 342a5890dbcddccb4013e201e3ff3d9e6967e733 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Thu Nov 14 16:42:40 2019 +0300 Commit: Xisco Faulí <xiscofa...@libreoffice.org> CommitDate: Thu Nov 21 12:20:04 2019 +0100 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í <xiscofa...@libreoffice.org> 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; } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits