summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qandroidstyle.cpp22
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm10
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp2
4 files changed, 23 insertions, 13 deletions
diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/widgets/styles/qandroidstyle.cpp
index afd6c3024c..ceb95aa125 100644
--- a/src/widgets/styles/qandroidstyle.cpp
+++ b/src/widgets/styles/qandroidstyle.cpp
@@ -515,8 +515,15 @@ void QAndroidStyle::drawPrimitive(PrimitiveElement pe,
AndroidControlsHash::const_iterator it = itemType != QC_UnknownType
? m_androidControlsHash.find(itemType)
: m_androidControlsHash.end();
- if (it != m_androidControlsHash.end())
- it.value()->drawControl(opt, p, w);
+ if (it != m_androidControlsHash.end()) {
+ if (itemType != QC_EditText)
+ it.value()->drawControl(opt, p, w);
+ else {
+ QStyleOption copy(*opt);
+ copy.state &= ~QStyle::State_Sunken;
+ it.value()->drawControl(&copy, p, w);
+ }
+ }
else
QFusionStyle::drawPrimitive(pe, opt, p, w);
}
@@ -696,7 +703,10 @@ int QAndroidStyle::styleHint(QStyle::StyleHint hint, const QStyleOption *option,
{
switch (hint) {
case SH_Slider_AbsoluteSetButtons:
- return 1;
+ return Qt::LeftButton;
+
+ case SH_Slider_PageSetButtons:
+ return 0;
case SH_RequestSoftwareInputPanel:
return RSIP_OnMouseClick;
@@ -1776,9 +1786,9 @@ QRect QAndroidStyle::AndroidSeekBarControl::subControlRect(const QStyleOptionCom
drawable = static_cast<const QAndroidStyle::AndroidStateDrawable *>(m_seekBarThumb)->bestAndroidStateMatch(option);
QRect r(option->rect);
- double factor = double(styleOption->sliderPosition/(styleOption->maximum-styleOption->minimum));
- int pos=(double(option->rect.width()*factor - drawable->size().width()) / 2);
- r.setX(r.x()+pos);
+ double factor = double(styleOption->sliderPosition) / (styleOption->maximum - styleOption->minimum);
+ int pos = option->rect.width() * factor - double(drawable->size().width() / 2);
+ r.setX(r.x() + pos);
r.setSize(drawable->size());
return r;
}
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 7f0813c303..a9f1c3bbbc 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -4251,7 +4251,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
if (sc == SC_GroupBoxCheckBox) {
int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget);
left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth);
- int top = totalRect.top() + (fontMetrics.height() - indicatorHeight) / 2;
+ int top = totalRect.top() + qMax(0, fontMetrics.height() - indicatorHeight) / 2;
totalRect.setRect(left, top, indicatorWidth, indicatorHeight);
// Adjust for label
} else {
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 0b860450d1..5db4801c37 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -2191,7 +2191,6 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
HIRect rect;
ptrHIShapeGetBounds(region, &rect);
ret = int(rect.size.height);
- ret += 4;
}
break;
case PM_TabBarTabVSpace:
@@ -3791,7 +3790,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
} else if (!(tabOpt->state & State_Enabled)) {
tdi.style = kThemeTabNonFrontInactive;
} else if (tabOpt->state & State_Sunken) {
- tdi.style = kThemeTabFrontInactive; // (should be kThemeTabNonFrontPressed)
+ tdi.style = kThemeTabNonFrontPressed;
}
if (tabOpt->state & State_HasFocus)
tdi.adornment = kHIThemeTabAdornmentFocus;
@@ -3866,8 +3865,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
ThemeTabDirection ttd = getTabDirection(myTab.shape);
bool verticalTabs = ttd == kThemeTabWest || ttd == kThemeTabEast;
bool selected = (myTab.state & QStyle::State_Selected);
+ bool usingModernOSX = QSysInfo::MacintoshVersion > QSysInfo::MV_10_6;
- if (selected && !myTab.documentMode)
+ if (usingModernOSX && selected && !myTab.documentMode)
myTab.palette.setColor(QPalette::WindowText, QColor(Qt::white));
// Check to see if we use have the same as the system font
@@ -3875,7 +3875,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// outside world, unless they read the source, in which case, it's
// their own fault).
bool nonDefaultFont = p->font() != qt_app_fonts_hash()->value("QComboMenuItem");
- if (selected || verticalTabs || nonDefaultFont || !tab->icon.isNull()
+ if ((usingModernOSX && selected) || verticalTabs || nonDefaultFont || !tab->icon.isNull()
|| !myTab.leftButtonSize.isNull() || !myTab.rightButtonSize.isNull()) {
int heightOffset = 0;
if (verticalTabs) {
@@ -3886,7 +3886,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
}
myTab.rect.setHeight(myTab.rect.height() + heightOffset);
- if (myTab.documentMode || selected) {
+ if (myTab.documentMode || (usingModernOSX && selected)) {
p->save();
rotateTabPainter(p, myTab.shape, myTab.rect);
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 417e092e11..ab98dfbdcf 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4821,7 +4821,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
QSize defaultUpSize = defaultSize(w, subRule.size(), spinbox->rect, PseudoElement_SpinBoxUpButton);
sz += QSize(defaultUpSize.width(), 0);
}
- if (rule.hasBox() || !rule.hasNativeBorder())
+ if (rule.hasBox() || rule.hasBorder() || !rule.hasNativeBorder())
sz = rule.boxSize(sz);
return sz;
}