src/gui/styles/qcleanlooksstyle.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
  2155             } else {
  2155             } else {
  2156                 tf |= Qt::AlignHCenter;
  2156                 tf |= Qt::AlignHCenter;
  2157             }
  2157             }
  2158 
  2158 
  2159             if (button->features & QStyleOptionButton::HasMenu)
  2159             if (button->features & QStyleOptionButton::HasMenu)
  2160                 ir = ir.adjusted(0, 0, -pixelMetric(PM_MenuButtonIndicator, button, widget), 0);
  2160                 ir = ir.adjusted(0, 0, -proxy()->pixelMetric(PM_MenuButtonIndicator, button, widget), 0);
  2161             proxy()->drawItemText(painter, ir, tf, button->palette, (button->state & State_Enabled),
  2161             proxy()->drawItemText(painter, ir, tf, button->palette, (button->state & State_Enabled),
  2162                          button->text, QPalette::ButtonText);
  2162                          button->text, QPalette::ButtonText);
  2163         }
  2163         }
  2164         break;
  2164         break;
  2165     case CE_MenuBarEmptyArea:
  2165     case CE_MenuBarEmptyArea:
  4012         if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
  4012         if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
  4013             int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget);
  4013             int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget);
  4014             switch (subControl) {
  4014             switch (subControl) {
  4015             case SC_SliderHandle: {
  4015             case SC_SliderHandle: {
  4016                 if (slider->orientation == Qt::Horizontal) {
  4016                 if (slider->orientation == Qt::Horizontal) {
  4017                     rect.setHeight(pixelMetric(PM_SliderThickness));
  4017                     rect.setHeight(proxy()->pixelMetric(PM_SliderThickness));
  4018                     rect.setWidth(pixelMetric(PM_SliderLength));
  4018                     rect.setWidth(proxy()->pixelMetric(PM_SliderLength));
  4019                     int centerY = slider->rect.center().y() - rect.height() / 2;
  4019                     int centerY = slider->rect.center().y() - rect.height() / 2;
  4020                     if (slider->tickPosition & QSlider::TicksAbove)
  4020                     if (slider->tickPosition & QSlider::TicksAbove)
  4021                         centerY += tickSize;
  4021                         centerY += tickSize;
  4022                     if (slider->tickPosition & QSlider::TicksBelow)
  4022                     if (slider->tickPosition & QSlider::TicksBelow)
  4023                         centerY -= tickSize;
  4023                         centerY -= tickSize;
  4024                     rect.moveTop(centerY);
  4024                     rect.moveTop(centerY);
  4025                 } else {
  4025                 } else {
  4026                     rect.setWidth(pixelMetric(PM_SliderThickness));
  4026                     rect.setWidth(proxy()->pixelMetric(PM_SliderThickness));
  4027                     rect.setHeight(pixelMetric(PM_SliderLength));
  4027                     rect.setHeight(proxy()->pixelMetric(PM_SliderLength));
  4028                     int centerX = slider->rect.center().x() - rect.width() / 2;
  4028                     int centerX = slider->rect.center().x() - rect.width() / 2;
  4029                     if (slider->tickPosition & QSlider::TicksAbove)
  4029                     if (slider->tickPosition & QSlider::TicksAbove)
  4030                         centerX += tickSize;
  4030                         centerX += tickSize;
  4031                     if (slider->tickPosition & QSlider::TicksBelow)
  4031                     if (slider->tickPosition & QSlider::TicksBelow)
  4032                         centerX -= tickSize;
  4032                         centerX -= tickSize;