wasm: make the compositor draw the window icon
Currently the compositor draws the Qt logo by default; check if the window has an icon and draw that instead if set. Fixes: QTBUG-86052 Pick-to: 6.2 Change-Id: Ia4f9c03562c15993c86cb8717f27e47ab669353d Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
parent
ad5c5bb541
commit
fd0ef140cf
@ -411,6 +411,8 @@ QWasmCompositor::QWasmTitleBarOptions QWasmCompositor::makeTitleBarOptions(const
|
||||
if (!window->window()->title().isEmpty())
|
||||
titleBarOptions.titleBarOptionsString = window->window()->title();
|
||||
|
||||
titleBarOptions.windowIcon = window->window()->icon();
|
||||
|
||||
return titleBarOptions;
|
||||
}
|
||||
|
||||
@ -586,8 +588,12 @@ void QWasmCompositor::drawTitlebarWindow(QWasmTitleBarOptions tb, QPainter *pain
|
||||
|
||||
if (tb.subControls & SC_TitleBarSysMenu && tb.flags & Qt::WindowSystemMenuHint) {
|
||||
ir = titlebarRect(tb, SC_TitleBarSysMenu);
|
||||
pixmap = cachedPixmapFromXPM(qt_menu_xpm).scaled(QSize(10, 10));
|
||||
drawItemPixmap(painter, ir, Qt::AlignCenter, pixmap);
|
||||
if (!tb.windowIcon.isNull()) {
|
||||
tb.windowIcon.paint(painter, ir, Qt::AlignCenter);
|
||||
} else {
|
||||
pixmap = cachedPixmapFromXPM(qt_menu_xpm).scaled(QSize(10, 10));
|
||||
drawItemPixmap(painter, ir, Qt::AlignCenter, pixmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,6 +91,7 @@ public:
|
||||
QPalette palette;
|
||||
QString titleBarOptionsString;
|
||||
QWasmCompositor::SubControls subControls;
|
||||
QIcon windowIcon;
|
||||
};
|
||||
|
||||
struct QWasmFrameOptions {
|
||||
|
Loading…
Reference in New Issue
Block a user