kwin_iii is being merged back to HEAD

Benoit Walter b.walter at free.fr
Thu Sep 18 13:37:55 BST 2003


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.
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?

Regards,
Benoit.




More information about the kde-core-devel mailing list