summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-07 07:08:51 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-07 07:08:51 (GMT)
commit62a2fe9092d3b6038a08f5c5a7faa4a863b84fdc (patch)
tree2fe7b9ec43c86ca7bdac72978347120ed3390384 /src/gui/styles
parentc78f753d544f87e06903b2b6250a32e6f8147c3c (diff)
parenteae8c143428128a4bea4c06cff93b38189da267d (diff)
downloadQt-62a2fe9092d3b6038a08f5c5a7faa4a863b84fdc.zip
Qt-62a2fe9092d3b6038a08f5c5a7faa4a863b84fdc.tar.gz
Qt-62a2fe9092d3b6038a08f5c5a7faa4a863b84fdc.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (36 commits) Fix failure on Windows after commit ccd3f66 tst_qtcpserver: Another attempt to reproduce QTBUG-14268 Fix crash when constructing QThreadStorage after global destructors have run tst_qtcpsocket: Attempt to reproduce QTBUG-14268 Fixed a buffer overrun when pasting large data from non-Qt apps Fix copying large data to non-Qt applications fix regexp in "make custom command handling in vc(x)proj files sane" qmake: Include -pthread when reducing duplicate library arguments qmake: Ensure right library order when reducing duplicate libraries rebuild configure.exe make QMAKE_POST_LINK handling in nmake generator sane make custom command handling in vc(x)proj files sane Revert "QWorkspace: fix hardcoded min size overwriting the real min size" QtScript/JavaScriptCore: Backport random number generator seeding fix Fix performance regression in QUuid::createUuid() Update japanese translations. Ensure that the underline is only drawn when expected for an accel Small improvement in the textedit demo My changes for 4.7.1 QWorkspace: fix hardcoded min size overwriting the real min size ...
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qgtkstyle.cpp29
-rw-r--r--src/gui/styles/qmacstyle_mac.mm10
2 files changed, 28 insertions, 11 deletions
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index c5429dd..9cc64b3 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -225,9 +225,8 @@ QPalette QGtkStyle::standardPalette() const
GtkStyle *style = d->gtkStyle();
GtkWidget *gtkButton = d->gtkWidget("GtkButton");
GtkWidget *gtkEntry = d->getTextColorWidget();
-
- GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg;
- QColor bg, base, text, fg, highlight, highlightText;
+ GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg, gdkaSbg, gdkaSfg;
+ QColor bg, base, text, fg, highlight, highlightText, inactiveHighlight, inactiveHighlightedTExt;
gdkBg = style->bg[GTK_STATE_NORMAL];
gdkForeground = gtkButton->style->fg[GTK_STATE_NORMAL];
@@ -237,14 +236,23 @@ QPalette QGtkStyle::standardPalette() const
gdkText = gtkEntry->style->text[GTK_STATE_NORMAL];
gdkSbg = gtkEntry->style->base[GTK_STATE_SELECTED];
gdkSfg = gtkEntry->style->text[GTK_STATE_SELECTED];
+
+ // The ACTIVE base color is really used for inactive windows
+ gdkaSbg = gtkEntry->style->base[GTK_STATE_ACTIVE];
+ gdkaSfg = gtkEntry->style->text[GTK_STATE_ACTIVE];
+
bg = QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8);
text = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8);
fg = QColor(gdkForeground.red>>8, gdkForeground.green>>8, gdkForeground.blue>>8);
base = QColor(gdkBase.red>>8, gdkBase.green>>8, gdkBase.blue>>8);
highlight = QColor(gdkSbg.red>>8, gdkSbg.green>>8, gdkSbg.blue>>8);
highlightText = QColor(gdkSfg.red>>8, gdkSfg.green>>8, gdkSfg.blue>>8);
+ inactiveHighlight = QColor(gdkaSbg.red>>8, gdkaSbg.green>>8, gdkaSbg.blue>>8);
+ inactiveHighlightedTExt = QColor(gdkaSfg.red>>8, gdkaSfg.green>>8, gdkaSfg.blue>>8);
palette.setColor(QPalette::HighlightedText, highlightText);
+
+
palette.setColor(QPalette::Light, bg.lighter(125));
palette.setColor(QPalette::Shadow, bg.darker(130));
palette.setColor(QPalette::Dark, bg.darker(120));
@@ -279,6 +287,10 @@ QPalette QGtkStyle::standardPalette() const
highlightText.setHsv(highlightText.hue(), 0, highlightText.value(), highlightText.alpha());
palette.setColor(QPalette::Disabled, QPalette::Highlight, highlight);
palette.setColor(QPalette::Disabled, QPalette::HighlightedText, highlightText);
+
+ palette.setColor(QPalette::Inactive, QPalette::HighlightedText, inactiveHighlightedTExt);
+ palette.setColor(QPalette::Inactive, QPalette::Highlight, inactiveHighlight);
+
style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), "gtk-tooltips", "GtkWindow",
d->gtk_window_get_type());
if (style) {
@@ -791,10 +803,13 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
// ### this mess should move to subcontrolrect
QRect frameRect = option->rect.adjusted(1, 1, -1, -2);
- if (qobject_cast<const QTabBar*>(widget))
- frameRect.adjust(-1, 1, 1, 1);
-
- gtkPainter.paintFocus(NULL, "tab", frameRect, GTK_STATE_ACTIVE, style);
+ if (qobject_cast<const QTabBar*>(widget)) {
+ GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook");
+ style = gtkPainter.getStyle(gtkNotebook);
+ gtkPainter.paintFocus(gtkNotebook, "tab", frameRect.adjusted(-1, 1, 1, 1), GTK_STATE_ACTIVE, style);
+ } else {
+ gtkPainter.paintFocus(NULL, "tab", frameRect, GTK_STATE_ACTIVE, style);
+ }
}
break;
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 671a888..fb31ae4 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -3336,6 +3336,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (needText) {
QPalette pal = tb->palette;
QPalette::ColorRole role = QPalette::NoRole;
+ if (!proxy()->styleHint(SH_UnderlineShortcut, tb, w))
+ alignment |= Qt::TextHideMnemonic;
if (down)
cr.translate(shiftX, shiftY);
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5
@@ -3353,13 +3355,13 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
role = QPalette::HighlightedText;
}
}
- drawItemText(p, cr, alignment, pal,
- tb->state & State_Enabled, tb->text, role);
+ proxy()->drawItemText(p, cr, alignment, pal,
+ tb->state & State_Enabled, tb->text, role);
if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5 &&
(tb->state & State_Sunken)) {
// Draw a "drop shadow" in earlier versions.
- drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment,
- tb->palette, tb->state & State_Enabled, tb->text);
+ proxy()->drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment,
+ tb->palette, tb->state & State_Enabled, tb->text);
}
}
} else {