Bug 124041 - Place focus on header/footer frame menu button when header/footer is empty
Summary: Place focus on header/footer frame menu button when header/footer is empty
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.6.2 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp, topicUI
Depends on:
Blocks: Writer-Header-Footer
  Show dependency treegraph
 
Reported: 2019-03-13 07:34 UTC by Jim Raykowski
Modified: 2021-03-22 14:30 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
text input header frame menu button display interfer with each other (555.07 KB, video/x-matroska)
2019-03-13 07:34 UTC, Jim Raykowski
Details
change positon of header/footer frame menu button when empty (1.01 MB, video/x-matroska)
2019-03-13 23:24 UTC, Jim Raykowski
Details
screenshot of hf frame menu button opacity approach (38.87 KB, image/png)
2019-11-22 00:40 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Raykowski 2019-03-13 07:34:37 UTC
Created attachment 149924 [details]
text input header frame menu button display interfer with each other

When the header/footer frame menu is activated and the header/footer is empty the cursor is placed either at the start or end of the page text. If text is entered before the frame menu button is pressed to add the header/footer the text and menu button display interfere with each other.

Attached is a screen recorded example.

One solution would be to place focus on the header/footer frame menu button if the header/footer is empty.
Comment 1 Dieter 2019-03-13 12:53:46 UTC
I confirm that behaviour. 

Version: 6.1.5.2 (x64)
Build-ID: 90f8dcf33c87b3705e78202e3df5142b201bd805
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group threaded

One solution could also be to place the frame menu button above the line, if the header is empty.
Comment 2 Jim Raykowski 2019-03-13 23:24:29 UTC
Created attachment 149951 [details]
change positon of header/footer frame menu button when empty

(In reply to Dieter Praas from comment #1)
> One solution could also be to place the frame menu button above the line, if
> the header is empty.

Hi Dieter, 
Attached is a screen recorded implementation of the solution you have suggested. Perhaps this could be opened in a separate bug report and made into an easy hack. I think we should check with the UX team before moving anymore on this.
Comment 3 Xisco Faulí 2019-03-14 08:55:44 UTC
(In reply to Jim Raykowski from comment #2)
> I think we should check with the UX team before moving
> anymore on this.

Adding UX team
Comment 4 Heiko Tietze 2019-03-14 10:23:45 UTC
That's a lot of movement, I would go with the focus as there is no reason to active the menu but continue to type. Another option is to redraw the buttons, eg. opaque. Users can hide the advanced header/footer menus.
Comment 5 Jim Raykowski 2019-03-14 19:28:59 UTC
(In reply to Heiko Tietze from comment #4)
> Another option is to redraw the
> buttons, eg. opaque. Users can hide the advanced header/footer menus.

There is a "TODO Ghost it all" comment in the code which may be the opacity approach. I'm lost on the "Users can hide the advanced header/footer menus." 

My vote is for moving focus to the frame menu button. This suggests implementation of keyboard input handling for the add header/footer frame menu button, the button that shows with the + after the text. Currently an escape key press when the cursor is in the header/footer edit window moves focus to the main document. Pressing the escape key when the non empty header/footer frame menu button pop up menu is active closes the pop up menu and places focus on the frame menu button. Escape key from this state does nothing. Move focus to the header/footer edit window if header/footer is not empty or to the main document if header/footer is empty seems logical. I didn't find a way to move focus to the header/footer edit window or activate the frame menu button using the keyboard.
Comment 6 Heiko Tietze 2019-03-14 20:44:51 UTC
(In reply to Jim Raykowski from comment #5)
> I'm lost on the "Users can hide the advanced header/footer menus." 
See bug 118621
 
> My vote is for moving focus to the frame menu button.
Would be my first choice too.
Comment 7 Jim Raykowski 2019-03-15 05:26:46 UTC
(In reply to Jim Raykowski from comment #5)

> I didn't find a way to move focus to the header/footer edit window or activate
> the frame menu button using the keyboard.

To Header (.uno:JumpToHeader) and To Footer (.uno:JumpToFooter) do this. They are assigned keyboard shortcut keys Ctrl+Page Up and Ctrl+Page Down by default.
Comment 8 Jim Raykowski 2019-03-16 10:26:06 UTC
Code pointers to grab focus to the empty header/footer frame menu button. 

Use SwHeaderFooterWin::IsEmptyHeaderFooter() to check if... header footer is empty, then grab focus to SwHeaderFooterWin using Window::GrabFocus() inherited by SwHeaderFooterWin.

Add lines of code in the appropriate place in this function
sw/source/uibase/docvw/FrameControlsManager.cxx
void SwFrameControlsManager::SetHeaderFooterControl( const SwPageFrame* pPageFrame, ...


After is this is done I can supply code pointers for adding key input handling of Escape key to return to main document and handling of Space and Enter key to add the header/footer.
Comment 9 Heiko Tietze 2019-03-18 08:50:52 UTC Comment hidden (no-value)
Comment 10 Jim Raykowski 2019-03-19 05:30:36 UTC
Since it is no longer a maybe, concerning what is to be done, I have changed the bug title.
Comment 11 Xisco Faulí 2019-07-18 11:40:10 UTC
Dear Aditya Sahu,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 12 Aditya Sahu 2019-11-20 14:23:14 UTC
Kindly review the following change:
https://gerrit.libreoffice.org/#/c/83115/
Comment 13 Jim Raykowski 2019-11-22 00:40:17 UTC
Created attachment 156018 [details]
screenshot of hf frame menu button opacity approach

My idea to move focus to the frame button when the hf is empty doesn't work well. For multi page documents the frame button can still become in the way. The opacity approach, which can be seen in the attachment, seems not so good either. IMHO Dieter's suggestion to move the frame button when the hf is empty is the best way to avoid this nuisance.
Comment 14 Jim Raykowski 2019-11-22 07:22:46 UTC
Perhaps the frame button displayed when there is an empty hf should be eliminated and when hf is clicked on it should be added if empty without need for clicking on the add hf frame button?
Comment 15 Aditya Sahu 2019-11-30 16:01:53 UTC
until we arrive at a concurred solution, removing myself as the assignee and changing bug status back to NEW.
Comment 16 Jim Raykowski 2019-12-31 05:41:21 UTC
Another idea for this annoyance:

Since the cursor remains in the document when the Add header/footer frame menu button is displayed. How about simply hiding it if a key is pressed?. This would be consistent with a mouse click in the document area.
Comment 17 Moaz El-defrawy 2021-03-22 14:04:22 UTC
Is this bug still active? I tried reproducing it but failed to do so.
Comment 18 Buovjaga 2021-03-22 14:30:17 UTC
(In reply to Moaz El-defrawy from comment #17)
> Is this bug still active? I tried reproducing it but failed to do so.

I failed as well. The glitch is no longer there and the text goes under the button. Let's close.

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 005adbefc746f9024adcf572c287dc061acbcf00
CPU threads: 2; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: threaded