From f5cf5593cb60687034a86faaa4e958428393b0a3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 22 Dec 2009 15:36:28 +0200 Subject: Changed make sis only require .make.cache if QT_SIS_TARGET is not set. The .make.cache file contents are ignored if QT_SIS_TARGET environment variable is set, so there is no point in requiring its existence in those cases. Task-number: QTBUG-4617 Reviewed-by: Janne Anttila --- qmake/generators/symbian/symmake.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 14177b5..ddda848 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -1764,7 +1764,9 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t) { t << SIS_TARGET ": " RESTORE_BUILD_TARGET << endl; QString siscommand = QString("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \ - "$(MAKE) -s -f $(MAKEFILE) %4,$(MAKE) -s -f $(MAKEFILE) %5)," \ + "$(MAKE) -s -f $(MAKEFILE) %4," \ + "$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \ + "$(MAKE) -s -f $(MAKEFILE) %5))," \ "$(MAKE) -s -f $(MAKEFILE) %6)") .arg(fixedTarget) .arg("pkg") @@ -1789,7 +1791,7 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t) t << endl; t << FAIL_SIS_NOCACHE_TARGET ":" << endl; - t << "\t$(error Project has to be build before calling 'SIS' target)" << endl; + t << "\t$(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target)" << endl; t << endl; -- cgit v0.12 From 09cd5f7324b8346f1df43a3dff61d337073a6358 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 23 Dec 2009 11:10:24 +0200 Subject: Device flickers badly when orientation change occurs Currently what happens when orientation changes is: 1. Application gets notification that status pane size has changed. 2. Qt resizes S60Data to new size, and sends resize event. 3. Application redraws itself. But style is still using incorrect screen size internally, so background brush is incorrect. Redrawing thus might showup white rect on-screen. 4. Style gets notification that orientation is changed and style then deletes existing background brush. 5. Style creates a new background brush and sends events to all toplevel widgets that style has changed 6. Widgets might draw themselves with new style background brush. What this fix changes is: 1. When application first tries to redraw itself, style notices that the background brush size does not match to active screen size. 2. Style immediately re-creates background brush 3. Since cachekey for pixmaps won't match, new background is not drawn until after background brush has been updated to application palette. 4. Due to #1 style needs to remove deletion of background brush from clearCaches to avoid deleting (and re-creating) background twice. Task-number: QTBUG-6428 Reviewed-by: Janne Koskinen --- src/gui/styles/qs60style.cpp | 1 - src/gui/styles/qs60style_s60.cpp | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index ed86f5a..01b9fa4 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -372,7 +372,6 @@ void QS60StylePrivate::clearCaches(CacheClearReason reason) case CC_LayoutChange: // when layout changes, the colors remain in cache, but graphics and fonts can change m_mappedFontsCache.clear(); - deleteBackground(); QPixmapCache::clear(); break; case CC_ThemeChange: diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 13ac301..fb9665a 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1133,9 +1133,21 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, Skin QPixmap QS60StylePrivate::backgroundTexture() { + bool createNewBackground = false; if (!m_background) { + createNewBackground = true; + } else { + //if background brush does not match screensize, re-create it + if (m_background->width() != S60->screenWidthInPixels || + m_background->height() != S60->screenHeightInPixels) { + delete m_background; + createNewBackground = true; + } + } + + if (createNewBackground) { QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, - QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), 0, SkinElementFlags()); + QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), 0, SkinElementFlags()); m_background = new QPixmap(background); } return *m_background; @@ -1143,8 +1155,7 @@ QPixmap QS60StylePrivate::backgroundTexture() QSize QS60StylePrivate::screenSize() { - const TSize screenSize = QS60Data::screenDevice()->SizeInPixels(); - return QSize(screenSize.iWidth, screenSize.iHeight); + return QSize(S60->screenWidthInPixels, S60->screenHeightInPixels); } QS60Style::QS60Style() -- cgit v0.12 From 6928ffb7533d23f0be220116a7b11d90bee72fb5 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 23 Dec 2009 13:25:51 +0200 Subject: QWidget with the window flag Qt::Dialog is not decorated as a dialog Previously style casted widgets to QDialog to see if it is able to draw dialog background theme graphic. As a fix, we now query window flag from the widget and if it is equivalent of Qt::Dialog, draw dialog background. Task-number: QTBUG-5930 Reviewed-by: Janne Koskinen --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 01b9fa4..b386c28 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -339,7 +339,7 @@ QColor QS60StylePrivate::lighterColor(const QColor &baseColor) bool QS60StylePrivate::drawsOwnThemeBackground(const QWidget *widget) { - return qobject_cast (widget); + return (widget ? (widget->windowType() == Qt::Dialog) : false); } QFont QS60StylePrivate::s60Font( -- cgit v0.12 From 7eb0abe8cd9f810905ec079e45ece1ed7fc9b9aa Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 23 Dec 2009 13:37:50 +0200 Subject: Setting background color to a QDialog doesn't work Since dialogs use their own theme graphics for background, regular method of checking the palette fails (as generic background brush is probably unchanged). Therefore to check if the dialog background is using default (=theme graphic), it needs to check the cache key value of background - so that it matches with the one in stored theme palette. Task-number: QTBUG-5898 Reviewed-by: Janne Koskinen --- src/gui/styles/qs60style.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index b386c28..e370ed0 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2160,7 +2160,10 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti || qobject_cast (widget) #endif //QT_NO_MENU ) { - if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) + //Need extra check since dialogs have their own theme background + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base()) && + option->palette.window().texture().cacheKey() == + QS60StylePrivate::m_themePalette->window().texture().cacheKey()) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_OptionsMenu, painter, option->rect, flags); else commonStyleDraws = true; -- cgit v0.12