KTabBar -- double clicking on empty space

Constantin Berzan exit3219 at gmail.com
Sun Sep 9 18:02:08 BST 2007


On Sunday 09 September 2007 19:52, Andreas Hartmetz wrote:
> On Sunday 09 September 2007 18:40:14 Constantin Berzan wrote:
> > On Sunday 09 September 2007 15:59, Richard Moore wrote:
> > > On 9/9/07, Thomas Zander <zander at kde.org> wrote:
> > > > The disadvantage of this is that all code listening to that signal
> > > > need to special-case the magic number "-1".
> > > > Which is sub-optimal because it adds complexity to the 'API' where
> > > > you don't expect it.
> > >
> > > Yes, and any existing code that is using that index could be broken in
> > > hard to find ways. I'd say having a new signal is a much cleaner
> > > design.
> >
> > Having mouseDoubleClick(-1) makes sense.  If we create a separate signal
> > for the empty tab area, then mouseDoubleClick() should be renamed to
> > something like tabDoubleClick() to keep the semantics accurate and
> > obvious (unless the new signal will be called mouseDoubleClick(void) as
> > in KTabWidget). Same thing for MiddleClick if we decide that
> > middle-clicking the empty space is worth signalling.
>
> ++ for two signals and renaming the existing one to tabDoubleClick[ed]().
> The current name is, strictly speaking, wrong anyway.
> What about the freeze though?
> And what about right clicks? A too large number of signals is also
> something to avoid...
> Oh, wait. Actually tab widgets should behave the same way in every
> application as far as that makes sense (very far IMO), so why would anyone
> need all these signals? Without an answer to this the rest is premature
> optimization.

We could have a tabDoubleClicked(int) and a newTabRequest() signal. Then apps 
would catch the newTabRequest() instead of the 
emptyTabBarSpaceAndWhatNotDoubleClicked(). The intent would be pretty obvious 
and consistent in that case, if a new tab is the expected behavior when 
double-clicking the tab bar (it is, to me.)
I don't know about right/middle clicks though. Should a middle click close the 
tab?

-- 
Read my book!
http://ascending.wordpress.com/2007/08/05/diaries-of-the-last-dreamer/




More information about the kde-core-devel mailing list