Commit eca38514 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remove the dockwidget titlebar proxy style again.

This exposes an issue in Qt, where apparently if there's a proxy
style set for the titlebar widgets, the dockers become part of the
central widget, and get the central widget's cursor changes.

And that breaks the layerbox; the cursor follows the canvas cursor,
which is unusable :-(

CCMAIL:kimageshop@kde.org
CCMAIL:scott.petrovic@gmail.com
parent 260b7c66
......@@ -154,42 +154,6 @@
#include <QtPlatformHeaders/QWindowsWindowFunctions>
#endif
class DockerTitleStyle : public QProxyStyle
{
public:
DockerTitleStyle(QStyle *baseStyle = nullptr) : QProxyStyle(baseStyle) {}
QPixmap standardPixmap(QStyle::StandardPixmap sp, const QStyleOption *option = nullptr,
const QWidget *widget = nullptr) const override
{
QIcon closeIcon = KisIconUtils::loadIcon("docker_close");
QPixmap closePixmap = closeIcon.pixmap(QSize(20, 20));
QIcon floatIcon = KisIconUtils::loadIcon("docker_float");
QPixmap floatPixmap = floatIcon.pixmap(QSize(20, 20));
switch (sp) {
case SP_TitleBarNormalButton:
case SP_TitleBarMinButton:
case SP_TitleBarMenuButton:
return floatPixmap;
case SP_DockWidgetCloseButton:
case SP_TitleBarCloseButton:
return closePixmap;
default:
break;
}
return QCommonStyle::standardPixmap(sp, option, widget);
}
};
class ToolDockerFactory : public KoDockFactoryBase
{
public:
......@@ -725,11 +689,6 @@ void KisMainWindow::slotThemeChanged()
}
emit themeChanged();
// go through each docker and set style
for (int i = 0; i < dockWidgets().length(); i++) {
dockWidgets().at(i)->setStyle(new DockerTitleStyle);
}
}
void KisMainWindow::updateReloadFileAction(KisDocument *doc)
......@@ -2012,7 +1971,6 @@ QDockWidget* KisMainWindow::createDockWidget(KoDockFactoryBase* factory)
dockWidget->setFont(KoDockRegistry::dockFont());
dockWidget->setObjectName(factory->id());
dockWidget->setParent(this);
dockWidget->setStyle(new DockerTitleStyle);
if (lockAllDockers) {
if (dockWidget->titleBarWidget()) {
dockWidget->titleBarWidget()->setVisible(false);
......
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