the neat thing is that it mimics the api for qtoolbar so you can simply sling actions at it and they show up grouped:
KMultiActionButton* button = new KMultiActionButton(window);
button->addAction( icon1, i18n("Quit"), qApp, SLOT( quit() ));
QAction* action = button->addAction( icon2, "action 2", );
connect(action, SIGNAL(triggered(bool)), this, SLOT(someSlot()));
button->addAction( KStdAction::close( mainWindow, SLOT( close() ), actionCollection() ) );
toolbar->addWidget(button);
i still have to implement things like showing menus for actions that have them and respecting action groups (not to mentioned seriously working on the currently crapitudinal eye candy), but i'm interested in feedback from other developers before i spend to much time on it. if you have a Qt4 or KDE4 app (there are currently no KDE dependencies in the class) and would like something like this in your app, please let me know as i'm looking for some guinea pigs, er, test cases before attempting to inflict this upon libkdeui ;)
p.s. no, i'm not trying to replace devel mailing lists with blogs: i've also sent an email off to kde-core-devel, but not all app devels read that.

9 comments:
Seems to be quite a good idea, in case you have (two) buttons that have similar or opposite effects. For example:
* go backwards/forwards
* increase/decrease some size
* zoom in/out
* reload/stop loading (???)
* ...
don't read a mailing list, but a single person's blog? Funny.
Try kde-devel also...
I don't follow mailing lists, but I follow aseigo's blog..
Until now, a Quit button on a toolbar was considered evil. I have it in some KDE-Edu games but it was not well received at all... Maybe times change.
However a Quit button so close to any other one is bond to have the user click on the wrong one. See for ex. the right click context menus for apps in systray and how easy it is to Quit instead of doing the action just above.
Could you give some insight in how this is supposed to work? Not all of us can (or want to) check out Vista to see what this widget is supposed to accomplish...
I think the idea is pretty cool; and I certainly see use for it in KOffice. Both on toolbars and on other widgets (dockers specifically).
The GUI part looks to me like you are painting one toolButton that's the width of 3 toolbuttons (using the normal styled drawing) and then overlay some separators and icons.
I would also love to see some integration in the rc file for xmlgui so end users can tweak this to their hearts content ;)
Aaron can you post source code so we can test it
@annma: yes, quit buttons on toolbars are generally evil (apps aimed at children are one good example of an exception though =). the icons were random, as opposed to being a meaningful example.
@andre: the idea is to group semantically similar icons together in toolbars better. this method both saves a bit of toolbar space as well as creates this improved visual grouping.
This looks great, and no offence to anybody at all but KDE4 will need to have some nice eyecandy to make a big splash with.
At present I am using Vista (1. I have a Tablet PC .2.I am going to switch back in the summer) but I am a long time KDE fan and I must say it's a nice feature to have. I may not be a developer but as a user I would love to see this implemented.
VERY cool.
Post a Comment