Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkwidget
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#567
  • Loading branch information
deepin-ci-robot committed Apr 28, 2024
1 parent 6d4d4c4 commit bc085e2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/widgets/dstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,19 @@ void drawTitleBarIcon(QPainter *pa, const QRectF &rect, const QString &iconName)

void drawTitleBarMenuButton(QPainter *pa, const QRectF &rect)
{
drawTitleBarIcon(pa, rect, QLatin1String("window_menu"));
const QPen pen = pa->pen();
pa->setPen(Qt::NoPen);
pa->drawRect(rect);
QRect content_rect(0, 0, rect.width() / 5, rect.height() / 5);
content_rect.moveCenter(rect.center().toPoint());
pa->setPen(pen);

pa->setRenderHint(QPainter::Antialiasing, pa->device()->devicePixelRatioF() > 1.0);
pa->drawLine(content_rect.x(), content_rect.y(), content_rect.topRight().x() - 2, content_rect.topRight().y());
pa->drawLine(content_rect.bottomLeft(), content_rect.bottomRight());

qreal y = content_rect.center().y();
pa->drawLine(content_rect.x(), y, content_rect.topRight().x(), y);
}

void drawTitleBarMinButton(QPainter *pa, const QRectF &rect)
Expand Down

0 comments on commit bc085e2

Please sign in to comment.