diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qdialog.cpp | 16 | ||||
-rw-r--r-- | src/gui/embedded/qscreen_qws.cpp | 21 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 19 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 8 | ||||
-rw-r--r-- | src/gui/styles/qgtkstyle.cpp | 20 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 12 | ||||
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 1 |
8 files changed, 79 insertions, 19 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 3650051..9ff2ad8 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -265,6 +265,14 @@ QDialog::QDialog(QWidget *parent, Qt::WindowFlags f) if (!qt_wince_is_smartphone()) setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint)); #endif + +#ifdef Q_WS_S60 + if (S60->avkonComponentsSupportTransparency) { + bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground + setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute + } +#endif } #ifdef QT3_SUPPORT @@ -294,6 +302,14 @@ QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f) if (!qt_wince_is_smartphone()) setWindowFlags(windowFlags() | Qt::WindowOkButtonHint | QFlag(qt_wince_is_mobile() ? 0 : Qt::WindowCancelButtonHint)); #endif + +#ifdef Q_WS_S60 + if (S60->avkonComponentsSupportTransparency) { + bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground + setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute + } +#endif } /*! diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp index 8eb8123..65a3fb5 100644 --- a/src/gui/embedded/qscreen_qws.cpp +++ b/src/gui/embedded/qscreen_qws.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "qplatformdefs.h" #include "qscreen_qws.h" #include "qcolormap.h" @@ -3223,13 +3224,13 @@ QScreen * qt_probe_bus() return qt_dodriver("unaccel.so",0,0); } - DIR * dirptr=opendir("/proc/bus/pci"); + QT_DIR *dirptr = QT_OPENDIR("/proc/bus/pci"); if(!dirptr) return qt_dodriver("unaccel.so",0,0); - DIR * dirptr2; - dirent * cards; + QT_DIR * dirptr2; + QT_DIRENT *cards; - dirent * busses=readdir(dirptr); + QT_DIRENT *busses = QT_READDIR(dirptr); while(busses) { if(busses->d_name[0]!='.') { @@ -3237,9 +3238,9 @@ QScreen * qt_probe_bus() strcpy(buf,"/proc/bus/pci/"); qstrcpy(buf+14,busses->d_name); int p=strlen(buf); - dirptr2=opendir(buf); + dirptr2 = QT_OPENDIR(buf); if(dirptr2) { - cards=readdir(dirptr2); + cards = QT_READDIR(dirptr2); while(cards) { if(cards->d_name[0]!='.') { buf[p]='/'; @@ -3248,14 +3249,14 @@ QScreen * qt_probe_bus() if(ret) return ret; } - cards=readdir(dirptr2); + cards = QT_READDIR(dirptr2); } - closedir(dirptr2); + QT_CLOSEDIR(dirptr2); } } - busses=readdir(dirptr); + busses = QT_READDIR(dirptr); } - closedir(dirptr); + QT_CLOSEDIR(dirptr); return qt_dodriver("unaccel.so",0,0); } diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index a51f5b8..20b8030 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -71,6 +71,7 @@ # include <private/qcoefepinputcontext_p.h> # endif # include <private/qs60mainapplication_p.h> +# include <centralrepository.h> #endif #include "private/qstylesheetstyle_p.h" @@ -1204,6 +1205,24 @@ void qt_init(QApplicationPrivate * /* priv */, int) S60->virtualMouseRequired = false; } + S60->avkonComponentsSupportTransparency = false; + +#ifdef Q_WS_S60 + TUid KCRUidAvkon = { 0x101F876E }; + TUint32 KAknAvkonTransparencyEnabled = 0x0000000D; + + CRepository* repository = 0; + TRAP(err, repository = CRepository::NewL(KCRUidAvkon)); + + if(err == KErrNone) { + TInt value = 0; + err = repository->Get(KAknAvkonTransparencyEnabled, value); + if(err == KErrNone) { + S60->avkonComponentsSupportTransparency = (value==1) ? true : false; + } + } +#endif + if (touch) { QApplicationPrivate::navigationMode = Qt::NavigationModeNone; } else { diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index b417065..1163055 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -121,6 +121,7 @@ public: int virtualMouseRequired : 1; int qtOwnsS60Environment : 1; int supportsPremultipliedAlpha : 1; + int avkonComponentsSupportTransparency : 1; QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type static inline void updateScreenSize(); static inline RWsSession& wsSession(); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 8804742..eed76e5 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -2026,6 +2026,14 @@ void QWidgetPrivate::updateIsOpaque() } #endif +#ifdef Q_WS_S60 + if (q->windowType() == Qt::Dialog && q->testAttribute(Qt::WA_TranslucentBackground) + && S60->avkonComponentsSupportTransparency) { + setOpaque(false); + return; + } +#endif + if (q->testAttribute(Qt::WA_OpaquePaintEvent) || q->testAttribute(Qt::WA_PaintOnScreen)) { setOpaque(true); return; diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 211f4ce..b5f052b 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -1106,8 +1106,14 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, // ### Note: Ubuntulooks breaks when the proper widget is passed // Murrine engine requires a widget not to get RGBA check - warnings GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton")); - gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, QLS("radiobutton")); - + QString key(QLS("radiobutton")); + if (option->state & State_HasFocus) { // Themes such as Nodoka check this flag + key += QLatin1Char('f'); + GTK_WIDGET_SET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS); + } + gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, key); + if (option->state & State_HasFocus) + GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS); } break; @@ -1128,6 +1134,11 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, int spacing; GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton")); + QString key(QLS("checkbutton")); + if (option->state & State_HasFocus) { // Themes such as Nodoka checks this flag + key += QLatin1Char('f'); + GTK_WIDGET_SET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS); + } // Some styles such as aero-clone assume they can paint in the spacing area gtkPainter.setClipRect(option->rect); @@ -1137,7 +1148,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, QRect checkRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing); gtkPainter.paintCheckbox(gtkCheckButton, checkRect, state, shadow, gtkCheckButton->style, - QLS("checkbutton")); + key); + if (option->state & State_HasFocus) + GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS); + } break; diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index ca0b8c7..100303e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -3056,11 +3056,13 @@ bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QBrush const QPaintDevice *target = painter->device(); if (target->devType() == QInternal::Widget) { const QWidget *widget = static_cast<const QWidget *>(target); - const QVector<QRect> &rects = rgn.rects(); - for (int i = 0; i < rects.size(); ++i) { - const QRect rect(rects.at(i)); - painter->drawPixmap(rect.topLeft(), backgroundTexture, - rect.translated(qt_s60_fill_background_offset(widget))); + if (!widget->testAttribute(Qt::WA_TranslucentBackground)) { + const QVector<QRect> &rects = rgn.rects(); + for (int i = 0; i < rects.size(); ++i) { + const QRect rect(rects.at(i)); + painter->drawPixmap(rect.topLeft(), backgroundTexture, + rect.translated(qt_s60_fill_background_offset(widget))); + } } } return true; diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 12a1544..9d2dc66 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -731,7 +731,6 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(QS60StylePrivate::SkinFr MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); QPixmap result; -// QS60WindowSurface::unlockBitmapHeap(); static const TDisplayMode displayMode = S60->supportsPremultipliedAlpha ? Q_SYMBIAN_ECOLOR16MAP : EColor16MA; static const TInt drawParam = S60->supportsPremultipliedAlpha ? KAknsDrawParamDefault : KAknsDrawParamNoClearUnderImage|KAknsDrawParamRGBOnly; |