diff options
author | Bjoern Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-04-07 10:59:16 (GMT) |
---|---|---|
committer | Bjoern Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-04-07 10:59:16 (GMT) |
commit | 6e13559503040963c28dd8f5b6881e3a2b9d5596 (patch) | |
tree | 3e030548ffb1667d5fa8cd2020fd7b28749d0411 /src/gui/styles | |
parent | 939623b2bc8e441618ee1a1886cc656880bee62b (diff) | |
parent | d8f76432c3937690c37972136c02a5a264bc941f (diff) | |
download | Qt-6e13559503040963c28dd8f5b6881e3a2b9d5596.zip Qt-6e13559503040963c28dd8f5b6881e3a2b9d5596.tar.gz Qt-6e13559503040963c28dd8f5b6881e3a2b9d5596.tar.bz2 |
Merge commit 'origin/4.5'
Conflicts:
src/gui/graphicsview/qgraphicsitem.cpp
src/gui/graphicsview/qgraphicsitem_p.h
src/gui/graphicsview/qgraphicsscene.cpp
src/gui/painting/qtransform.cpp
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/gtksymbols.cpp | 8 | ||||
-rw-r--r-- | src/gui/styles/qgtkstyle.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qwindowsvistastyle.cpp | 20 |
3 files changed, 16 insertions, 14 deletions
diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index 8123d32..f7af8f8 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -504,13 +504,6 @@ static QPalette gtkWidgetPalette(const QString >kWidgetName) pal.setBrush(QPalette::Disabled, QPalette::WindowText, disabledTextColor); pal.setBrush(QPalette::All, QPalette::ButtonText, textColor); pal.setBrush(QPalette::Disabled, QPalette::ButtonText, disabledTextColor); - if (gtkWidgetName == QLS("GtkMenu")) { - // This really applies to the combo box rendering since - // QComboBox copies the palette from a QMenu - GdkColor gdkBg = gtkWidget->style->bg[GTK_STATE_NORMAL]; - QColor bgColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8); - pal.setBrush(QPalette::Base, bgColor); - } return pal; } @@ -528,6 +521,7 @@ void QGtk::applyCustomPaletteHash() GdkColor gdkBg = QGtk::gtkWidget(QLS("GtkMenu"))->style->bg[GTK_STATE_NORMAL]; QColor bgColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8); menuPal.setBrush(QPalette::Base, bgColor); + menuPal.setBrush(QPalette::Window, bgColor); qApp->setPalette(menuPal, "QMenu"); QPalette toolbarPal = gtkWidgetPalette(QLS("GtkToolbar")); diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 6354ce7..b569b5c 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -2634,7 +2634,7 @@ void QGtkStyle::drawControl(ControlElement element, QColor disabledTextColor = QColor(gdkDText.red>>8, gdkDText.green>>8, gdkDText.blue>>8); if (resolve_mask & (1 << QPalette::ButtonText)) { textColor = option->palette.buttonText().color(); - disabledTextColor = option->palette.brush(QPalette::Disabled, QPalette::ButtonText);; + disabledTextColor = option->palette.brush(QPalette::Disabled, QPalette::ButtonText).color(); } QColor highlightedTextColor = QColor(gdkHText.red>>8, gdkHText.green>>8, gdkHText.blue>>8); diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index 4c3060d..b14b8b3 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -801,12 +801,20 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt if (vopt->viewItemPosition == QStyleOptionViewItemV4::OnlyOne || vopt->viewItemPosition == QStyleOptionViewItemV4::Invalid) painter->drawPixmap(pixmapRect.topLeft(), pixmap); - else if (reverse ? rightSection : leftSection) - painter->drawPixmap(pixmapRect, pixmap, srcRect.adjusted(0, 0, -frame, 0)); - else if (reverse ? leftSection : rightSection) - painter->drawPixmap(pixmapRect, pixmap, - srcRect.adjusted(frame, 0, 0, 0)); - else if (vopt->viewItemPosition == QStyleOptionViewItemV4::Middle) + else if (reverse ? rightSection : leftSection){ + painter->drawPixmap(QRect(pixmapRect.topLeft(), + QSize(frame, pixmapRect.height())), pixmap, + QRect(QPoint(0, 0), QSize(frame, pixmapRect.height()))); + painter->drawPixmap(pixmapRect.adjusted(frame, 0, 0, 0), + pixmap, srcRect.adjusted(frame, 0, -frame, 0)); + } else if (reverse ? leftSection : rightSection) { + painter->drawPixmap(QRect(pixmapRect.topRight() - QPoint(frame - 1, 0), + QSize(frame, pixmapRect.height())), pixmap, + QRect(QPoint(pixmapRect.width() - frame, 0), + QSize(frame, pixmapRect.height()))); + painter->drawPixmap(pixmapRect.adjusted(0, 0, -frame, 0), + pixmap, srcRect.adjusted(frame, 0, -frame, 0)); + } else if (vopt->viewItemPosition == QStyleOptionViewItemV4::Middle) painter->drawPixmap(pixmapRect, pixmap, srcRect.adjusted(frame, 0, -frame, 0)); } else { |