diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-14 09:03:35 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-14 09:23:50 (GMT) |
commit | e7ea80161aa91369cf700b79e96e97367ecf0ff6 (patch) | |
tree | df222b411cc1e3a40a248dc5f7f5a3af60fc785b /src | |
parent | 572d57b255227f74c7ce61ab67476d4971955ea9 (diff) | |
download | Qt-e7ea80161aa91369cf700b79e96e97367ecf0ff6.zip Qt-e7ea80161aa91369cf700b79e96e97367ecf0ff6.tar.gz Qt-e7ea80161aa91369cf700b79e96e97367ecf0ff6.tar.bz2 |
Fix Toolbutton font with pseudo-states
So now QToolButton:pressed {text-decoration: underline} will works
The change in QCommonStyle is to make it consistant with the setFont few
lines later.
Reveiwed-by: jbache
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qcommonstyle.cpp | 1 | ||||
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index c0899f8..6972803 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -1664,6 +1664,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, if (!styleHint(SH_UnderlineShortcut, opt, widget)) alignment |= Qt::TextHideMnemonic; rect.translate(shiftX, shiftY); + p->setFont(toolbutton->font); drawItemText(p, rect, alignment, toolbutton->palette, opt->state & State_Enabled, toolbutton->text, QPalette::ButtonText); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index dcc11b8..cd44bfd 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -3030,6 +3030,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC if (const QStyleOptionToolButton *tool = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { QStyleOptionToolButton toolOpt(*tool); rule.configurePalette(&toolOpt.palette, QPalette::ButtonText, QPalette::Button); + toolOpt.font = rule.font.resolve(toolOpt.font); toolOpt.rect = rule.borderRect(opt->rect); bool customArrow = (tool->features & (QStyleOptionToolButton::HasMenu | QStyleOptionToolButton::MenuButtonPopup)); bool customDropDown = tool->features & QStyleOptionToolButton::MenuButtonPopup; |