Bug 86567 - TOOLBAR: Split/group button for conditional formatting
Summary: TOOLBAR: Split/group button for conditional formatting
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.4.0.0.alpha2
Hardware: Other All
: medium enhancement
Assignee: Maxim Monastirsky
URL:
Whiteboard: target:5.2.0
Keywords:
Depends on:
Blocks: Conditional-Formatting Split-Group-Buttons Calc-Toolbars
  Show dependency treegraph
 
Reported: 2014-11-22 11:17 UTC by Yousuf Philips (jay) (retired)
Modified: 2017-10-22 20:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
printscreens (195.91 KB, application/zip)
2014-11-23 11:55 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-11-22 11:17:18 UTC
It would be useful to have a conditional formatting split button which drop down simply shows the entries in the submenu Format > Conditional Formatting, in a similar fashion as we have the insert field (.uno:InsertFieldCtrl) split button pulling from Insert > Fields.
Comment 1 Alexander Wilms 2014-11-22 11:38:02 UTC
Should the drop down have lc or sc icons? I would prefer lc, since they are clearer and the line spacing drop down uses them too.
Comment 2 Yousuf Philips (jay) (retired) 2014-11-22 18:15:12 UTC
All the drop downs we currently have use sc icons, so it would have to stay that way for consistency. :D
Comment 3 raal 2014-11-23 11:55:03 UTC
Valid enhancement. Please provide also shortcuts to often used conditions, see attachment where are printscreens from excel.
Comment 4 raal 2014-11-23 11:55:45 UTC
Created attachment 109893 [details]
printscreens
Comment 5 Yousuf Philips (jay) (retired) 2014-11-23 13:08:57 UTC
(In reply to raal from comment #3)
> Valid enhancement. Please provide also shortcuts to often used conditions,
> see attachment where are printscreens from excel.

In order to achieve this, firstly we'd need some good style presets for use by conditional formatting: condition. If anyone has ideas about a good set of style presets outside of the ones that come in Calc, please do post your ideas at < https://redmine.documentfoundation.org/boards/1/topics/493 >.

For the others, we'd need new uno commands which have those presets set.

And finally, we'd need icons for the various presets.
Comment 6 Alexander Wilms 2014-11-23 13:42:04 UTC
I'm all for this, but shouldn't someone file seperate bug report for the presets?
Comment 7 Yousuf Philips (jay) (retired) 2014-11-23 13:48:57 UTC
(In reply to Fabian Alexander Wilms from comment #6)
> I'm all for this, but shouldn't someone file seperate bug report for the
> presets?

If you were referring to the defined style presets, those need to be created first in order for them to be used, which is what the redmine link will hopefully be able to accomplish. If you were referring to the uno commands with presets, that would likely need another bug report, as this one is just attempting to get the linkup between the menu drop down and the toolbar button drop down.
Comment 8 Commit Notification 2016-01-25 00:06:19 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

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

tdf#86567 Dropdown for conditional formatting

It will be available in 5.2.0.

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 9 Maxim Monastirsky 2016-01-25 00:08:11 UTC
@Jay: Please take a look at this commit, to get some idea on what's possible now wrt. menu/toolbar dropdowns.
Comment 10 Yousuf Philips (jay) (retired) 2016-01-26 11:00:08 UTC
@Maxim: Looks impressive. How about icon versions like the shape group buttons? Is making split buttons also this easy now?
Comment 11 Maxim Monastirsky 2016-01-26 11:18:03 UTC
(In reply to Yousuf (Jay) Philips from comment #10)
> @Maxim: Looks impressive. How about icon versions like the shape group
> buttons? Is making split buttons also this easy now?
Yes, except that it uses the toolbar xml format instead of popupmenu.
Comment 12 Maxim Monastirsky 2016-01-26 17:19:46 UTC
(In reply to Maxim Monastirsky from comment #11)
> Is making split buttons also this easy now?
Just to clarify: Split buttons are possible with both menu-based and icon-based dropdowns, but they have slight difference in behavior. For a button with icon-based dropdown, the main function is replaced upon selecting something from the dropdown - like in the shapes buttons, but for a button with a menu-based dropdown the main function always stays the same - like in the open or save buttons. That's the situation right now, but it can be changed if needed (please let me know then).

The way to turn buttons to split buttons is via the "Value" property in Controller.xcu:

- For icon-based buttons - which use "com.sun.star.comp.framework.SubToolBarController" as the controller, the "Value" property syntax is "toolbar_filename;.uno:DefaultCommand". This turns the button to split button, and sets .uno:DefaultCommand as the default command of that button. If the default command is omitted, the button will be dropdown-only (not splitted).

- For menu-based buttons - which use "com.sun.star.comp.framework.GenericPopupToolbarController" as the controller, the "Value" property points to the command from the "PopupMenu" section above. Using non-empty "Value" property will always lead to a split button. Omitting it will lead to dropdown-only button (and the "PopupMenu" section will be searched for the same command as the current one).

Hope that's clear enough. Controller.xcu already has several uses of both methods, so you can see how it works. All this is still WIP, so please let me know if there is any functionality missing.