From 6eb4a47a56914ca65d11736af5c0d758755d0291 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 12 May 2009 09:52:43 +0200 Subject: Added symbian specific ifdefs and checks so that QMenuBar doesn't return inappropriate sizehints when native menubar is used --- src/gui/widgets/qmenubar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index b6ce76b..d05323d 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -1648,6 +1648,8 @@ QSize QMenuBar::minimumSizeHint() const const bool as_gui_menubar = !d->mac_menubar; #elif defined (Q_OS_WINCE) const bool as_gui_menubar = !d->wce_menubar; +#elif defined (Q_OS_SYMBIAN) + const bool as_gui_menubar = !d->symbian_menubar; #else const bool as_gui_menubar = true; #endif @@ -1708,6 +1710,8 @@ QSize QMenuBar::sizeHint() const const bool as_gui_menubar = !d->mac_menubar; #elif defined (Q_OS_WINCE) const bool as_gui_menubar = !d->wce_menubar; +#elif defined (Q_OS_SYMBIAN) + const bool as_gui_menubar = !d->symbian_menubar; #else const bool as_gui_menubar = true; #endif @@ -1771,6 +1775,8 @@ int QMenuBar::heightForWidth(int) const const bool as_gui_menubar = !d->mac_menubar; #elif defined (Q_OS_WINCE) const bool as_gui_menubar = !d->wce_menubar; +#elif defined (Q_OS_SYMBIAN) + const bool as_gui_menubar = !d->symbian_menubar; #else const bool as_gui_menubar = true; #endif -- cgit v0.12 From 3749fcfdb5b6dcf538ceb909f1fec7971fe3a74b Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 12 May 2009 15:42:27 +0200 Subject: Fixed autoSipEnabled default value on non-WinCE platforms. --- src/gui/kernel/qapplication.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 1b6bdea..1906025 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -135,8 +135,10 @@ bool QApplicationPrivate::quitOnLastWindowClosed = true; #ifdef Q_OS_WINCE int QApplicationPrivate::autoMaximizeThreshold = -1; -#endif bool QApplicationPrivate::autoSipEnabled = false; +#else +bool QApplicationPrivate::autoSipEnabled = true; +#endif QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::Type type) : QCoreApplicationPrivate(argc, argv) @@ -1241,6 +1243,8 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis The property only has an effect on platforms which use software input panels, such as Windows CE and Symbian. + + The default is platform dependent. */ #ifdef Q_OS_WINCE -- cgit v0.12 From e4cfb0ac1320a1832cedd69495151bc817075a23 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 12 May 2009 15:43:13 +0200 Subject: Fixed the translation from S60 text format to Qt text format in FEP. This was done by making sure that the format code is called from both start and update, because S60 will often return nothing in start, but then later on return something in update. In addition, we fall back on our own format if S60 does not give us anything. Currently it seems to give us a format only when using predictive text. --- src/gui/inputmethod/qcoefepinputcontext_p.h | 1 + src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 51 ++++++++++++++++--------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index 9ce9724..50f8a12 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -65,6 +65,7 @@ private: void commitCurrentString(); void updateHints(); void applyHints(Qt::InputMethodHints hints); + void applyFormat(QList *attributes); // From MCoeFepAwareTextEditor public: diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 1ae3d79..8612e55 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -465,6 +465,37 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) CCoeEnv::Static()->InputCapabilitiesChanged(); } +void QCoeFepInputContext::applyFormat(QList *attributes) +{ + TCharFormat cFormat; + TInt numChars = 0; + TInt charPos = 0; + int oldSize = attributes->size(); + while (m_formatRetriever) { + m_formatRetriever->GetFormatOfFepInlineText(cFormat, numChars, charPos); + if (numChars <= 0) { + // This shouldn't happen according to S60 docs, but apparently does sometimes. + break; + } + attributes->append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, + charPos, + numChars, + QVariant(qt_TCharFormat2QTextCharFormat(cFormat)))); + charPos += numChars; + if (charPos >= m_preeditString.size()) { + break; + } + } + + if (attributes->size() == oldSize) { + // S60 didn't provide any format, so let's give our own instead. + attributes->append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, + 0, + m_preeditString.size(), + standardFormat(PreeditFormat))); + } +} + void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, TInt aPositionOfInsertionPointInInlineText, TBool aCursorVisibility, const MFormCustomDraw* /*aCustomDraw*/, MFepInlineTextFormatRetriever& aInlineTextFormatRetriever, @@ -485,24 +516,7 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, m_formatRetriever = &aInlineTextFormatRetriever; m_pointerHandler = &aPointerEventHandlerDuringInlineEdit; - TCharFormat cFormat; - TInt numChars = 0; - TInt charPos = 0; - while (m_formatRetriever) { - m_formatRetriever->GetFormatOfFepInlineText(cFormat, numChars, charPos); - if (numChars <= 0) { - // This shouldn't happen according to S60 docs, but apparently does sometimes. - break; - } - attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, - charPos, - numChars, - QVariant(qt_TCharFormat2QTextCharFormat(cFormat)))); - charPos += numChars; - if (charPos >= m_preeditString.size()) { - break; - } - } + applyFormat(&attributes); attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, m_inlinePosition, @@ -522,6 +536,7 @@ void QCoeFepInputContext::UpdateFepInlineTextL(const TDesC& aNewInlineText, m_inlinePosition = aPositionOfInsertionPointInInlineText; QList attributes; + applyFormat(&attributes); attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, m_inlinePosition, m_cursorVisibility, -- cgit v0.12 From cd18a843ce38b9871d506fa6f7c2114105b1487c Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 12 May 2009 16:19:30 +0200 Subject: Fixed background of preedit text. This changes the appearance on X11 and Mac, but it seems to be the way it is done in other applications. In addition it fixes S60 background of preedit text, which is supposed to be transparent. RevBy: denis --- src/gui/inputmethod/qinputcontext.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/gui/inputmethod/qinputcontext.cpp b/src/gui/inputmethod/qinputcontext.cpp index c7d156c..00a9225 100644 --- a/src/gui/inputmethod/qinputcontext.cpp +++ b/src/gui/inputmethod/qinputcontext.cpp @@ -427,13 +427,6 @@ QTextFormat QInputContext::standardFormat(StandardFormat s) const switch (s) { case QInputContext::PreeditFormat: { fmt.setUnderlineStyle(QTextCharFormat::DashUnderline); -#ifndef Q_WS_WIN - int h1, s1, v1, h2, s2, v2; - pal.color(QPalette::Base).getHsv(&h1, &s1, &v1); - pal.color(QPalette::Background).getHsv(&h2, &s2, &v2); - bg.setHsv(h1, s1, (v1 + v2) / 2); - fmt.setBackground(QBrush(bg)); -#endif break; } case QInputContext::SelectionFormat: { -- cgit v0.12 From bd92bc77c98c5d6ceea5996702fb4db9bfac3c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Tue, 12 May 2009 19:06:40 +0300 Subject: S60style: use correct theme text color for highlighted line edit texts. --- src/gui/styles/qs60style.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 0fdbf13..ee9bca8 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -617,6 +617,11 @@ void QS60Style::polish(QWidget *widget) const QFont suggestedFont = d->s60Font( QS60StyleEnums::FC_Title, widget->font().pointSizeF()); widget->setFont(suggestedFont); + } else if (qobject_cast(widget)) { + widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); + QApplication::setPalette(widgetPalette, "QLineEdit"); + } } -- cgit v0.12 From c88983acaf7034ee1ecc1f02ab3426d1e924c0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Tue, 12 May 2009 19:07:50 +0300 Subject: S60Style: Slightly better drawing code for QTreeView node indicators. --- src/gui/styles/qs60style.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index ee9bca8..24c1608 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2120,17 +2120,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif QCommonStyle::drawPrimitive(element, option, painter, widget); } else { - if (option->state & State_Children) { - QS60StyleEnums::SkinParts skinPart = - (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper; - int minDimension = qMin(option->rect.width(), option->rect.height()); - const int resizeValue = minDimension >> 1; - minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon. - QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension)); - iconRect.translate(3, 2 - resizeValue); - QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags); - } - const bool rightLine = option->state & State_Item; const bool downLine = option->state & State_Sibling; const bool upLine = option->state & (State_Open | State_Children | State_Item | State_Sibling); @@ -2152,10 +2141,26 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, (flags | QS60StylePrivate::SF_ColorSkinned)); } + + if (option->state & State_Children) { + QS60StyleEnums::SkinParts skinPart = + (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper; + int minDimension = qMin(option->rect.width(), option->rect.height()); + const int resizeValue = minDimension >> 1; + minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon. + QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension)); + int verticalMagic(0); + // magic values for positioning svg icon. + if (option->rect.width() <= option->rect.height()) + verticalMagic = 3; + iconRect.translate(3, verticalMagic - resizeValue); + iconRect.adjust(-3,5,0,0); + QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags); + } } - } - break; - + } + break; + // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases case PE_FrameLineEdit: case PE_IndicatorButtonDropDown: -- cgit v0.12 From 8262a1cf35400117293fe2dd2e866ad42478ab29 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 13 May 2009 14:34:18 +0300 Subject: Fixed pkg file parsing in patch_capabilities.pl --- bin/patch_capabilities.pl | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl index 586e7b0..d75605b 100644 --- a/bin/patch_capabilities.pl +++ b/bin/patch_capabilities.pl @@ -14,7 +14,7 @@ if (@ARGV) { # Parse the first given script argument as a ".pkg" file name. my $pkgFileName = shift(@ARGV); - + # If the specified ".pkg" file exists (and can be read), if (($pkgFileName =~ m|\.pkg$|i) && -r($pkgFileName)) { @@ -27,44 +27,44 @@ if (@ARGV) push (@capabilitiesToSet, pop(@ARGV)); } } - + # Start with no binaries listed. my @binaries = (); - + # Open the ".pkg" file. - open (PKG, "<".$pkgFileName); - + open (PKG, "<".$pkgFileName); + # Parse each line. while () { my $line = $_; - chomp ($line); - + chomp ($line); + # If the line specifies a file, parse the source and destination locations. if ($line =~ m|\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"|) { my $sourcePath = $1; my $destinationPath = $2; - + # If the given file is a binary, check the target and binary type (+ the actual filename) from its path. - if ($sourcePath =~ m:\\epoc32\\release\\([^\\]+)\\(udeb|urel)\\(\w+(\.dll|\.exe)):i) + if ($sourcePath =~ m:/epoc32/release/([^/]+)/(udeb|urel)/(\w+(\.dll|\.exe)):i) { push (@binaries, $sourcePath); } } } - + # Close the ".pkg" file. close (PKG); - + print ("\n"); - - my $baseCommandToExecute = "elftran -capability \""; + + my $baseCommandToExecute = "elftran -capability \""; if (@capabilitiesToSet) - { + { $baseCommandToExecute .= join(" ", @capabilitiesToSet); - } - $baseCommandToExecute .= "\" "; + } + $baseCommandToExecute .= "\" "; # Actually set the capabilities of the listed binaries. foreach my $binaryPath(@binaries) @@ -72,19 +72,19 @@ if (@ARGV) # Create the command line for setting the capabilities. my $commandToExecute = $baseCommandToExecute; $commandToExecute .= $binaryPath; - + # Actually execute the elftran command to set the capabilities. system ($commandToExecute." > NUL"); print ("Executed ".$commandToExecute."\n"); - + ## Create another command line to check that the set capabilities are correct. - #$commandToExecute = "elftran -dump s ".$binaryPath; - } - + #$commandToExecute = "elftran -dump s ".$binaryPath; + } + print ("\n"); } -} -else +} +else { print("This script can be used to set capabilities of all binaries\n"); print("specified for deployment in a .pkg file.\n"); -- cgit v0.12 From 92f58608aa0bac53ed64450b5d94c879eb01cbc3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 13 May 2009 17:06:02 +0300 Subject: New release package creation script --- bin/build_bin_package.pl | 97 --------------------------- bin/build_release_package.pl | 156 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+), 97 deletions(-) delete mode 100644 bin/build_bin_package.pl create mode 100644 bin/build_release_package.pl diff --git a/bin/build_bin_package.pl b/bin/build_bin_package.pl deleted file mode 100644 index 3dfe5cc..0000000 --- a/bin/build_bin_package.pl +++ /dev/null @@ -1,97 +0,0 @@ -####################################################################### -# -# A script for creating binary release package -# -# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -# Contact: Qt Software Information (qt-info@nokia.com) -# -####################################################################### - -my $tempDir = "_binary_package_dir_"; - -if (@ARGV) -{ - my $pkgFileName = shift(@ARGV); - my $epocroot = shift(@ARGV); - - if (!-r($pkgFileName)) - { - print("Package file doesn't exist!\n"); - exit; - } - - if ($epocroot eq "") - { - $epocroot = "\\"; - } - - my $armDbgDir = "epoc32\\release\\armv5\\udeb"; - my $armRelDir = "epoc32\\release\\armv5\\urel"; - my $gcceDbgDir = "epoc32\\release\\gcce\\udeb"; - my $gcceRelDir = "epoc32\\release\\gcce\\urel"; - my $armLibDir = "epoc32\\release\\armv5\\lib"; - - # Clear archive flag from all items in \epoc32\release\armv5\urel and \epoc32\release\armv5\lib - # as those will have the binaries used for all platforms and builds. - my $systemCmd = "attrib -A ".$epocroot.$armDbgDir."\\*.*"; - runSystemCmd($systemCmd); - $systemCmd = "attrib -A ".$epocroot.$armLibDir."\\*.*"; - runSystemCmd($systemCmd); - - # Build Qt - runSystemCmd("qmake"); - runSystemCmd("bldmake bldfiles"); - runSystemCmd("abld build armv5 udeb"); - - # Make a temporary dir structure - system("rd /S /Q $tempDir 2> NUL"); - runSystemCmd("mkdir $tempDir\\$armDbgDir"); - runSystemCmd("mkdir $tempDir\\$armRelDir"); - runSystemCmd("mkdir $tempDir\\$gcceDbgDir"); - runSystemCmd("mkdir $tempDir\\$gcceRelDir"); - runSystemCmd("mkdir $tempDir\\$armLibDir"); - $systemCmd = "xcopy ".$epocroot.$armDbgDir."\\*.* ".$tempDir."\\".$armDbgDir."\\*.* /A /Q"; - runSystemCmd($systemCmd); - $systemCmd = "xcopy ".$tempDir."\\".$armDbgDir."\\*.* ".$tempDir."\\".$armRelDir."\\*.* /Q"; - runSystemCmd($systemCmd); - $systemCmd = "del /F /Q ".$tempDir."\\".$armRelDir."\\*.sym"; - runSystemCmd($systemCmd); - $systemCmd = "xcopy ".$tempDir."\\".$armDbgDir."\\*.* ".$tempDir."\\".$gcceDbgDir."\\*.* /Q"; - runSystemCmd($systemCmd); - $systemCmd = "xcopy ".$tempDir."\\".$armRelDir."\\*.* ".$tempDir."\\".$gcceRelDir."\\*.* /Q"; - runSystemCmd($systemCmd); - $systemCmd = "xcopy ".$epocroot.$armLibDir."\\*.* ".$tempDir."\\".$armLibDir."\\*.* /A /Q"; - runSystemCmd($systemCmd); - - # Create sis to send for signing - my @sisFileNameList = split(/\./, $pkgFileName); - pop(@sisFileNameList); - my $sisFileName = join("", @sisFileNameList).".sis"; - system("del /F /Q $sisFileName 2> NUL"); - runSystemCmd("makesis $pkgFileName $sisFileName"); - $systemCmd = "xcopy $sisFileName ".$tempDir."\\ /Q"; - runSystemCmd($systemCmd); - system("del /F /Q $sisFileName 2> NUL"); -} -else -{ - print("Usage:\n"); - print("build_bin_package.pl qt_deployment_armv5_udeb.pkg [EPOCROOT]\n"); - print("EPOCROOT is optional, defaults to '\\'\n"); - print("1) Clean up the env. (abld reallyclean & delete \\my\\epoc\\root\\build folder)\n"); - print("2) Run \"build_bin_package.pl qt_deployment_armv5_udeb.pkg [\\my\\epoc\\root\\]>\"\n"); - print(" to prepare, build, and create the package structure and sis file.\n"); - print(" Note: Run in the directory you want to be built for package contents.\n"); - print("3) Get the sis signed and replace it with signed sisx.\n"); - print("4) Zip up the $tempDir contents\n"); -} - -sub runSystemCmd -{ - my $error_code = system($_[0]); - if ($error_code != 0) - { - print("'$_[0]' call failed: error code == $error_code\n"); - exit; - } -} diff --git a/bin/build_release_package.pl b/bin/build_release_package.pl new file mode 100644 index 0000000..6873bd0 --- /dev/null +++ b/bin/build_release_package.pl @@ -0,0 +1,156 @@ +####################################################################### +# +# A script for creating binary release package +# +# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +# Contact: Qt Software Information (qt-info@nokia.com) +# +####################################################################### + +use Cwd; + +my $releaseDir = "\\_qt_release_package_dir_"; +my $releaseDirQt = "${releaseDir}\\qt"; +my $releaseDirEpocroot = "${releaseDir}\\epocroot"; +my $releaseDirSis = "${releaseDir}\\sis"; +my $qtRootDir = cwd(); +$qtRootDir =~ s/\//\\/g; # Fix dir separators +my $qtRootDirForMatch = $qtRootDir; # Double backslashes so that variable can be used in matching +$qtRootDirForMatch =~ s/\\/\\\\/; + +if (@ARGV) +{ + my $platform = shift(@ARGV); + my $build = shift(@ARGV); + my $cert = shift(@ARGV); + my $certKey = shift(@ARGV); + my $epocroot = shift(@ARGV); + my $pkgFileName = "src\\s60installs\\qt_libs_${platform}_${build}.pkg"; + + if ($epocroot eq "") + { + $epocroot = "\\"; + } + + my $hwBuildDir = "${epocroot}epoc32\\release\\$platform\\$build"; + my $armDbgDir = "epoc32\\release\\armv5\\udeb"; + my $armRelDir = "epoc32\\release\\armv5\\urel"; + #my $gcceDbgDir = "epoc32\\release\\gcce\\udeb"; #is this needed? + #my $gcceRelDir = "epoc32\\release\\gcce\\urel"; #is this needed? + my $armLibDir = "epoc32\\release\\armv5\\lib"; + my $winscwDbgDir = "epoc32\\release\\winscw\\udeb"; + + # clean up old stuff + system("rd /S /Q ${releaseDir} 2> NUL"); + system("rd /S /Q ${epocroot}epoc32\\build 2> NUL"); # Just in case env is not clean + + # Copy the whole thing over to the release dir before it gets polluted + print("Copying clean tree...\n"); + runSystemCmd("xcopy ${qtRootDir} ${releaseDirQt} /E /I /H /Q"); + + # Clear archive flag from all items in \epoc32\release\armv5\urel and \epoc32\release\armv5\lib + # as those will have the binaries used for all platforms and builds. + runSystemCmd("attrib -A ${hwBuildDir}\\*"); + runSystemCmd("attrib -A ${epocroot}${armLibDir}\\*"); + runSystemCmd("attrib -A ${epocroot}${winscwDbgDir}\\*"); + + # Build Qt + runSystemCmd("configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer"); + chdir("src"); + runSystemCmd("qmake"); + runSystemCmd("bldmake bldfiles"); + runSystemCmd("abld build ${platform} ${build}"); + runSystemCmd("abld build winscw udeb"); + chdir($qtRootDir); + + # Copy misc stuff + runSystemCmd("xcopy ${qtRootDir}\\bin\\* ${releaseDirQt}\\bin /F /R /Y /I /D"); + runSystemCmd("xcopy ${qtRootDir}\\lib\\*.prl ${releaseDirQt}\\lib /F /R /Y /I /D /E"); + runSystemCmd("xcopy ${qtRootDir}\\mkspecs\\* ${releaseDirQt}\\mkspecs /F /R /Y /I /D /E"); + print("Copying includes...\n"); + runSystemCmd("xcopy ${qtRootDir}\\include\\* ${releaseDirQt}\\include /F /R /Y /I /D /E /Q"); + runSystemCmd("copy src\\corelib\\global\\qconfig.h ${releaseDirQt}\\src\\corelib\\global\\qconfig.h"); + runSystemCmd("copy .qmake.cache ${releaseDirQt}\\.qmake.cache"); + + # Copy stuff indicated by pkg file for emulator + open (PKG, "<".$pkgFileName); + while () + { + my $line = $_; + chomp ($line); + + # If the line specifies a file, parse the source and destination locations. + if ($line =~ m/\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"/) + { + my $sourcePath = $1; + my $pkgDestinationPath = $2; + $sourcePath =~ s/\//\\/g; + + # Copy stuff required for creating deployment package + my $destinationPath = $sourcePath; + + if($destinationPath =~ m/($qtRootDirForMatch)/i) + { + $destinationPath =~ s/($qtRootDirForMatch)//i; + $destinationPath = $releaseDirQt.$destinationPath; + } + else + { + $destinationPath =~ s/.://; + $destinationPath = $releaseDirEpocroot.$destinationPath; + } + + runSystemCmd("echo f|xcopy ${sourcePath} ${destinationPath} /F /R /Y /I /D"); + + if ($sourcePath !~ m/\\epoc32\\release\\([^\\]+)\\(udeb|urel)\\(\w+(\.dll|\.exe))/i) + { + # Copy non-binaries also over for emulator to use + $pkgDestinationPath =~ s/!:/${releaseDirEpocroot}\\epoc32\\winscw\\c/g; + runSystemCmd("echo f|xcopy ${sourcePath} ${pkgDestinationPath} /F /R /Y /I /D"); + } + + } + } + close (PKG); + + # Copy binaries + runSystemCmd("xcopy ${hwBuildDir}\\* ${releaseDirEpocroot}\\${armDbgDir} /A /F /I /D"); + runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${armRelDir} /F /I"); + system("del /F /Q ${releaseDirEpocroot}\\${armRelDir}\\*.sym 2> NUL"); + #runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${gcceDbgDir} /F /I"); + #runSystemCmd("xcopy ${releaseDirEpocroot}\\${armRelDir}\\* ${releaseDirEpocroot}\\${gcceRelDir} /F /I"); + runSystemCmd("xcopy ${epocroot}${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /I"); + runSystemCmd("xcopy ${epocroot}${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /I"); + + # Create unsigned sis and Rnd signed sisx + my @pkgPathElements = split(/\\/, $pkgFileName); + my $pathlessPkgFile = pop(@pkgPathElements); + my @pkgSuffixElements = split(/\./, $pathlessPkgFile); + pop(@pkgSuffixElements); + my $sisFileName = join("", @pkgSuffixElements).".sis"; + system("mkdir ${releaseDirSis}"); + runSystemCmd("makesis ${pkgFileName} ${releaseDirSis}\\${sisFileName}"); + runSystemCmd("signsis ${releaseDirSis}\\${sisFileName} ${releaseDirSis}\\${sisFileName}x ${cert} ${certKey}"); +} +else +{ + print("Usage:\n"); + print("build_release_package.pl [EPOCROOT]\n"); + print("EPOCROOT is optional, defaults to '\\'\n"); + print("1) Clean up the env. (abld reallyclean & delete \\my\\epoc\\root\\build folder)\n"); + print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem [\\my\\epoc\\root\\]>\"\n"); + print(" to build Qt and create the release package structure and sis file.\n"); + print(" Note: Run in the Qt root directory.\n"); + print("3) Optional: Get the sis signed with commercial certificate\n"); + print("4) Zip up the ${releaseDir} contents\n"); +} + +sub runSystemCmd +{ + my $error_code = system($_[0]); + if ($error_code != 0) + { + print("'$_[0]' call failed: error code == $error_code\n"); + exit; + } +} -- cgit v0.12 From b898367612c79374bf20dbb84cc4ec11ffde0bc5 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 14 May 2009 12:17:30 +0300 Subject: Fixed several minor issues with build_release_package.pl script --- bin/build_release_package.pl | 84 ++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 23 deletions(-) diff --git a/bin/build_release_package.pl b/bin/build_release_package.pl index 6873bd0..aecfb20 100644 --- a/bin/build_release_package.pl +++ b/bin/build_release_package.pl @@ -9,34 +9,61 @@ use Cwd; -my $releaseDir = "\\_qt_release_package_dir_"; -my $releaseDirQt = "${releaseDir}\\qt"; -my $releaseDirEpocroot = "${releaseDir}\\epocroot"; -my $releaseDirSis = "${releaseDir}\\sis"; -my $qtRootDir = cwd(); -$qtRootDir =~ s/\//\\/g; # Fix dir separators -my $qtRootDirForMatch = $qtRootDir; # Double backslashes so that variable can be used in matching -$qtRootDirForMatch =~ s/\\/\\\\/; - if (@ARGV) { my $platform = shift(@ARGV); my $build = shift(@ARGV); my $cert = shift(@ARGV); my $certKey = shift(@ARGV); + my $releaseDir = shift(@ARGV); my $epocroot = shift(@ARGV); - my $pkgFileName = "src\\s60installs\\qt_libs_${platform}_${build}.pkg"; + + if ($build eq "") + { + print("HW build parameter required!\n"); + exit; + } + + if ($cert eq "") + { + print("Signing certificate parameter required!\n"); + exit; + } + + if ($certKey eq "") + { + print("Signing certificate key parameter required!\n"); + exit; + } + + if ($releaseDir eq "") + { + print("Release directory parameter required!\n"); + exit; + } if ($epocroot eq "") { $epocroot = "\\"; } + my $releaseDirQt = "${releaseDir}\\qt"; + my $releaseDirEpocroot = "${releaseDir}\\epocroot"; + my $releaseDirSis = "${releaseDir}\\sis"; + + my $qtRootDir = cwd(); + $qtRootDir =~ s/\//\\/g; # Fix dir separators + + my $qtRootDirForMatch = $qtRootDir; # Double backslashes so that variable can be used in matching + $qtRootDirForMatch =~ s/\\/\\\\/; + + my $pkgFileName = "src\\s60installs\\qt_libs_${platform}_${build}.pkg"; + my $hwBuildDir = "${epocroot}epoc32\\release\\$platform\\$build"; my $armDbgDir = "epoc32\\release\\armv5\\udeb"; my $armRelDir = "epoc32\\release\\armv5\\urel"; - #my $gcceDbgDir = "epoc32\\release\\gcce\\udeb"; #is this needed? - #my $gcceRelDir = "epoc32\\release\\gcce\\urel"; #is this needed? + my $gcceDbgDir = "epoc32\\release\\gcce\\udeb"; + my $gcceRelDir = "epoc32\\release\\gcce\\urel"; my $armLibDir = "epoc32\\release\\armv5\\lib"; my $winscwDbgDir = "epoc32\\release\\winscw\\udeb"; @@ -46,7 +73,11 @@ if (@ARGV) # Copy the whole thing over to the release dir before it gets polluted print("Copying clean tree...\n"); - runSystemCmd("xcopy ${qtRootDir} ${releaseDirQt} /E /I /H /Q"); + my $tempExcludeFile = "${releaseDir}\\__temp_exclude.txt"; + system("mkdir ${releaseDir} 2>NUL"); + runSystemCmd("echo \\.git\\ > ${tempExcludeFile}"); + runSystemCmd("xcopy ${qtRootDir} ${releaseDirQt} /E /I /H /Q /EXCLUDE:${tempExcludeFile}"); + system("del /F /Q ${tempExcludeFile} 2> NUL"); # Clear archive flag from all items in \epoc32\release\armv5\urel and \epoc32\release\armv5\lib # as those will have the binaries used for all platforms and builds. @@ -108,19 +139,26 @@ if (@ARGV) $pkgDestinationPath =~ s/!:/${releaseDirEpocroot}\\epoc32\\winscw\\c/g; runSystemCmd("echo f|xcopy ${sourcePath} ${pkgDestinationPath} /F /R /Y /I /D"); } + else + { + # For binaries, copy also winscw versions (needed for deployed binaries that are not actually built) + $sourcePath =~ s/epoc32\\release\\${platform}\\${build}/epoc32\\release\\winscw\\udeb/; + $destinationPath =~ s/epoc32\\release\\${platform}\\${build}/epoc32\\release\\winscw\\udeb/; + runSystemCmd("echo f|xcopy ${sourcePath} ${destinationPath} /F /R /Y /I /D"); + } } } close (PKG); - # Copy binaries - runSystemCmd("xcopy ${hwBuildDir}\\* ${releaseDirEpocroot}\\${armDbgDir} /A /F /I /D"); - runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${armRelDir} /F /I"); + # Copy any other binaries and related files built not included in pkg + runSystemCmd("xcopy ${hwBuildDir}\\* ${releaseDirEpocroot}\\${armDbgDir} /A /F /R /Y /I /D "); + runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${armRelDir} /F /R /Y /I /D"); system("del /F /Q ${releaseDirEpocroot}\\${armRelDir}\\*.sym 2> NUL"); - #runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${gcceDbgDir} /F /I"); - #runSystemCmd("xcopy ${releaseDirEpocroot}\\${armRelDir}\\* ${releaseDirEpocroot}\\${gcceRelDir} /F /I"); - runSystemCmd("xcopy ${epocroot}${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /I"); - runSystemCmd("xcopy ${epocroot}${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /I"); + runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${gcceDbgDir} /F /R /Y /I /D"); + runSystemCmd("xcopy ${releaseDirEpocroot}\\${armRelDir}\\* ${releaseDirEpocroot}\\${gcceRelDir} /F /R /Y /I /D"); + runSystemCmd("xcopy ${epocroot}${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /R /Y /I /D"); + runSystemCmd("xcopy ${epocroot}${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /R /Y /I /D"); # Create unsigned sis and Rnd signed sisx my @pkgPathElements = split(/\\/, $pkgFileName); @@ -135,14 +173,14 @@ if (@ARGV) else { print("Usage:\n"); - print("build_release_package.pl [EPOCROOT]\n"); + print("build_release_package.pl [EPOCROOT]\n"); print("EPOCROOT is optional, defaults to '\\'\n"); print("1) Clean up the env. (abld reallyclean & delete \\my\\epoc\\root\\build folder)\n"); - print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem [\\my\\epoc\\root\\]>\"\n"); + print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem \\my_release_dir [\\my\\epoc\\root\\]>\"\n"); print(" to build Qt and create the release package structure and sis file.\n"); print(" Note: Run in the Qt root directory.\n"); print("3) Optional: Get the sis signed with commercial certificate\n"); - print("4) Zip up the ${releaseDir} contents\n"); + print("4) Zip up the release directory contents\n"); } sub runSystemCmd -- cgit v0.12 From 34b2757159453e21c68d76fdb47e27f622c144fe Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 14 May 2009 14:05:28 +0300 Subject: Fixed epocroot handling in build_release_package.pl for non-trivial roots --- bin/build_release_package.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/build_release_package.pl b/bin/build_release_package.pl index aecfb20..0a35062 100644 --- a/bin/build_release_package.pl +++ b/bin/build_release_package.pl @@ -47,6 +47,13 @@ if (@ARGV) $epocroot = "\\"; } + if ($epocroot =~ m/.*[^\\]$/) + { + $epocroot = "${epocroot}\\"; + } + + $epocroot =~ s/.://; + my $releaseDirQt = "${releaseDir}\\qt"; my $releaseDirEpocroot = "${releaseDir}\\epocroot"; my $releaseDirSis = "${releaseDir}\\sis"; @@ -128,6 +135,10 @@ if (@ARGV) else { $destinationPath =~ s/.://; + if ($epocroot !~ m/\\/) + { + $destinationPath =~ s/($epocroot)//i; + } $destinationPath = $releaseDirEpocroot.$destinationPath; } -- cgit v0.12 From 09fe527561ffeccdaad429d4ed76236b71f86a95 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 15 May 2009 11:10:50 +0300 Subject: Improved Linux compatibility for Symbian builds. --- qmake/project.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qmake/project.cpp b/qmake/project.cpp index 7448ac9..7cd4c08 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -694,8 +694,13 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0) concat << base_concat + QDir::separator() + "unix"; break; case Option::TARG_UNIX_MODE: - concat << base_concat + QDir::separator() + "unix"; - break; + { + if (isForSymbian()) + concat << base_concat + QDir::separator() + "symbian"; + else + concat << base_concat + QDir::separator() + "unix"; + break; + } case Option::TARG_WIN_MODE: { if (isForSymbian()) -- cgit v0.12 From 7ec86ec5ebeaa383c9c7f3792de222c228692c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 15 May 2009 13:01:26 +0300 Subject: S60Style: Remove fallback information from theme items table and instead provide a mapping routine for the needed parts. --- src/gui/styles/qs60style.cpp | 26 ++-- src/gui/styles/qs60style_symbian.cpp | 225 +++++++++++++++++++++++++---------- 2 files changed, 177 insertions(+), 74 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 24c1608..6bf9263 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -92,19 +92,19 @@ const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0]; bool QS60StylePrivate::m_backgroundValid = false; const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = { - {SE_ButtonNormal, QS60StyleEnums::SP_QsnFrButtonTbCenter}, - {SE_ButtonPressed, QS60StyleEnums::SP_QsnFrButtonTbCenterPressed}, - {SE_FrameLineEdit, QS60StyleEnums::SP_QsnFrInputCenter}, - {SE_ListHighlight, QS60StyleEnums::SP_QsnFrListCenter}, - {SE_OptionsMenu, QS60StyleEnums::SP_QsnFrPopupCenter}, - {SE_SettingsList, QS60StyleEnums::SP_QsnFrSetOptCenter}, - {SE_TableItem, QS60StyleEnums::SP_QsnFrCaleCenter}, - {SE_TableHeaderItem, QS60StyleEnums::SP_QsnFrCaleHeadingCenter}, - {SE_ToolTip, QS60StyleEnums::SP_QsnFrPopupPreviewCenter}, - {SE_ToolBar, QS60StyleEnums::SP_QsnFrPopupSubCenter}, - {SE_ToolBarButton, QS60StyleEnums::SP_QsnFrSctrlButtonCenter}, - {SE_ToolBarButtonPressed, QS60StyleEnums::SP_QsnFrSctrlButtonCenterPressed}, - {SE_PanelBackground, QS60StyleEnums::SP_QsnFrSetOptCenter}, + {SE_ButtonNormal, QS60StyleEnums::SP_QsnFrButtonTbCenter}, + {SE_ButtonPressed, QS60StyleEnums::SP_QsnFrButtonTbCenterPressed}, + {SE_FrameLineEdit, QS60StyleEnums::SP_QsnFrInputCenter}, + {SE_ListHighlight, QS60StyleEnums::SP_QsnFrListCenter}, + {SE_OptionsMenu, QS60StyleEnums::SP_QsnFrPopupCenter}, + {SE_SettingsList, QS60StyleEnums::SP_QsnFrSetOptCenter}, + {SE_TableItem, QS60StyleEnums::SP_QsnFrCaleCenter}, + {SE_TableHeaderItem, QS60StyleEnums::SP_QsnFrCaleHeadingCenter}, + {SE_ToolTip, QS60StyleEnums::SP_QsnFrPopupPreviewCenter}, + {SE_ToolBar, QS60StyleEnums::SP_QsnFrPopupSubCenter}, + {SE_ToolBarButton, QS60StyleEnums::SP_QsnFrSctrlButtonCenter}, + {SE_ToolBarButtonPressed, QS60StyleEnums::SP_QsnFrSctrlButtonCenterPressed}, + {SE_PanelBackground, QS60StyleEnums::SP_QsnFrSetOptCenter}, }; static const int frameElementsCount = int(sizeof(QS60StylePrivate::m_frameElementsData)/sizeof(QS60StylePrivate::m_frameElementsData[0])); diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index b54f819..99dfc54 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -94,54 +94,11 @@ private: static void unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap); static void colorGroupAndIndex(QS60StyleEnums::SkinParts skinID, TAknsItemID &colorGroup, int colorIndex); - static const TDesC& mapFallBackFileName(const int fileID); + static void fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex); static bool checkSupport(const int supportedRelease); static TAknsItemID checkAndUpdateReleaseSpecificGraphics(int part); // Array to match the skin ID, fallback graphics and Qt widget graphics. static const partMapEntry m_partMap[]; - static const fallbackMapEntry m_fallbackMap[]; -}; - -//FallbackMap has fallback graphics from various mbm-files in case that the requested icon is not in -//active or root skin. -// No fallback graphics for screen elements (it is guaranteed that the root skin contains these). -const fallbackMapEntry QS60StyleModeSpecifics::m_fallbackMap[] = { - {QS60StyleEnums::SP_QgnGrafBarWait, EAvkonMbm, EMbmAvkonQgn_graf_bar_wait_1}, - {QS60StyleEnums::SP_QgnGrafBarFrameCenter, EAvkonMbm, EMbmAvkonQgn_graf_bar_frame_center}, - {QS60StyleEnums::SP_QgnGrafBarFrameSideL, EAvkonMbm, EMbmAvkonQgn_graf_bar_frame_side_l}, - {QS60StyleEnums::SP_QgnGrafBarFrameSideR, EAvkonMbm, EMbmAvkonQgn_graf_bar_frame_side_r}, - {QS60StyleEnums::SP_QgnGrafBarProgress, EAvkonMbm, EMbmAvkonQgn_graf_bar_progress}, - {QS60StyleEnums::SP_QgnGrafTabActiveL, EAvkonMbm, EMbmAvkonQgn_graf_tab_active_l}, - {QS60StyleEnums::SP_QgnGrafTabActiveM, EAvkonMbm, EMbmAvkonQgn_graf_tab_active_m}, - {QS60StyleEnums::SP_QgnGrafTabActiveR, EAvkonMbm, EMbmAvkonQgn_graf_tab_active_r}, - {QS60StyleEnums::SP_QgnGrafTabPassiveL, EAvkonMbm, EMbmAvkonQgn_graf_tab_passive_l}, - {QS60StyleEnums::SP_QgnGrafTabPassiveM, EAvkonMbm, EMbmAvkonQgn_graf_tab_passive_m}, - {QS60StyleEnums::SP_QgnGrafTabPassiveR, EAvkonMbm, EMbmAvkonQgn_graf_tab_passive_r}, - {QS60StyleEnums::SP_QgnIndiCheckboxOff, EAvkonMbm, EMbmAvkonQgn_indi_checkbox_off}, - {QS60StyleEnums::SP_QgnIndiCheckboxOn, EAvkonMbm, EMbmAvkonQgn_indi_checkbox_on}, - {QS60StyleEnums::SP_QgnIndiHlColSuper, EAvkonMbm, 0x4456 }, /* EMbmAvkonQgn_indi_hl_col_super */ - {QS60StyleEnums::SP_QgnIndiHlExpSuper, EAvkonMbm, 0x4458 }, /* EMbmAvkonQgn_indi_hl_exp_super */ - {QS60StyleEnums::SP_QgnIndiHlLineBranch, EAvkonMbm, 0x445A }, /* EMbmAvkonQgn_indi_hl_line_branch */ - {QS60StyleEnums::SP_QgnIndiHlLineEnd, EAvkonMbm, 0x445C }, /* EMbmAvkonQgn_indi_hl_line_end */ - {QS60StyleEnums::SP_QgnIndiHlLineStraight, EAvkonMbm, 0x445E }, /* EMbmAvkonQgn_indi_hl_line_straight */ - {QS60StyleEnums::SP_QgnIndiMarkedAdd, EAvkonMbm, EMbmAvkonQgn_indi_marked_add }, - {QS60StyleEnums::SP_QgnIndiNaviArrowLeft, EAvkonMbm, EMbmAvkonQgn_indi_navi_arrow_left }, - {QS60StyleEnums::SP_QgnIndiNaviArrowRight, EAvkonMbm, EMbmAvkonQgn_indi_navi_arrow_right}, - {QS60StyleEnums::SP_QgnIndiRadiobuttOff, EAvkonMbm, EMbmAvkonQgn_indi_radiobutt_off }, - {QS60StyleEnums::SP_QgnIndiRadiobuttOn, EAvkonMbm, EMbmAvkonQgn_indi_radiobutt_on }, - {QS60StyleEnums::SP_QgnIndiSliderEdit, EAvkonMbm, EMbmAvkonQgn_indi_slider_edit }, - {QS60StyleEnums::SP_QgnIndiSubMenu, EAvkonMbm, EMbmAvkonQgn_indi_submenu }, - {QS60StyleEnums::SP_QgnNoteErased, EAvkonMbm, EMbmAvkonQgn_note_erased }, - {QS60StyleEnums::SP_QgnNoteError, EAvkonMbm, EMbmAvkonQgn_note_error }, - {QS60StyleEnums::SP_QgnNoteInfo, EAvkonMbm, EMbmAvkonQgn_note_info }, - {QS60StyleEnums::SP_QgnNoteOk, EAvkonMbm, EMbmAvkonQgn_note_ok }, - {QS60StyleEnums::SP_QgnNoteQuery, EAvkonMbm, EMbmAvkonQgn_note_query }, - {QS60StyleEnums::SP_QgnNoteWarning, EAvkonMbm, EMbmAvkonQgn_note_warning }, - {QS60StyleEnums::SP_QgnPropFileSmall, EAvkonMbm, EMbmAvkonQgn_prop_file_small }, - {QS60StyleEnums::SP_QgnPropFolderCurrent, EAvkonMbm, EMbmAvkonQgn_prop_folder_current }, - {QS60StyleEnums::SP_QgnPropFolderSmall, EAvkonMbm, EMbmAvkonQgn_prop_folder_small }, - {QS60StyleEnums::SP_QgnPropFolderSmallNew, EAvkonMbm, EMbmAvkonQgn_prop_folder_small_new}, - {QS60StyleEnums::SP_QgnPropPhoneMemcLarge, EAvkonMbm, EMbmAvkonQgn_prop_phone_memc_large} }; const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { @@ -355,14 +312,157 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphics( return error ? QPixmap() : colorGraphics; } -const TDesC& QS60StyleModeSpecifics::mapFallBackFileName(const int fileID) -{ - switch(fileID){ - case ELastMbm: - return KNullDesC(); - case EAvkonMbm: +void QS60StyleModeSpecifics::fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex) +{ + switch(stylepart) { + case QS60StyleEnums::SP_QgnGrafBarWait: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_wait_1; + break; + case QS60StyleEnums::SP_QgnGrafBarFrameCenter: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_frame_center; + break; + case QS60StyleEnums::SP_QgnGrafBarFrameSideL: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_frame_side_l; + break; + case QS60StyleEnums::SP_QgnGrafBarFrameSideR: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_frame_side_r; + break; + case QS60StyleEnums::SP_QgnGrafBarProgress: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_progress; + break; + case QS60StyleEnums::SP_QgnGrafTabActiveL: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_active_l; + break; + case QS60StyleEnums::SP_QgnGrafTabActiveM: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_active_m; + break; + case QS60StyleEnums::SP_QgnGrafTabActiveR: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_active_r; + break; + case QS60StyleEnums::SP_QgnGrafTabPassiveL: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_passive_l; + break; + case QS60StyleEnums::SP_QgnGrafTabPassiveM: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_passive_m; + break; + case QS60StyleEnums::SP_QgnGrafTabPassiveR: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_passive_r; + break; + case QS60StyleEnums::SP_QgnIndiCheckboxOff: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_checkbox_off; + break; + case QS60StyleEnums::SP_QgnIndiCheckboxOn: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_checkbox_on; + break; + case QS60StyleEnums::SP_QgnIndiHlColSuper: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x4456; /* EMbmAvkonQgn_indi_hl_col_super */ + break; + case QS60StyleEnums::SP_QgnIndiHlExpSuper: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x4458; /* EMbmAvkonQgn_indi_hl_exp_super */ + break; + case QS60StyleEnums::SP_QgnIndiHlLineBranch: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x445A; /* EMbmAvkonQgn_indi_hl_line_branch */ + break; + case QS60StyleEnums::SP_QgnIndiHlLineEnd: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x445C; /* EMbmAvkonQgn_indi_hl_line_end */ + break; + case QS60StyleEnums::SP_QgnIndiHlLineStraight: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x445E; /* EMbmAvkonQgn_indi_hl_line_straight */ + break; + case QS60StyleEnums::SP_QgnIndiMarkedAdd: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_marked_add; + break; + case QS60StyleEnums::SP_QgnIndiNaviArrowLeft: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_navi_arrow_left; + break; + case QS60StyleEnums::SP_QgnIndiNaviArrowRight: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_navi_arrow_right; + break; + case QS60StyleEnums::SP_QgnIndiRadiobuttOff: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_radiobutt_off; + break; + case QS60StyleEnums::SP_QgnIndiRadiobuttOn: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_radiobutt_on; + break; + case QS60StyleEnums::SP_QgnIndiSliderEdit: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_slider_edit; + break; + case QS60StyleEnums::SP_QgnIndiSubMenu: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_submenu; + break; + case QS60StyleEnums::SP_QgnNoteErased: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_erased; + break; + case QS60StyleEnums::SP_QgnNoteError: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_error; + break; + case QS60StyleEnums::SP_QgnNoteInfo: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_info; + break; + case QS60StyleEnums::SP_QgnNoteOk: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_ok; + break; + case QS60StyleEnums::SP_QgnNoteQuery: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_query; + break; + case QS60StyleEnums::SP_QgnNoteWarning: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_warning; + break; + case QS60StyleEnums::SP_QgnPropFileSmall: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_file_small; + break; + case QS60StyleEnums::SP_QgnPropFolderCurrent: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_folder_current; + break; + case QS60StyleEnums::SP_QgnPropFolderSmall: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_folder_small; + break; + case QS60StyleEnums::SP_QgnPropFolderSmallNew: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_folder_small_new; + break; + case QS60StyleEnums::SP_QgnPropPhoneMemcLarge: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_phone_memc_large; + break; default: - return KAvkonBitmapFile(); + fallbackFileName = KNullDesC(); + fallbackIndex = -1; + break; } } @@ -372,10 +472,12 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsL( { const int stylepartIndex = (int)stylepart; const TAknsItemID skinId = m_partMap[stylepartIndex].skinID; - const TDesC& fallbackFileName = mapFallBackFileName(m_fallbackMap[stylepartIndex].fallbackGraphicID); - const TInt fallbackGraphicID = - (fallbackFileName!=KNullDesC) ? m_fallbackMap[stylepartIndex].fallbackGraphicID : KErrNotFound; + TInt fallbackGraphicID = -1; + HBufC* iconFile = HBufC::NewLC( KMaxFileName ); + TPtr fileNamePtr = iconFile->Des(); + fallbackInfo(stylepart, fileNamePtr, fallbackGraphicID); + TAknsItemID colorGroup = KAknsIIDQsnIconColors; int colorIndex = 0; colorGroupAndIndex(stylepart, colorGroup, colorIndex); @@ -390,11 +492,11 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsL( fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); AknsUtils::CreateColorIconLC( - skinInstance, skinId, colorGroup, colorIndex, icon, iconMask, fallbackFileName, fallbackGraphicID , fallbackGraphicsMaskID, KRgbBlack); + skinInstance, skinId, colorGroup, colorIndex, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID, KRgbBlack); User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); QPixmap result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); - CleanupStack::PopAndDestroy(2); //icon, iconMask + CleanupStack::PopAndDestroy(3); //icon, iconMask, iconFile return result; } @@ -537,20 +639,21 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( switch (drawType) { case EDrawIcon: { - const TDesC& fallbackFileName = mapFallBackFileName(m_fallbackMap[stylepartIndex].fallbackGraphicID); - const TInt fallbackGraphicID = - (fallbackFileName!=KNullDesC) ? m_fallbackMap[stylepartIndex].fallbackGraphicID : KErrNotFound; + TInt fallbackGraphicID = -1; + HBufC* iconFile = HBufC::NewLC( KMaxFileName ); + TPtr fileNamePtr = iconFile->Des(); + fallbackInfo(part, fileNamePtr, fallbackGraphicID); CFbsBitmap *icon = 0; CFbsBitmap *iconMask = 0; const TInt fallbackGraphicsMaskID = fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files // QS60WindowSurface::unlockBitmapHeap(); - AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fallbackFileName, fallbackGraphicID , fallbackGraphicsMaskID); + AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID); User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); - CleanupStack::PopAndDestroy(2); // iconMask, icon + CleanupStack::PopAndDestroy(3); // iconMask, icon, iconFile // QS60WindowSurface::lockBitmapHeap(); break; } -- cgit v0.12 From 9765faecf15fbd54b8817fdea66669cab91b5235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 15 May 2009 13:02:45 +0300 Subject: S60Style: Scrollbar pressed state. --- src/gui/styles/qs60style.cpp | 19 +++++++++++++- src/gui/styles/qs60style_symbian.cpp | 51 ++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 6bf9263..7e98d9a 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -323,6 +323,14 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, case SE_PanelBackground: drawFrame(SF_PanelBackground, painter, rect, flags | SF_PointNorth); break; + case SE_ScrollBarHandlePressedHorizontal: + drawRow(QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed, QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed, + QS60StyleEnums::SP_QsnCpScrollHandleTopPressed, Qt::Horizontal, painter, rect, flags | SF_PointEast); + break; + case SE_ScrollBarHandlePressedVertical: + drawRow(QS60StyleEnums::SP_QsnCpScrollHandleTopPressed, QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed, + QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed, Qt::Vertical, painter, rect, flags | SF_PointNorth); + break; default: break; } @@ -795,8 +803,17 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom const QS60StylePrivate::SkinElements grooveElement = horizontal ? QS60StylePrivate::SE_ScrollBarGrooveHorizontal : QS60StylePrivate::SE_ScrollBarGrooveVertical; QS60StylePrivate::drawSkinElement(grooveElement, painter, grooveRect, flags); + + // select correct slider (horizontal/vertical/pressed) + const bool sliderPressed = ((optionSlider->state & QStyle::State_Sunken) && (subControls & SC_ScrollBarSlider)); const QS60StylePrivate::SkinElements handleElement = - horizontal ? QS60StylePrivate::SE_ScrollBarHandleHorizontal : QS60StylePrivate::SE_ScrollBarHandleVertical; + horizontal ? + ( sliderPressed ? + QS60StylePrivate::SE_ScrollBarHandlePressedHorizontal : + QS60StylePrivate::SE_ScrollBarHandleHorizontal ) : + ( sliderPressed ? + QS60StylePrivate::SE_ScrollBarHandlePressedVertical : + QS60StylePrivate::SE_ScrollBarHandleVertical); QS60StylePrivate::drawSkinElement(handleElement, painter, scrollBarSlider, flags); } break; diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 99dfc54..199e7ff 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -80,6 +80,7 @@ public: const QSize &size, QS60StylePrivate::SkinElementFlags flags); static QColor colorValue(const TAknsItemID &colorGroup, int colorIndex); static QPixmap fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask, QS60StylePrivate::SkinElementFlags flags, QImage::Format format); + static QPixmap generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part, const QSize &size, QS60StylePrivate::SkinElementFlags flags); private: static QPixmap createSkinnedGraphicsL(QS60StyleEnums::SkinParts part, @@ -141,6 +142,11 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, -1,-1}, /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, -1,-1}, + // 3.1 & 3.2 do not have pressed state for scrollbar, so use normal scrollbar graphics instead. + /* SP_QsnCpScrollHandleBottomPressed*/ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f8}, /*KAknsIIDQsnCpScrollHandleBottomPressed*/ + /* SP_QsnCpScrollHandleMiddlePressed*/ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f9}, /*KAknsIIDQsnCpScrollHandleMiddlePressed*/ + /* SP_QsnCpScrollHandleTopPressed*/ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20fa}, /*KAknsIIDQsnCpScrollHandleTopPressed*/ + /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1}, /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1}, @@ -981,6 +987,47 @@ short QS60StylePrivate::pixelMetric(int metric) #endif // QT_S60STYLE_LAYOUTDATA_SIMULATED } +QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part, + const QSize &size, QS60StylePrivate::SkinElementFlags flags) +{ + if (!QS60StylePrivate::isTouchSupported()) + return QPixmap(); + + QS60StyleEnums::SkinParts updatedPart = part; + switch(part){ + // AVKON UI has a abnormal handling for scrollbar graphics. It is possible that the root + // skin does not contain mandatory graphics for scrollbar pressed states. Therefore, AVKON UI + // creates dynamically these graphics by modifying the normal state scrollbar graphics slightly. + // S60Style needs to work similarly. Therefore if skingraphics call provides to be a miss + // (i.e. result is not valid), style needs to draw normal graphics instead and apply some + // modifications (similar to generatedIconPixmap()) to the result. + case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: + updatedPart = QS60StyleEnums::SP_QsnCpScrollHandleBottom; + break; + case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed: + updatedPart = QS60StyleEnums::SP_QsnCpScrollHandleMiddle; + break; + case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed: + updatedPart = QS60StyleEnums::SP_QsnCpScrollHandleTop; + break; + default: + break; + } + if (part==updatedPart) { + return QPixmap(); + } else { + QPixmap result = skinnedGraphics(updatedPart, size, flags); + // TODO: fix this + QStyleOption opt; + // opt.palette = q->standardPalette(); + + // For now, always generate new icon based on "selected". In the future possibly, expand + // this to consist other possibilities as well. + result = QApplication::style()->generatedIconPixmap(QIcon::Selected, result, &opt); + return result; + } +} + QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, const QSize &size, SkinElementFlags flags) { @@ -996,6 +1043,10 @@ QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, // opt.palette = q->standardPalette(); result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt); } + + if (!result) + result = QS60StyleModeSpecifics::generateMissingThemeGraphic(part, size, flags); + return result; } -- cgit v0.12 From 631467df8481ac1cba5d8c263888fa368b854111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 15 May 2009 13:23:39 +0300 Subject: S60Style: Scrollbar pressed state (missing changes from 9765faecf15fbd54b8817fdea66669cab91b5235), --- src/gui/styles/qs60style.cpp | 6 ++++++ src/gui/styles/qs60style_p.h | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 7e98d9a..6f4472c 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -355,6 +355,10 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag result.scale(pixelMetric(QStyle::PM_SliderLength), pixelMetric(QStyle::PM_SliderControlThickness), Qt::IgnoreAspectRatio); break; + + case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: + case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed: + case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed: case QS60StyleEnums::SP_QsnCpScrollBgBottom: case QS60StyleEnums::SP_QsnCpScrollBgMiddle: case QS60StyleEnums::SP_QsnCpScrollBgTop: @@ -804,6 +808,8 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom horizontal ? QS60StylePrivate::SE_ScrollBarGrooveHorizontal : QS60StylePrivate::SE_ScrollBarGrooveVertical; QS60StylePrivate::drawSkinElement(grooveElement, painter, grooveRect, flags); + QStyle::SubControls subControls = optionSlider->subControls; + // select correct slider (horizontal/vertical/pressed) const bool sliderPressed = ((optionSlider->state & QStyle::State_Sunken) && (subControls & SC_ScrollBarSlider)); const QS60StylePrivate::SkinElements handleElement = diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 8fe1c5d..e0b3a2a 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -109,7 +109,10 @@ public: SP_QgnPropFolderCurrent, SP_QgnPropFolderSmall, SP_QgnPropFolderSmallNew, - SP_QgnPropPhoneMemcLarge, + SP_QgnPropPhoneMemcLarge, + SP_QsnCpScrollHandleBottomPressed, //ScrollBar handle, pressed state + SP_QsnCpScrollHandleMiddlePressed, + SP_QsnCpScrollHandleTopPressed, SP_QsnBgScreen, SP_QsnCpScrollBgBottom, SP_QsnCpScrollBgMiddle, @@ -282,7 +285,9 @@ public: SE_ToolBar, SE_ToolBarButton, SE_ToolBarButtonPressed, - SE_PanelBackground + SE_PanelBackground, + SE_ScrollBarHandlePressedHorizontal, //only for 5.0+ + SE_ScrollBarHandlePressedVertical, }; enum SkinFrameElements { -- cgit v0.12 From 2dab6c554a53c14f58b598ef062c7592821de405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 15 May 2009 13:56:31 +0300 Subject: S60Style: Make pressed down state of tool button clearer to see. --- src/gui/styles/qs60style.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 6f4472c..5be7fe8 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1229,6 +1229,16 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_ToolButtonLabel: if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast(option)) { QStyleOptionToolButton optionToolButton = *toolBtn; + + if (!optionToolButton.icon.isNull() && (optionToolButton.state & QStyle::State_Sunken) + && (optionToolButton.state & State_Enabled)) { + + const QIcon::State state = optionToolButton.state & State_On ? QIcon::On : QIcon::Off; + const QPixmap pm(optionToolButton.icon.pixmap(optionToolButton.rect.size().boundedTo(optionToolButton.iconSize), + QIcon::Normal, state)); + optionToolButton.icon = generatedIconPixmap(QIcon::Selected, pm, &optionToolButton); + } + QCommonStyle::drawControl(element, &optionToolButton, painter, widget); } break; -- cgit v0.12 From 4a964c6a6e715e4a66e84edf7e564872e5c8f7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 15 May 2009 13:58:25 +0300 Subject: S60Style: Make button content area slightly larger if button is 'checkable button'. --- src/gui/styles/qs60style.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 5be7fe8..caac359 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2258,6 +2258,12 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, { QSize sz(csz); switch (ct) { + case CT_PushButton: + sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget); + if (const QAbstractButton *buttonWidget = (qobject_cast(widget))) + if (buttonWidget->isCheckable()) + sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0); + break; case CT_LineEdit: if (const QStyleOptionFrame *f = qstyleoption_cast(opt)) sz += QSize(2*f->lineWidth, 4*f->lineWidth); -- cgit v0.12 From 5e42a45d47e6300f986681b84fb61e923d7788fb Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Mon, 18 May 2009 08:12:23 +0200 Subject: Set the vertical advance of glyph metrics to zero. The OpenVG paint engine uses this value as the escapement of the glyph and setting this to the vertical advance results in the text being laid out in a declining staircase fashion. All other font engines seem to set the vertical advance to zero so do the same here as well. --- src/gui/text/qfontengine_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 580291a..eec09f4 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -234,7 +234,7 @@ glyph_metrics_t QFontEngineS60::boundingBox_const(glyph_t glyph) const glyphBounds.Width(), glyphBounds.Height(), metrics.HorizAdvance(), - metrics.VertAdvance() + 0 ); return result; } -- cgit v0.12