[Kde-pim] EntityTreeView and context menus

Jonathan Marten jjm2 at keelhaul.demon.co.uk
Mon Feb 27 16:46:29 GMT 2012


Kevin Krammer <kevin.krammer at gmx.at> writes:
> On Monday, 2012-02-27, Jonathan Marten wrote:
>> The only fix that I can think of so far is to add a property to the
>> EntityTreeView to indicate whether the view is showing items or
>> collections, to be set by the calling application.  It would only be
>> used in the case of a click not over anything, and the default

> What about derving from EntityTreeView in KAddressBook and overwriting the 
> event handler method, delegating to base class implementation when event 
> position is on a valid item?

That could be done, but getting the correct menu over empty space
would mean duplicating nearly the whole of
EntityTreeView::contextMenuEvent() in the application.  No point in
doing this when the library is available, and it leaks the internal
library implementation details.

> I am not sure clicking in empty space will always result in either collection 
> or item context menu, an application could want different behavior.

But that's effectively the non-choice there is at present - empty
space always gives the collection context menu.

The property can be changed at any time - or, if dynamic per-click
behaviour is required, then the application could reimplement the
event handler as you suggest above.

Regards, Jonathan

-- 
Jonathan Marten                         http://www.keelhaul.demon.co.uk
Twickenham, UK                          jjm2 at keelhaul.demon.co.uk
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list