[krita] libs/ui: Remove the dockwidget titlebar proxy style again.
Boudewijn Rempt
null at kde.org
Tue Sep 11 09:13:06 BST 2018
Git commit eca385149bf56efadb82fa3ecb93ee27d20d2349 by Boudewijn Rempt.
Committed on 11/09/2018 at 08:11.
Pushed by rempt into branch 'master'.
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 at kde.org
CCMAIL:scott.petrovic at gmail.com
M +0 -42 libs/ui/KisMainWindow.cpp
https://commits.kde.org/krita/eca385149bf56efadb82fa3ecb93ee27d20d2349
diff --git a/libs/ui/KisMainWindow.cpp b/libs/ui/KisMainWindow.cpp
index 887c93f20c6..a48a02f0945 100644
--- a/libs/ui/KisMainWindow.cpp
+++ b/libs/ui/KisMainWindow.cpp
@@ -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);
More information about the kimageshop
mailing list