kwin/clients/kwmtheme/kwmthemeclient.h
Karol Szwed 1e7469d54e Fixed several bugs:
- When titlebutton pixmaps totally cover a toolbutton, they are
	  moved by a (1,1) offset when clicked so users have a visual prompt
	  that they are attempting to click the button. (i.e. for MGBreizh theme)
	- Titlebar buttons follow isMinimizable() and isMaximizable() and
	  are hidden when not required
	- Sticky button is drawn correctly now
	- Made shading animation nice and smooth

svn path=/trunk/kdebase/kwin/; revision=98699
2001-05-25 11:17:29 +00:00

58 lines
1.3 KiB
C++

#ifndef __KWMTHEMECLIENT_H
#define __KWMTHEMECLIENT_H
#include <qbutton.h>
#include <qtoolbutton.h>
#include <kpixmap.h>
#include "../../client.h"
class QLabel;
class QSpacerItem;
class QGridLayout;
namespace KWinInternal{
// QToolButton uses a 1 pixel border :P
class MyButton : public QToolButton
{
public:
MyButton(QWidget *parent=0, const char *name=0)
: QToolButton(parent, name){setAutoRaise(true);}
protected:
void drawButtonLabel(QPainter *p);
};
class KWMThemeClient : public KWinInternal::Client
{
Q_OBJECT
public:
KWMThemeClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
~KWMThemeClient(){;}
protected:
void doShape();
void drawTitle(QPainter &p);
void resizeEvent( QResizeEvent* );
void paintEvent( QPaintEvent* );
void showEvent( QShowEvent* );
void windowWrapperShowEvent( QShowEvent* );
void mouseDoubleClickEvent( QMouseEvent * );
void init();
void captionChange( const QString& name );
void stickyChange(bool on);
void maximizeChange(bool m);
void iconChange();
MousePosition mousePosition(const QPoint &) const;
protected slots:
void slotReset();
void menuButtonPressed();
private:
QPixmap buffer;
KPixmap *aGradient, *iGradient;
MyButton *maxBtn, *stickyBtn, *mnuBtn;
QSpacerItem *titlebar;
QGridLayout* layout;
};
};
#endif