kstyle: fix misalignment of spinbox item sizes

wilder-5.24
Jan Blackquill 5 years ago
parent 32cf073328
commit 127e124460
  1. 15
      kstyle/breezestyle.cpp

@ -2368,6 +2368,11 @@ namespace Breeze
// copy rect
auto rect( option->rect );
if (subControl == SC_SpinBoxUp || subControl == SC_SpinBoxDown) {
// compensate for 1px margin + 1px border
rect.adjust( 2, 2, -2, -2 );
}
switch( subControl )
{
case SC_SpinBoxFrame: return flat ? QRect():rect;
@ -2375,14 +2380,16 @@ namespace Breeze
case SC_SpinBoxUp:
{
auto r = rect;
r.setLeft(r.width()-buttonSize);
r.setWidth(buttonSize);
r.moveRight(rect.right());
return r;
}
case SC_SpinBoxDown:
{
auto r = rect;
r.setRight(buttonSize);
r.setWidth(buttonSize);
r.moveLeft(rect.left());
return r;
}
@ -6884,9 +6891,9 @@ namespace Breeze
painter->setPen( _helper->separatorColor( palette ));
if (subControl == SC_SpinBoxUp) {
painter->drawLine(QLine(arrowRect.topLeft()+QPoint(1, 4), arrowRect.bottomLeft()-QPoint(-1, 4)));
painter->drawLine(QLine(arrowRect.topLeft()+QPoint(0, 2), arrowRect.bottomLeft()-QPoint(0, 2)));
} else {
painter->drawLine(QLine(arrowRect.topRight()+QPoint(0, 4), arrowRect.bottomRight()-QPoint(0, 4)));
painter->drawLine(QLine(arrowRect.topRight()+QPoint(0, 2), arrowRect.bottomRight()-QPoint(0, 2)));
}
}

Loading…
Cancel
Save