kwin/stdclient.h
Daniel M. Duley 49aba34b01 My weekly big ass style commit ;-) This implements what I discussed earlier
today.

First: All decoration pixmaps are now regenerated when the palette color scheme
changes. There is no longer any need to apply color schemes *before* switching
styles or reload the plugin. The schemes can change any time and be handled
correctly by styles that generate their pixmaps based on the color scheme.

Second: The color scheme has been extended to allow separate entries for
different visual styles. For example there are now entries for both titlebar
rectangle fills like those used in the standard KDE style and KStep vs.
titlebar grooves like those used in System. The same thing applies to
foreground colors for buttons that follow the button background settings like
KStep and System vs. those that don't like the standard style.

Right now none of the color schemes have the new entries so defaults are
calculated, usually by judging the intensity of what the decoration is
drawn on and contrasted with that. To check things out look at the standard,
KStep, and System styles under color schemes like default, CDE, and Digital
CDE.

The Be style is not updated because I have a cooler one on my HD ;-)

I hope this makes David happier <grin> :)

svn path=/trunk/kdebase/kwin/; revision=39126
2000-01-23 23:33:29 +00:00

83 lines
1.7 KiB
C++

#ifndef STDCLIENT_H
#define STDCLIENT_H
#include "client.h"
#include <qtoolbutton.h>
class QLabel;
class QSpacerItem;
class StdClient : public Client
{
Q_OBJECT
public:
StdClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
~StdClient();
protected:
void resizeEvent( QResizeEvent* );
void paintEvent( QPaintEvent* );
void mouseDoubleClickEvent( QMouseEvent * );
void init();
void captionChange( const QString& name );
void iconChange();
void maximizeChange( bool );
void stickyChange( bool );
void activeChange( bool );
private slots:
void menuButtonPressed();
void maxButtonClicked( int );
void slotReset();
private:
QToolButton* button[7];
QSpacerItem* titlebar;
};
/*
Like QToolButton, but provides a clicked(int) signals that
has the last pressed mouse button as argument
*/
class ThreeButtonButton: public QToolButton
{
Q_OBJECT
public:
ThreeButtonButton ( QWidget *parent = 0, const char* name = 0)
: QToolButton( parent, name )
{
connect( this, SIGNAL( clicked() ), this, SLOT( handleClicked() ) );
}
~ThreeButtonButton ()
{}
signals:
void clicked( int );
protected:
void mousePressEvent( QMouseEvent* e )
{
last_button = e->button();
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
QToolButton::mousePressEvent( &me );
}
void mouseReleaseEvent( QMouseEvent* e )
{
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
QToolButton::mouseReleaseEvent( &me );
}
private slots:
void handleClicked()
{
emit clicked( last_button );
}
private:
int last_button;
};
#endif