- 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:
parent
ea93dcc2a4
commit
b48692a6c4
2 changed files with 49 additions and 31 deletions
|
@ -1,14 +1,17 @@
|
|||
/*
|
||||
Gallium-Win2k KWin client
|
||||
|
||||
Copyright 2001
|
||||
Karol Szwed <karlmail@usa.net>
|
||||
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 <gallium@kde.org>
|
||||
* http://gallium.n3.net/
|
||||
*
|
||||
* Based on the default KWin client.
|
||||
*
|
||||
* Updated to support toolwindows 3/2001 (KS)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "win2k.h"
|
||||
#include <qlayout.h>
|
||||
|
@ -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();
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
/*
|
||||
Gallium-Win2k KWin client
|
||||
|
||||
Copyright 2001
|
||||
Karol Szwed <karlmail@usa.net>
|
||||
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 <gallium@kde.org>
|
||||
* 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);
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue