fixed min/max handling, handle palette changes properly
svn path=/trunk/kdebase/kwin/; revision=35018icc-effect-5.14.5
parent
1f00484d60
commit
bad93649e3
22
client.cpp
22
client.cpp
|
@ -341,6 +341,7 @@ void Client::manage( bool isMapped )
|
|||
// geom.setSize( geom.size().boundedTo( QSize(xSizeHint.max_width, xSizeHint.max_height ) ) );
|
||||
}
|
||||
|
||||
windowWrapper()->resize( geom.size() );
|
||||
// the clever activate() trick is necessary
|
||||
layout()->activate();
|
||||
// resize( geom.width() + width() - windowWrapper()->width(),
|
||||
|
@ -351,7 +352,7 @@ void Client::manage( bool isMapped )
|
|||
move( geom.x(), geom.y() );
|
||||
gravitate( FALSE );
|
||||
|
||||
if ( !placementDone ) {
|
||||
if ( !placementDone && !transient_for ) {
|
||||
workspace()->doPlacement( this );
|
||||
placementDone = TRUE;
|
||||
}
|
||||
|
@ -708,6 +709,13 @@ QSize Client::sizeForWindowSize( const QSize& wsize, bool ignore_height) const
|
|||
}
|
||||
}
|
||||
|
||||
if (xSizeHint.flags & PMinSize) {
|
||||
w = QMAX( xSizeHint.min_width, w );
|
||||
}
|
||||
if (xSizeHint.flags & PMaxSize) {
|
||||
w = QMIN( xSizeHint.max_width, w );
|
||||
}
|
||||
|
||||
int ww = wwrap->width();
|
||||
int wh = 0;
|
||||
if ( !wwrap->testWState( WState_ForceHide ) )
|
||||
|
@ -716,10 +724,12 @@ QSize Client::sizeForWindowSize( const QSize& wsize, bool ignore_height) const
|
|||
if ( ignore_height && wsize.height() == 0 )
|
||||
h = 0;
|
||||
|
||||
return QSize( QMIN( QMAX( width() - ww + w, minimumWidth() ),
|
||||
maximumWidth() ),
|
||||
ignore_height? height()-wh+h : (QMIN( QMAX( height() - wh + h, minimumHeight() ),
|
||||
maximumHeight() ) ) );
|
||||
return QSize( width() - ww + w, height()-wh+h );
|
||||
|
||||
// return QSize( QMIN( QMAX( width() - ww + w, minimumWidth() ),
|
||||
// maximumWidth() ),
|
||||
// ignore_height? height()-wh+h : (QMIN( QMAX( height() - wh + h, minimumHeight() ),
|
||||
// maximumHeight() ) ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1481,7 +1491,7 @@ void Client::setMask( const QRegion & reg)
|
|||
|
||||
|
||||
|
||||
NoBorderClient::NoBorderClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 )
|
||||
NoBorderClient::NoBorderClient( Workspace *ws, WId w, QWidget *parent, const char *name )
|
||||
: Client( ws, w, parent, name )
|
||||
{
|
||||
QHBoxLayout* h = new QHBoxLayout( this );
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#include "options.h"
|
||||
#include <qpalette.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qapplication.h>
|
||||
#include <kapp.h>
|
||||
#include <kconfig.h>
|
||||
#include <kglobal.h>
|
||||
|
||||
Options::Options()
|
||||
: QObject( 0, 0)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i < KWINCOLORS*2; ++i)
|
||||
|
@ -16,6 +17,8 @@ Options::Options()
|
|||
placement = Smart;
|
||||
animate_shade = true;
|
||||
anim_steps = 100;
|
||||
|
||||
connect( kapp, SIGNAL( appearanceChanged() ), this, SLOT(reload() ) );
|
||||
}
|
||||
|
||||
Options::~Options(){
|
||||
|
|
13
options.h
13
options.h
|
@ -1,15 +1,21 @@
|
|||
#ifndef OPTIONS_H
|
||||
#define OPTIONS_H
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qfont.h>
|
||||
#include <qpalette.h>
|
||||
|
||||
// increment this when you add a color type (mosfet)
|
||||
#define KWINCOLORS 8
|
||||
|
||||
class Options {
|
||||
class Options : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
Options();
|
||||
~Options();
|
||||
|
||||
|
||||
/*!
|
||||
Different focus policies:
|
||||
<ul>
|
||||
|
@ -84,11 +90,10 @@ public:
|
|||
* Return the number of animation steps (would this be general?)
|
||||
*/
|
||||
const int animSteps() { return anim_steps; };
|
||||
// When restarting is implemented this should get called (mosfet).
|
||||
|
||||
public slots:
|
||||
void reload();
|
||||
|
||||
Options();
|
||||
~Options();
|
||||
protected:
|
||||
QFont activeFont, inactiveFont;
|
||||
QColor colors[KWINCOLORS*2];
|
||||
|
|
|
@ -306,7 +306,7 @@ void StdClient::stickyChange( bool s)
|
|||
button[1]->setIconSet( s?*pindown_pix:*pinup_pix );
|
||||
}
|
||||
|
||||
void StdClient::paintEvent( QPaintEvent* e)
|
||||
void StdClient::paintEvent( QPaintEvent* )
|
||||
{
|
||||
QPainter p( this );
|
||||
QRect t = titlebar->geometry();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
const bool options_traverse_all = FALSE; // TODO
|
||||
|
||||
TabBox::TabBox( Workspace *ws, const char *name=0 )
|
||||
TabBox::TabBox( Workspace *ws, const char *name )
|
||||
: QWidget( 0, name, WStyle_Customize | WStyle_NoBorder )
|
||||
{
|
||||
wspace = ws;
|
||||
|
|
Loading…
Reference in New Issue