- Removed some shading flicker

- Paints all uncovered areas when a window is shaded

svn path=/trunk/kdebase/kwin/; revision=100339
This commit is contained in:
Karol Szwed 2001-06-04 10:11:21 +00:00
parent ea93dcc2a4
commit b48692a6c4
2 changed files with 49 additions and 31 deletions

View file

@ -1,13 +1,16 @@
/* /*
Gallium-Win2k KWin client * $Id$
*
Copyright 2001 * Gallium-Win2k KWin client
Karol Szwed <karlmail@usa.net> *
http://gallium.n3.net/ * Copyright 2001
* Karol Szwed <gallium@kde.org>
Based on the default KWin client. * http://gallium.n3.net/
*
Major code cleanups, bug fixes and updates to support toolwindows 3/2001 - KS * Based on the default KWin client.
*
* Updated to support toolwindows 3/2001 (KS)
*
*/ */
#include "win2k.h" #include "win2k.h"
@ -366,6 +369,9 @@ GalliumClient::GalliumClient( Workspace *ws, WId w, QWidget *parent,
g->setResizeMode(QLayout::FreeResize); g->setResizeMode(QLayout::FreeResize);
g->addRowSpacing(0, 4); // Top grab bar g->addRowSpacing(0, 4); // Top grab bar
g->addWidget(windowWrapper(), 3, 1); 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->setRowStretch(3, 10); // Wrapped window
g->addRowSpacing(4, 4); // bottom handles g->addRowSpacing(4, 4); // bottom handles
g->addRowSpacing(2, 1); // Line below title bar g->addRowSpacing(2, 1); // Line below title bar
@ -523,6 +529,8 @@ void GalliumClient::paintEvent( QPaintEvent* )
// Draw line under title bar // Draw line under title bar
p.drawLine( x + 4, y + titleHeight + 4, x2 - 4, y + titleHeight + 4 ); 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 // Fill out the border edges
p.drawRect( x+2, y+2, w-4, h-4 ); 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. // KS - move the menu left by 3 pixels, and down 2 pixels.
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3, QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3,
button[BtnMenu]->rect().bottomLeft().y()+2 ); button[BtnMenu]->rect().bottomLeft().y()+2 );
workspace()->clientPopup(this)-> workspace()->clientPopup(this)->popup(
popup(button[BtnMenu]->mapToGlobal( menupoint )); button[BtnMenu]->mapToGlobal( menupoint ));
} }
else { else {
closeWindow(); closeWindow();
@ -737,15 +745,18 @@ extern "C"
{ {
return(new GalliumClient(ws, w)); return(new GalliumClient(ws, w));
} }
void init() void init()
{ {
create_pixmaps(); create_pixmaps();
} }
void reset() void reset()
{ {
delete_pixmaps(); delete_pixmaps();
create_pixmaps(); create_pixmaps();
} }
void deinit() void deinit()
{ {
delete_pixmaps(); delete_pixmaps();

View file

@ -1,13 +1,16 @@
/* /*
Gallium-Win2k KWin client * $Id$
*
Copyright 2001 * Gallium-Win2k KWin client
Karol Szwed <karlmail@usa.net> *
http://gallium.n3.net/ * Copyright 2001
* Karol Szwed <gallium@kde.org>
Based on the default KWin client. * http://gallium.n3.net/
*
Major code cleanups, bug fixes and updates to support toolwindows 3/2001 - KS * Based on the default KWin client.
*
* Updated to support toolwindows 3/2001 (KS)
*
*/ */
#ifndef __KDEGALLIUM_WIN2K_H #ifndef __KDEGALLIUM_WIN2K_H
@ -27,7 +30,8 @@ class GalliumButton : public QButton
{ {
public: 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 ); bool menuButton=false, bool isMini=false );
void setBitmap(const unsigned char *bitmap); void setBitmap(const unsigned char *bitmap);
void setPixmap(const QPixmap &p); void setPixmap(const QPixmap &p);
@ -69,10 +73,9 @@ class GalliumClient : public KWinInternal::Client
Q_OBJECT Q_OBJECT
public: public:
enum Buttons{ BtnHelp=0, BtnMax, BtnIconify, BtnClose, BtnMenu, BtnCount }; GalliumClient( Workspace *ws, WId w, QWidget *parent=0,
GalliumClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 ); const char *name=0 );
~GalliumClient() {;} ~GalliumClient() {;}
int titleHeight;
protected: protected:
void resizeEvent( QResizeEvent* ); void resizeEvent( QResizeEvent* );
@ -92,8 +95,12 @@ protected slots:
void menuButtonPressed(); void menuButtonPressed();
private: private:
enum Buttons{ BtnHelp=0, BtnMax, BtnIconify, BtnClose,
BtnMenu, BtnCount };
GalliumButton* button[ GalliumClient::BtnCount ]; GalliumButton* button[ GalliumClient::BtnCount ];
int lastButtonWidth; int lastButtonWidth;
int titleHeight;
QSpacerItem* titlebar; QSpacerItem* titlebar;
bool hiddenItems; bool hiddenItems;
QHBoxLayout* hb; QHBoxLayout* hb;