diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 20 | ||||
-rw-r--r-- | src/gui/styles/qgtkstyle.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 27 | ||||
-rw-r--r-- | src/gui/text/qfontdatabase_s60.cpp | 5 | ||||
-rw-r--r-- | src/gui/text/qfontengine_win.cpp | 5 |
5 files changed, 41 insertions, 19 deletions
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index ef7ac1f..89ea256 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -234,6 +234,15 @@ struct QWExtra { uint activated : 1; // RWindowBase::Activated has been called /** + * If this bit is set, each native widget receives the signals from the + * Symbian control immediately before and immediately after draw ops are + * sent to the window server for this control: + * void beginNativePaintEvent(const QRect &paintRect); + * void endNativePaintEvent(const QRect &paintRect); + */ + uint receiveNativePaintEvents : 1; + + /** * Defines the behaviour of QSymbianControl::Draw. */ enum NativePaintMode { @@ -258,16 +267,7 @@ struct QWExtra { Default = Blit }; - NativePaintMode nativePaintMode : 2; - - /** - * If this bit is set, each native widget receives the signals from the - * Symbian control immediately before and immediately after draw ops are - * sent to the window server for this control: - * void beginNativePaintEvent(const QRect &paintRect); - * void endNativePaintEvent(const QRect &paintRect); - */ - uint receiveNativePaintEvents : 1; + NativePaintMode nativePaintMode; #endif }; diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index bd87ca4..9c61023 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -3423,6 +3423,9 @@ QRect QGtkStyle::subElementRect(SubElement element, const QStyleOption *option, Q_D(const QGtkStyle); QRect r = QCleanlooksStyle::subElementRect(element, option, widget); + if (!d->isThemeAvailable()) + return r; + switch (element) { case SE_ProgressBarLabel: case SE_ProgressBarContents: diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 65191a4..000696c 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2626,14 +2626,22 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple const int frameThickness = spinbox->frame ? pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0; const int buttonMargin = spinbox->frame ? 2 : 0; const int buttonContentWidth = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin; + // Spinbox buttons should be no larger than one fourth of total width. + // Thus, side-by-side buttons would take half of the total width. + const int maxSize = qMax(spinbox->rect.width() / 4, buttonContentWidth); QSize buttonSize; - buttonSize.setHeight(qMax(8, spinbox->rect.height() - frameThickness)); + buttonSize.setHeight(qMin(maxSize, qMax(8, spinbox->rect.height() - frameThickness))); //width should at least be equal to height buttonSize.setWidth(qMax(buttonSize.height(), buttonContentWidth)); buttonSize = buttonSize.expandedTo(QApplication::globalStrut()); - const int y = frameThickness + spinbox->rect.y(); - const int x = spinbox->rect.x() + spinbox->rect.width() - frameThickness - 2 * buttonSize.width(); + // Normally spinbuttons should be side-by-side, but if spinbox grows very big + // and spinbuttons reach their maximum size, they can be deployed one top of the other. + const bool sideBySide = (buttonSize.height() * 2 < spinbox->rect.height()) ? false : true; + const int y = frameThickness + spinbox->rect.y() + + (spinbox->rect.height() - (sideBySide ? 1 : 2) * buttonSize.height()) / 2; + const int x = spinbox->rect.x() + + spinbox->rect.width() - frameThickness - (sideBySide ? 2 : 1) * buttonSize.width(); switch (scontrol) { case SC_SpinBoxUp: @@ -2644,7 +2652,9 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple case SC_SpinBoxDown: if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) return QRect(); - ret = QRect(x + buttonSize.width(), y, buttonSize.width(), buttonSize.height()); + ret = QRect(x + (sideBySide ? buttonSize.width() : 0), + y + (sideBySide ? 0 : buttonSize.height()), + buttonSize.width(), buttonSize.height()); break; case SC_SpinBoxEditField: if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) @@ -2787,11 +2797,10 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con break; case SE_LineEditContents: { // in S60 the input text box doesn't start from line Edit's TL, but - // a bit indented. - QRect lineEditRect = opt->rect; - const int adjustment = opt->rect.height() >> 2; - lineEditRect.adjust(adjustment, 0, 0, 0); - ret = lineEditRect; + // a bit indented (8 pixels). + const int KLineEditDefaultIndention = 8; + ret = visualRect( + opt->direction, opt->rect, opt->rect.adjusted(KLineEditDefaultIndention, 0, 0, 0)); } break; case SE_TabBarTearIndicator: diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 621f666..ef5e0c4 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -332,6 +332,11 @@ bool QFontDatabase::removeApplicationFont(int handle) return false; } +bool QFontDatabase::removeAllApplicationFonts() +{ + return false; +} + bool QFontDatabase::supportsThreadedFontRendering() { return false; diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index 3e79d79..93a7c75 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -39,6 +39,11 @@ ** ****************************************************************************/ +#if _WIN32_WINNT < 0x0500 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + #include "qfontengine_p.h" #include "qtextengine_p.h" #include <qglobal.h> |