a33f4313ab
clients by adding an unnecessary 'enable-bidi' checkbox which was never agreed upon on the kwin mailing list. The use of --reverse is sufficient without needing this checkbox. Please discuss largish patches like these first, especially during a feature freeze! (Everyone also seems to forget the kwin-styles in kdeartwork) - Make clients look the same with --reverse instead of the broken state they were in previously. If the button ordering is not to your liking in reverse mode, just change the button positions. (Or send patches for those clients that have not got these features yet). - Clean up popupMenu handling somewhat. - Remove a global static object in keramik. svn path=/trunk/kdebase/kwin/; revision=174079
100 lines
2 KiB
C++
100 lines
2 KiB
C++
/*
|
|
* $Id$
|
|
*
|
|
* Redmond KWin client
|
|
*
|
|
* Copyright 2001
|
|
* Karol Szwed <gallium@kde.org>
|
|
* http://gallium.n3.net/
|
|
*
|
|
* Based on the default KWin client.
|
|
*
|
|
* Updated to support toolwindows 3/2001 (KS)
|
|
*
|
|
*/
|
|
|
|
#ifndef __KDE_REDMOND_H
|
|
#define __KDE_REDMOND_H
|
|
|
|
#include <qvariant.h>
|
|
#include <qbutton.h>
|
|
#include <qbitmap.h>
|
|
#include <kpixmap.h>
|
|
#include "../../client.h"
|
|
#include "../../kwinbutton.h"
|
|
class QLabel;
|
|
class QSpacerItem;
|
|
class QBoxLayout;
|
|
|
|
namespace KWinInternal {
|
|
|
|
class GalliumButton : public KWinInternal::KWinButton
|
|
{
|
|
public:
|
|
GalliumButton(Client *parent=0, const char *name=0,
|
|
const unsigned char *bitmap=NULL,
|
|
bool menuButton=false, bool isMini=false,
|
|
const QString& tip=NULL);
|
|
void setBitmap(const unsigned char *bitmap);
|
|
void setPixmap(const QPixmap &p);
|
|
void reset();
|
|
|
|
QSize sizeHint() const;
|
|
int last_button;
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent* e);
|
|
void mouseReleaseEvent(QMouseEvent* e);
|
|
virtual void drawButton(QPainter *p);
|
|
void drawButtonLabel(QPainter *){;}
|
|
|
|
QBitmap deco;
|
|
QPixmap pix;
|
|
bool menuBtn;
|
|
bool miniBtn;
|
|
Client* client;
|
|
};
|
|
|
|
|
|
class GalliumClient : public KWinInternal::Client
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
GalliumClient( Workspace *ws, WId w, QWidget *parent=0,
|
|
const char *name=0 );
|
|
~GalliumClient() {;}
|
|
|
|
protected:
|
|
void resizeEvent( QResizeEvent* );
|
|
void paintEvent( QPaintEvent* );
|
|
void showEvent( QShowEvent* );
|
|
void mouseDoubleClickEvent( QMouseEvent * );
|
|
void captionChange( const QString& name );
|
|
void maximizeChange(bool m);
|
|
void activeChange(bool);
|
|
void iconChange();
|
|
void calcHiddenButtons();
|
|
|
|
protected slots:
|
|
void slotReset();
|
|
void slotMaximize();
|
|
void menuButtonPressed();
|
|
|
|
private:
|
|
enum Buttons{ BtnHelp=0, BtnMax, BtnIconify, BtnClose,
|
|
BtnMenu, BtnCount };
|
|
|
|
GalliumButton* button[ GalliumClient::BtnCount ];
|
|
int lastButtonWidth;
|
|
int titleHeight;
|
|
QSpacerItem* titlebar;
|
|
bool hiddenItems;
|
|
QBoxLayout* hb;
|
|
bool smallButtons;
|
|
};
|
|
|
|
};
|
|
|
|
#endif
|
|
// vim: ts=4
|