mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
various cleanups
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
c67c0c6a09
commit
5ce9a965be
3 changed files with 37 additions and 28 deletions
|
@ -345,9 +345,9 @@ public:
|
|||
QRect clipRect;
|
||||
QRegion clipRegion;
|
||||
|
||||
uint enabled : 1;
|
||||
uint hasRectClip : 1;
|
||||
uint hasRegionClip : 1;
|
||||
bool enabled;
|
||||
bool hasRectClip;
|
||||
bool hasRegionClip;
|
||||
|
||||
void appendSpan(const int x, const int length, const int y, const int coverage);
|
||||
void appendSpans(const QSpan *s, const int num);
|
||||
|
|
|
@ -159,25 +159,25 @@ void QPaintEngineExPrivate::replayClipOperations()
|
|||
}
|
||||
|
||||
switch (info.clipType) {
|
||||
case QPainterClipInfo::RegionClip:
|
||||
q->clip(info.region, info.operation);
|
||||
break;
|
||||
case QPainterClipInfo::PathClip:
|
||||
q->clip(info.path, info.operation);
|
||||
break;
|
||||
case QPainterClipInfo::RectClip:
|
||||
q->clip(info.rect, info.operation);
|
||||
break;
|
||||
case QPainterClipInfo::RectFClip: {
|
||||
qreal right = info.rectf.x() + info.rectf.width();
|
||||
qreal bottom = info.rectf.y() + info.rectf.height();
|
||||
qreal pts[] = { info.rectf.x(), info.rectf.y(),
|
||||
right, info.rectf.y(),
|
||||
right, bottom,
|
||||
info.rectf.x(), bottom };
|
||||
QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint);
|
||||
q->clip(vp, info.operation);
|
||||
break;
|
||||
case QPainterClipInfo::RegionClip:
|
||||
q->clip(info.region, info.operation);
|
||||
break;
|
||||
case QPainterClipInfo::PathClip:
|
||||
q->clip(info.path, info.operation);
|
||||
break;
|
||||
case QPainterClipInfo::RectClip:
|
||||
q->clip(info.rect, info.operation);
|
||||
break;
|
||||
case QPainterClipInfo::RectFClip: {
|
||||
qreal right = info.rectf.x() + info.rectf.width();
|
||||
qreal bottom = info.rectf.y() + info.rectf.height();
|
||||
qreal pts[] = { info.rectf.x(), info.rectf.y(),
|
||||
right, info.rectf.y(),
|
||||
right, bottom,
|
||||
info.rectf.x(), bottom };
|
||||
QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint);
|
||||
q->clip(vp, info.operation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -615,9 +615,9 @@ void QToolBar::setOrientation(Qt::Orientation orientation)
|
|||
d->orientation = orientation;
|
||||
|
||||
if (orientation == Qt::Vertical)
|
||||
setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
|
||||
setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
|
||||
else
|
||||
setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
|
||||
setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
|
||||
|
||||
d->layout->invalidate();
|
||||
d->layout->activate();
|
||||
|
@ -626,7 +626,10 @@ void QToolBar::setOrientation(Qt::Orientation orientation)
|
|||
}
|
||||
|
||||
Qt::Orientation QToolBar::orientation() const
|
||||
{ Q_D(const QToolBar); return d->orientation; }
|
||||
{
|
||||
Q_D(const QToolBar);
|
||||
return d->orientation;
|
||||
}
|
||||
|
||||
/*!
|
||||
\property QToolBar::iconSize
|
||||
|
@ -639,7 +642,10 @@ Qt::Orientation QToolBar::orientation() const
|
|||
*/
|
||||
|
||||
QSize QToolBar::iconSize() const
|
||||
{ Q_D(const QToolBar); return d->iconSize; }
|
||||
{
|
||||
Q_D(const QToolBar);
|
||||
return d->iconSize;
|
||||
}
|
||||
|
||||
void QToolBar::setIconSize(const QSize &iconSize)
|
||||
{
|
||||
|
@ -684,7 +690,10 @@ void QToolBar::setIconSize(const QSize &iconSize)
|
|||
*/
|
||||
|
||||
Qt::ToolButtonStyle QToolBar::toolButtonStyle() const
|
||||
{ Q_D(const QToolBar); return d->toolButtonStyle; }
|
||||
{
|
||||
Q_D(const QToolBar);
|
||||
return d->toolButtonStyle;
|
||||
}
|
||||
|
||||
void QToolBar::setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle)
|
||||
{
|
||||
|
@ -959,7 +968,7 @@ void QToolBar::paintEvent(QPaintEvent *)
|
|||
initStyleOption(&opt);
|
||||
|
||||
if (d->layout->expanded || d->layout->animating || isWindow()) {
|
||||
//if the toolbar is expended, we need to fill the background with the window color
|
||||
//if the toolbar is expanded, we need to fill the background with the window color
|
||||
//because some styles may expects that.
|
||||
p.fillRect(opt.rect, palette().background());
|
||||
style->drawControl(QStyle::CE_ToolBar, &opt, &p, this);
|
||||
|
|
Loading…
Add table
Reference in a new issue