Remove the dead drawShadePanel in qwasmcompositor
The method is not used anywhere. Remove it to save tens of LOCs. Change-Id: Id853d12d238aa30eb197ab3fed7ccc24a2213e31 Pick-to: 6.4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
7c61eb101d
commit
80d9436488
@ -672,78 +672,6 @@ void QWasmCompositor::drawTitlebarWindow(QWasmTitleBarOptions tb, QPainter *pain
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWasmCompositor::drawShadePanel(QWasmTitleBarOptions options, QPainter *painter)
|
|
||||||
{
|
|
||||||
int lineWidth = 1;
|
|
||||||
QPalette palette = options.palette;
|
|
||||||
const QBrush *fill = &options.palette.brush(QPalette::Button);
|
|
||||||
|
|
||||||
int x = options.rect.x();
|
|
||||||
int y = options.rect.y();
|
|
||||||
int w = options.rect.width();
|
|
||||||
int h = options.rect.height();
|
|
||||||
|
|
||||||
const qreal devicePixelRatio = painter->device()->devicePixelRatio();
|
|
||||||
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
|
||||||
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
|
||||||
painter->scale(inverseScale, inverseScale);
|
|
||||||
|
|
||||||
x = qRound(devicePixelRatio * x);
|
|
||||||
y = qRound(devicePixelRatio * y);
|
|
||||||
w = qRound(devicePixelRatio * w);
|
|
||||||
h = qRound(devicePixelRatio * h);
|
|
||||||
lineWidth = qRound(devicePixelRatio * lineWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
QColor shade = palette.dark().color();
|
|
||||||
QColor light = palette.light().color();
|
|
||||||
|
|
||||||
if (fill) {
|
|
||||||
if (fill->color() == shade)
|
|
||||||
shade = palette.shadow().color();
|
|
||||||
if (fill->color() == light)
|
|
||||||
light = palette.midlight().color();
|
|
||||||
}
|
|
||||||
QPen oldPen = painter->pen();
|
|
||||||
QList<QLineF> lines;
|
|
||||||
lines.reserve(2*lineWidth);
|
|
||||||
|
|
||||||
painter->setPen(light);
|
|
||||||
int x1, y1, x2, y2;
|
|
||||||
int i;
|
|
||||||
x1 = x;
|
|
||||||
y1 = y2 = y;
|
|
||||||
x2 = x + w - 2;
|
|
||||||
for (i = 0; i < lineWidth; i++) // top shadow
|
|
||||||
lines << QLineF(x1, y1++, x2--, y2++);
|
|
||||||
|
|
||||||
x2 = x1;
|
|
||||||
y1 = y + h - 2;
|
|
||||||
for (i = 0; i < lineWidth; i++) // left shado
|
|
||||||
lines << QLineF(x1++, y1, x2++, y2--);
|
|
||||||
|
|
||||||
painter->drawLines(lines);
|
|
||||||
lines.clear();
|
|
||||||
painter->setPen(shade);
|
|
||||||
x1 = x;
|
|
||||||
y1 = y2 = y+h-1;
|
|
||||||
x2 = x+w-1;
|
|
||||||
for (i=0; i<lineWidth; i++) { // bottom shadow
|
|
||||||
lines << QLineF(x1++, y1--, x2, y2--);
|
|
||||||
}
|
|
||||||
x1 = x2;
|
|
||||||
y1 = y;
|
|
||||||
y2 = y + h - lineWidth - 1;
|
|
||||||
for (i = 0; i < lineWidth; i++) // right shadow
|
|
||||||
lines << QLineF(x1--, y1++, x2--, y2);
|
|
||||||
|
|
||||||
painter->drawLines(lines);
|
|
||||||
if (fill) // fill with fill color
|
|
||||||
painter->fillRect(x+lineWidth, y+lineWidth, w-lineWidth*2, h-lineWidth*2, *fill);
|
|
||||||
painter->setPen(oldPen); // restore pen
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void QWasmCompositor::drawWindow(QOpenGLTextureBlitter *blitter, QWasmScreen *screen,
|
void QWasmCompositor::drawWindow(QOpenGLTextureBlitter *blitter, QWasmScreen *screen,
|
||||||
const QWasmWindow *window)
|
const QWasmWindow *window)
|
||||||
{
|
{
|
||||||
|
@ -189,7 +189,6 @@ private:
|
|||||||
|
|
||||||
void drawFrameWindow(QWasmFrameOptions options, QPainter *painter);
|
void drawFrameWindow(QWasmFrameOptions options, QPainter *painter);
|
||||||
void drawTitlebarWindow(QWasmTitleBarOptions options, QPainter *painter);
|
void drawTitlebarWindow(QWasmTitleBarOptions options, QPainter *painter);
|
||||||
void drawShadePanel(QWasmTitleBarOptions options, QPainter *painter);
|
|
||||||
void drawItemPixmap(QPainter *painter, const QRect &rect,
|
void drawItemPixmap(QPainter *painter, const QRect &rect,
|
||||||
int alignment, const QPixmap &pixmap) const;
|
int alignment, const QPixmap &pixmap) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user