summaryrefslogtreecommitdiff
path: root/noncore/decorations/flat/flat.cpp
Side-by-side diff
Diffstat (limited to 'noncore/decorations/flat/flat.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/decorations/flat/flat.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/decorations/flat/flat.cpp b/noncore/decorations/flat/flat.cpp
index b6a81a3..a2f12be 100644
--- a/noncore/decorations/flat/flat.cpp
+++ b/noncore/decorations/flat/flat.cpp
@@ -179,49 +179,49 @@ static const char * maximize_xpm[] = {
" +++++ +++++ ",
" ++++++++++++ ",
" ++++++++ ",
" ",
" "};
static QImage scaleButton( const QImage &img, int height )
{
if ( img.height() != height ) {
return img.smoothScale( img.width()*height/img.height(), height );
} else {
return img;
}
}
static void colorize( QImage &img, const QColor &c, bool rev )
{
for ( int i = 0; i < img.numColors(); i++ ) {
bool sc = (img.color(i) & 0xff000000);
if ( rev ) sc = !sc;
img.setColor(i, sc ? c.rgb() : 0x00000000 );
}
}
-FlatDecoration::FlatDecoration() : ref(0), buttonCache(16)
+FlatDecoration::FlatDecoration() : buttonCache(16)
{
buttonCache.setAutoDelete(TRUE);
}
FlatDecoration::~FlatDecoration()
{
}
int FlatDecoration::metric( Metric m, const WindowData *wd ) const
{
switch ( m ) {
case TopBorder:
return 1;
break;
case LeftBorder:
case RightBorder:
return 2;
case BottomBorder:
return 4;
case TitleHeight:
if ( QApplication::desktop()->height() > 320 )
return 20;
else
return 18;
@@ -326,35 +326,37 @@ void FlatDecoration::drawButton( Button b, QPainter *p, const WindowData *wd, in
}
QRegion FlatDecoration::mask( const WindowData *wd ) const
{
return WindowDecorationInterface::mask( wd );
}
QString FlatDecoration::name() const
{
return qApp->translate( "Decoration", "Flat" );
}
QPixmap FlatDecoration::icon() const
{
return QPixmap();
}
QRESULT FlatDecoration::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
{
*iface = 0;
if ( uuid == IID_QUnknown )
*iface = this;
else if ( uuid == IID_WindowDecoration )
*iface = this;
+ else
+ return QS_FALSE;
if ( *iface )
(*iface)->addRef();
return QS_OK;
}
Q_EXPORT_INTERFACE()
{
Q_CREATE_INSTANCE( FlatDecoration )
}