Commit 0a8a4bd1 authored by David Redondo's avatar David Redondo 🏎

Do not alter the toolbars of QMainWindows that are not windows

It can happen that an application uses a QMainWindow in its widget hierachy for
its features but does not correspond to an actual window. Only alter those
toolbars for the unified look whose QMainWindows are actual windows and as such
have a window decoration.
BUG:427410
parent 01f0c885
......@@ -919,7 +919,8 @@ namespace Breeze
if (!_helper->shouldDrawToolsArea(widget)) {
return true;
}
if (auto mw = qobject_cast<const QMainWindow*>(widget)) {
auto mw = qobject_cast<const QMainWindow*>(widget);
if (mw && mw == mw->window()) {
painter->save();
auto rect = _toolsAreaManager->toolsAreaRect(mw);
......
......@@ -214,8 +214,10 @@ namespace Breeze {
} if (mainWindow == nullptr) {
return;
}
if (tryRegisterToolBar(mainWindow, widget)) return;
if (mainWindow != mainWindow->window()) {
return;
}
tryRegisterToolBar(mainWindow, widget);
}
void ToolsAreaManager::unregisterWidget(QWidget *widget)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment