kwin_iii is being merged back to HEAD

Lubos Lunak l.lunak at suse.cz
Fri Sep 19 12:32:28 BST 2003


On Thursday 18 of September 2003 14:37, Benoit Walter wrote:
> Hi Lubos,
>
> I had a look at your kwin code and am particularly interested by the
> possibility to preview windows decorations. I am writing a simple theme kcm
> and I would like to preview at the same time the window decoration, the
> style and the color scheme.
> Problem is that the contents of the previewed window is for the moment
> implemented in the clients (Keramik, ModernSys, ...). I am not sure that it
> really makes sense to do this, first because it needs extra code for each
> decoration, but also because there is no way to change it.

 The central widget is not shown at all when used with KWin. KWin positions 
the real contents window above the decoration at the proper position. Using 
the central widget for some kind of preview information was initially just a 
hack, and isPreview() was added in case some styles would try to do a lot of 
fancy things with the preview. The original intention was that is doesn't 
matter at all what's in the centre of the decoration, I was just lazy to do 
the positioning of the "contents" widget in the kcm preview.

> I think it is the responsability of the application which shows the preview
> to add the contents of the previewed window, what about changing :
>
>   if( isPreview())
>     g->addWidget( new QLabel( i18n( "..." ), widget()), 1, 1 );
>   else
>     g->addWidget( new QWidget( widget()), 1, 1 );
>
> into:
>
>   QWidget* w = new QWidget( widget() );
>   setPreviewWidget( w );
>   g->addWidget( w, 1, 1 );
>
> and add in KDecoration :
>   void setPreviewWidget( QWidget* );
>   const QWidget* previewWidget() const;
>
> This would make it possible for an application to create a widget whose
> parent is KDecoration::previewWidget() in order to set the contents of the
> previewed windows.
>
> What do you think of it?

 I think it would be simpler to have KDecoration::createCentralWidget() which 
would let the preview kcm (or whoever) create the central widget itself, and 
if it returns NULL, the style can do its fancy preview for the kwin kcm. Will 
you write the patch?

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/





More information about the kde-core-devel mailing list