Bug 62081 - Add split menus to items in the style dropdown
Summary: Add split menus to items in the style dropdown
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium enhancement
Assignee: Szymon Kłos
URL:
Whiteboard: target:4.4.0
Keywords: difficultyInteresting, easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2013-03-10 01:31 UTC by Tin Man
Modified: 2016-02-07 21:04 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot (54.78 KB, image/png)
2014-09-30 18:44 UTC, Samuel Mehrbrodt (allotropia)
Details
bug (12.22 KB, application/vnd.oasis.opendocument.text-template)
2014-10-02 21:06 UTC, Szymon Kłos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tin Man 2013-03-10 01:31:11 UTC
The idea is to add a menu for each style in the Style dropdown containing "Edit Style Based on Selection", "Edit Style...", "Duplicate Style" and "Remove Style", similar to the Google Docs implementation: http://clickortap.wordpress.com/2012/02/19/notice-google-docs-new-style-management/#jp-carousel-973
Comment 1 Rainer Bielefeld Retired 2013-03-10 10:03:11 UTC
I do not agree with that proposal. Compared to the very few cases where I want to adapt a style it requires an additional click for every occasion where I want to apply a style.

And I doubt that that is an EasyHack. Do we already have such a sub-selector? Remove proposal for now.

@mazelm:
Why is Version 4.0.1.2? What is new in that version that we now need your proposed enhancement?
Comment 2 Tin Man 2013-03-10 20:52:08 UTC
(In reply to comment #1)
> I do not agree with that proposal. Compared to the very few cases where I
> want to adapt a style it requires an additional click for every occasion
> where I want to apply a style.

Sorry, I didn't explain it well enough. It would be a split button, like the Google Docs implementation, therefore it wouldn't require an additional click for applying a style.

> And I doubt that that is an EasyHack. Do we already have such a
> sub-selector? Remove proposal for now.

Alright, sure.

> @mazelm:
> Why is Version 4.0.1.2? What is new in that version that we now need your
> proposed enhancement?

It's not version-specific.
Comment 3 Rainer Bielefeld Retired 2013-03-10 21:26:58 UTC
Well, at least an interesting idea, should be discussed. No idea whether we simply can copy that, copyright issues ...

@Stephan:
Astron: Have there already been discussions?
Comment 4 Jan Holesovsky 2013-06-28 18:26:11 UTC
Some code pointers to turn this into an Easy Hack :-)

The styles dropdown lives in svx/source/tbxctrls/tbcontrl.cxx, and is drawn via

void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt )

[around line 553]

You need to add the drawing of the button that leads to submenu there, and also react on the click event (and key event too) accordingly.

PopupMenu class that you'll probably need to use is declared in include/vcl/menu.hxx.  Please ask on the IRC should you have trouble, I'm there as 'kendy'.
Comment 5 Björn Michaelsen 2013-10-04 18:46:05 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 6 Commit Notification 2014-09-24 18:28:38 UTC
Szymon KÅos committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b4de0bd548399593ad2627afde443a569e7b8ea1

fdo#62081: Add split menus to items in the style dropdown



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Luke 2014-09-25 04:02:54 UTC
Verified fixed in a current 4.4 build. Beautiful work, Szymon! This is a nice improvement in the UI.
Comment 8 Yousuf Philips (jay) (retired) 2014-09-25 07:45:03 UTC
Thanks Szymon Kłos for the patch as i know it will also benefit the sidebar when the styles drop down is put there as well.

Look forward to the upcoming improvements and here are some suggestions that i know Mirek2 would also recommend.

1) 'Update Style' - In the 'styles & formatting' dialog, there is a drop down menu item that has an 'Update Style' entry, so it would useful to link that the code in there.

2) Right-click activation - It would be good if right-click would open up that menu, rather than apply the current style, as right-click is the common button for context menu.

3) 'Apply Style' - I think this could be removed, as clicking on the style name does the same thing.
Comment 9 Adolfo Jayme Barrientos 2014-09-27 05:37:35 UTC
I tested the new dropdowns, but when I click them, the parent Styles menu disappears (leaving a floating submenu in a nonsensical position of the screen), which I think is not what people would expect. Besides that, it’s a wonderful improvement, Szymon.
Comment 10 Commit Notification 2014-09-30 18:43:01 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d59e33500a250824e713afacef2ea295576caba6

fdo#62081 Improve split menu on style dropdown



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Samuel Mehrbrodt (allotropia) 2014-09-30 18:44:05 UTC
I've made some improvements to the dropdown, see screenshot.

> It would be good if right-click would open up that menu, rather than apply the current style, as right-click is the common button for context menu.
This is not common on such dropdowns, I didn't implement this. Instead you can activate the dropdown with the context menu key.
Comment 12 Samuel Mehrbrodt (allotropia) 2014-09-30 18:44:22 UTC
Created attachment 107149 [details]
Screenshot
Comment 13 Samuel Mehrbrodt (allotropia) 2014-09-30 18:45:56 UTC
(In reply to comment #9)
> I tested the new dropdowns, but when I click them, the parent Styles menu
> disappears (leaving a floating submenu in a nonsensical position of the
> screen)

On which OS did you test this?
Comment 14 Samuel Mehrbrodt (allotropia) 2014-09-30 19:10:28 UTC
Btw I also increased the width of the dropdown (+10px) to give the new button some space.
Comment 15 Adolfo Jayme Barrientos 2014-09-30 19:42:27 UTC
(In reply to comment #13)
> On which OS did you test this?

That was on Windows. Ideally the new submenu would not close the Styles dropdown.
Comment 16 Yousuf Philips (jay) (retired) 2014-09-30 19:57:15 UTC
(In reply to comment #11)
> I've made some improvements to the dropdown, see screenshot.

Screenshot looks nice, but think the label is to long and the user might not be selecting text. :D

> > It would be good if right-click would open up that menu, rather than apply the current style, as right-click is the common button for context menu.
> This is not common on such dropdowns, I didn't implement this. Instead you
> can activate the dropdown with the context menu key.

I wasnt suggesting that the drop down only be activated by the right-click, i was suggesting that it also be activated by the right-click. I dont think its common for right-click to act like left-click when in a drop down menu. If anything, please disable the right-click action from having any effect.

About it not being common in such drop downs, MS Word and iWork Pages have right-click bring up a contextual menu.

MS Word - http://i.imgur.com/jedf1ld.png
Pages - https://bugs.freedesktop.org/attachment.cgi?id=105460

I doubt someone would use the context menu key when they are in the drop down with their mouse. :)

(In reply to comment #14)
> Btw I also increased the width of the dropdown (+10px) to give the new
> button some space.

There is a bug regarding it being to small, which i think you should read over (bug 76825).
Comment 17 Yousuf Philips (jay) (retired) 2014-09-30 20:39:19 UTC
(In reply to comment #15)
> That was on Windows. Ideally the new submenu would not close the Styles
> dropdown.

Confirmed it disappears in Windows but not in Linux.
Comment 18 Adolfo Jayme Barrientos 2014-09-30 20:51:12 UTC
(In reply to comment #16)
> > This is not common on such dropdowns, I didn't implement this. Instead you
> > can activate the dropdown with the context menu key.

It is good that the key Works now, thanks.

> About it not being common in such drop downs, MS Word and iWork Pages have
> right-click bring up a contextual menu.

Which of course does not mean that is a good UI pattern to follow. The context menus in your screenshots are both completely obscure, no menus should have context menus, and if they do, they should show a dropdown icon.

> I doubt someone would use the context menu key when they are in the drop
> down with their mouse. :)

You doubt it, but it is perfectly possible, and valid ;-)
Comment 19 Yousuf Philips (jay) (retired) 2014-09-30 21:20:21 UTC
(In reply to comment #18)
> Which of course does not mean that is a good UI pattern to follow. The
> context menus in your screenshots are both completely obscure, no menus
> should have context menus, and if they do, they should show a dropdown icon.

Mirek2 believes its good UI and i'm just suggesting this as he wanted that functionality to appear in the style drop down in the sidebar. I'm personally indifferent about it, but if its not implemented, please remove the right-click apply style, so people dont mistakenly try it thinking it will bring up a context menu.

> You doubt it, but it is perfectly possible, and valid ;-)

So the mouse key to activate the context menu isnt valid, but the keyboard key to do so, which is a substitute for the mouse key, is valid. ;D
Comment 20 Samuel Mehrbrodt (allotropia) 2014-09-30 21:25:58 UTC
> Mirek2 believes its good UI and i'm just suggesting this as he wanted that
> functionality to appear in the style drop down in the sidebar. I'm
> personally indifferent about it, but if its not implemented, please remove
> the right-click apply style, so people dont mistakenly try it thinking it
> will bring up a context menu.
The default behavior in any other dropdown in LO is that the current entry can be activated with both the left and the right mouse key. I don't see why I should change it here.

> So the mouse key to activate the context menu isnt valid, but the keyboard
> key to do so, which is a substitute for the mouse key, is valid. ;D

The keyboard key is for a11y.
Comment 21 Jean-Baptiste Faure 2014-10-02 17:43:43 UTC
Very interesting :-) I just tested it on my build of the last night (Build ID: b6cff5fae1a91549402bdee55a1077719f7b9c65) and it is strange that the submenu act on the current applied style, not on the one that is selected in the dropdown list. To be clear in https://wiki.documentfoundation.org/images/thumb/3/33/Styledropdown.png/300px-Styledropdown.png the "Edit Style" edits the Default style, not the Quotation style as I expected. 
Is it the wanted behavior ?

Tests made on Ubuntu 14.04 x86-64.

Best regards. JBF
Comment 22 Tin Man 2014-10-02 17:58:22 UTC
(In reply to Jean-Baptiste Faure from comment #21)
> Very interesting :-) I just tested it on my build of the last night (Build
> ID: b6cff5fae1a91549402bdee55a1077719f7b9c65) and it is strange that the
> submenu act on the current applied style, not on the one that is selected in
> the dropdown list. To be clear in
> https://wiki.documentfoundation.org/images/thumb/3/33/Styledropdown.png/
> 300px-Styledropdown.png the "Edit Style" edits the Default style, not the
> Quotation style as I expected. 
> Is it the wanted behavior ?

No -- it's a bug. Could you report it?
(I don't have the latest build, so I can't confirm it.)
Comment 23 Jean-Baptiste Faure 2014-10-02 18:13:32 UTC
(In reply to Mirek2 from comment #22)
> [...]
> No -- it's a bug. Could you report it?
> (I don't have the latest build, so I can't confirm it.)

Done: https://bugs.freedesktop.org/show_bug.cgi?id=84605

Best regards. JBF
Comment 24 Szymon Kłos 2014-10-02 21:06:40 UTC
Created attachment 107236 [details]
bug

I noticed new bug (LO builded yesterday, Linux 32-bit):
1) Open attached file.
2) When you open the dropdown menu, go to the first style (on top) and then go down holding the arrow on keyboard.
Comment 25 Samuel Mehrbrodt (allotropia) 2014-10-02 21:09:46 UTC
(In reply to Szymon Kłos from comment #24)
> Created attachment 107236 [details]
> bug
> 
> I noticed new bug (LO builded yesterday, Linux 32-bit):
> 1) Open attached file.
> 2) When you open the dropdown menu, go to the first style (on top) and then
> go down holding the arrow on keyboard.

Whoops...
Can you create a new bug for this also?
Btw. this also happens in 4.3, so not a regression at least...
Comment 26 Szymon Kłos 2014-10-03 07:31:25 UTC
(In reply to Samuel Mehrbrodt from comment #25)
> Can you create a new bug for this also?

https://bugs.freedesktop.org/show_bug.cgi?id=84620

Regards
Comment 27 Yousuf Philips (jay) (retired) 2014-10-17 11:57:57 UTC
Updated label from 'Update Style Based on Selection' to 'Update to Match Selection'. 'to Match Selection' is used in both MS Word and Google Docs, while iWork Pages uses 'Update Style'. https://gerrit.libreoffice.org/12005
Comment 28 A (Andy) 2014-11-22 09:11:32 UTC
I right now tested this new split menu in the styles dropdown with LO 4.4.0.0.beta1, Win 8.1.

What I recognized is, that if you have opened any split menu you have to close it with the arrow again to be able to click to the next style.  I think it would be good, if this can be improved in that way, that the opened split menu is closed if you click to the next style, that means you can click on the next style without manually closing the split menu.
Comment 29 Mike §chinagl 2014-12-20 21:36:30 UTC
This bug fix comes with LibreOffice 4.4 (release notes https://wiki.documentfoundation.org/ReleaseNotes/4.4) 


The style dropdown now has a split menu to edit or update the selected style.

See a graphic of the work:
https://wiki.documentfoundation.org/File:Styledropdown.png
Comment 30 Robinson Tryon (qubit) 2015-12-16 00:24:11 UTC Comment hidden (noise)