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
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?
(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.
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?
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'.
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
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.
Verified fixed in a current 4.4 build. Beautiful work, Szymon! This is a nice improvement in the UI.
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.
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.
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.
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.
Created attachment 107149 [details] Screenshot
(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?
Btw I also increased the width of the dropdown (+10px) to give the new button some space.
(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.
(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).
(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.
(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 ;-)
(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
> 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.
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
(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.)
(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
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.
(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...
(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
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
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.
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
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyInteresting SkillCpp) [NinjaEdit]