summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpedecoration_qws.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp
index 222d906..c2eb751 100644
--- a/library/qpedecoration_qws.cpp
+++ b/library/qpedecoration_qws.cpp
@@ -39,9 +39,9 @@
#include <qsignal.h>
#include <stdlib.h>
-extern QRect qt_maxWindowRect;
+extern QRect qt_maxWindowRect;
#define WHATSTHIS_MODE
#ifndef QT_NO_QWS_QPE_WM_STYLE
@@ -106,9 +106,10 @@ public:
};
static QImage scaleButton( const QImage &img, int height )
{
- if ( img.height() != height ) {
+ qWarning("Height %d %d", height, img.height() );
+ if ( img.height()!=0 && img.height() != height ) {
return img.smoothScale( img.width()*height/img.height(), height );
} else {
return img;
}
@@ -646,27 +647,27 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
int b = wdiface->metric(WindowDecorationInterface::TopBorder,&wd);
region = m & QRect( br.left()+grab, br.top(),
br.width()-2*grab, b );
}
- break;
+ break;
case Left:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
int b = wdiface->metric(WindowDecorationInterface::LeftBorder,&wd);
region = m & QRect( br.left(), br.top()+grab,
b, br.height()-2*grab );
}
- break;
+ break;
case Right:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
int b = wdiface->metric(WindowDecorationInterface::RightBorder,&wd);
region = m & QRect( rect.right(), br.top()+grab,
b, br.height()-2*grab );
}
- break;
+ break;
case Bottom:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
@@ -684,9 +685,9 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
QRegion crgn( br.left(), br.top(), grab, tb );
crgn |= QRect( br.left(), br.top(), lb, grab );
region = m & crgn;
}
- break;
+ break;
case TopRight:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
@@ -702,9 +703,9 @@ QRegion QPEDecoration::region(const QWidget *widget, const QRect &rect, QWSDecor
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
region = m & QRect( br.left(), br.bottom()-grab, grab, grab );
}
- break;
+ break;
case BottomRight:
if ( !widget->isMaximized() ) {
QRegion m = wdiface->mask(&wd);
QRect br = m.boundingRect();
@@ -821,13 +822,13 @@ void QPEDecoration::paintButton(QPainter *painter, const QWidget *w,
//#define QPE_DONT_SHOW_TITLEBAR
void QPEDecoration::maximize( QWidget *widget )
{
-#ifdef QPE_DONT_SHOW_TITLEBAR
+#ifdef QPE_DONT_SHOW_TITLEBAR
if ( !widget->inherits( "QDialog" ) ) {
widget->setGeometry( qt_maxWindowRect );
- } else
-#endif
+ } else
+#endif
{
QWSDecoration::maximize( widget );
}
}
@@ -852,9 +853,9 @@ void QPEDecoration::minimize( QWidget *widget )
// We use the minimize button as an "accept" button.
if ( widget->inherits( "QDialog" ) ) {
HackDialog *d = (HackDialog *)widget;
d->acceptIt();
- }
+ }
#endif
else if ( ((HackWidget *)widget)->needsOk() ) {
QSignal s;
s.connect( widget, SLOT( accept() ) );