diff --git a/clients/win2k/win2k.cpp b/clients/win2k/win2k.cpp index 02a3555c58..938712c0e2 100644 --- a/clients/win2k/win2k.cpp +++ b/clients/win2k/win2k.cpp @@ -1,14 +1,17 @@ /* - Gallium-Win2k KWin client - - Copyright 2001 - Karol Szwed - http://gallium.n3.net/ - - Based on the default KWin client. - - Major code cleanups, bug fixes and updates to support toolwindows 3/2001 - KS -*/ + * $Id$ + * + * Gallium-Win2k KWin client + * + * Copyright 2001 + * Karol Szwed + * http://gallium.n3.net/ + * + * Based on the default KWin client. + * + * Updated to support toolwindows 3/2001 (KS) + * + */ #include "win2k.h" #include @@ -366,6 +369,9 @@ GalliumClient::GalliumClient( Workspace *ws, WId w, QWidget *parent, g->setResizeMode(QLayout::FreeResize); g->addRowSpacing(0, 4); // Top grab bar g->addWidget(windowWrapper(), 3, 1); + // without the next line, unshade flickers + g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, + QSizePolicy::Expanding ) ); g->setRowStretch(3, 10); // Wrapped window g->addRowSpacing(4, 4); // bottom handles g->addRowSpacing(2, 1); // Line below title bar @@ -523,6 +529,8 @@ void GalliumClient::paintEvent( QPaintEvent* ) // Draw line under title bar p.drawLine( x + 4, y + titleHeight + 4, x2 - 4, y + titleHeight + 4 ); + // Draw a hidden line that appears during shading + p.drawLine( x + 4, y2 - 4, x2 - 4, y2 - 4 ); // Fill out the border edges p.drawRect( x+2, y+2, w-4, h-4 ); @@ -721,8 +729,8 @@ void GalliumClient::menuButtonPressed() // KS - move the menu left by 3 pixels, and down 2 pixels. QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3, button[BtnMenu]->rect().bottomLeft().y()+2 ); - workspace()->clientPopup(this)-> - popup(button[BtnMenu]->mapToGlobal( menupoint )); + workspace()->clientPopup(this)->popup( + button[BtnMenu]->mapToGlobal( menupoint )); } else { closeWindow(); @@ -737,15 +745,18 @@ extern "C" { return(new GalliumClient(ws, w)); } + void init() { create_pixmaps(); } + void reset() { delete_pixmaps(); create_pixmaps(); } + void deinit() { delete_pixmaps(); diff --git a/clients/win2k/win2k.h b/clients/win2k/win2k.h index eb4f1df497..9dfa5a10d6 100644 --- a/clients/win2k/win2k.h +++ b/clients/win2k/win2k.h @@ -1,14 +1,17 @@ /* - Gallium-Win2k KWin client - - Copyright 2001 - Karol Szwed - http://gallium.n3.net/ - - Based on the default KWin client. - - Major code cleanups, bug fixes and updates to support toolwindows 3/2001 - KS -*/ + * $Id$ + * + * Gallium-Win2k KWin client + * + * Copyright 2001 + * Karol Szwed + * http://gallium.n3.net/ + * + * Based on the default KWin client. + * + * Updated to support toolwindows 3/2001 (KS) + * + */ #ifndef __KDEGALLIUM_WIN2K_H #define __KDEGALLIUM_WIN2K_H @@ -27,7 +30,8 @@ class GalliumButton : public QButton { public: - GalliumButton(Client *parent=0, const char *name=0, const unsigned char *bitmap=NULL, + GalliumButton(Client *parent=0, const char *name=0, + const unsigned char *bitmap=NULL, bool menuButton=false, bool isMini=false ); void setBitmap(const unsigned char *bitmap); void setPixmap(const QPixmap &p); @@ -39,18 +43,18 @@ public: protected: void mousePressEvent( QMouseEvent* e ) { - last_button = e->button(); + last_button = e->button(); QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); - QButton::mousePressEvent( &me ); + QButton::mousePressEvent( &me ); } void mouseReleaseEvent( QMouseEvent* e ) { - last_button = e->button(); - QMouseEvent me ( e->type(), e->pos(), e->globalPos(), + last_button = e->button(); + QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); - QButton::mouseReleaseEvent( &me ); + QButton::mouseReleaseEvent( &me ); } virtual void drawButton(QPainter *p); @@ -69,10 +73,9 @@ class GalliumClient : public KWinInternal::Client Q_OBJECT public: - enum Buttons{ BtnHelp=0, BtnMax, BtnIconify, BtnClose, BtnMenu, BtnCount }; - GalliumClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 ); + GalliumClient( Workspace *ws, WId w, QWidget *parent=0, + const char *name=0 ); ~GalliumClient() {;} - int titleHeight; protected: void resizeEvent( QResizeEvent* ); @@ -92,8 +95,12 @@ protected slots: void menuButtonPressed(); private: + enum Buttons{ BtnHelp=0, BtnMax, BtnIconify, BtnClose, + BtnMenu, BtnCount }; + GalliumButton* button[ GalliumClient::BtnCount ]; int lastButtonWidth; + int titleHeight; QSpacerItem* titlebar; bool hiddenItems; QHBoxLayout* hb;