Commit 508dc815 authored by David Hallas's avatar David Hallas

Fix "Add Network Folder" tooltip icon does not show on Breeze, shows correctly on Breeze Dark

Summary:
Fix "Add Network Folder" tooltip icon does not show on Breeze, shows correctly
on Breeze Dark. The fix is taken from D19596.

Test Plan:
Open Dolphin with the Breeze theme
Hover the mouse over the "Add Network Folder"
The icon is black on black

BUG: 404858

Reviewers: #dolphin, elvisangelaccio, ngraham

Reviewed By: #dolphin, elvisangelaccio, ngraham

Subscribers: broulik, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D19738
parent f0a65179
......@@ -25,6 +25,7 @@
#include <KIO/PreviewJob>
#include <KJobWidgets>
#include <KToolTipWidget>
#include <KIconLoader>
#include <QApplication>
#include <QDesktopWidget>
......@@ -34,6 +35,15 @@
#include <QTimer>
#include <QWindow>
class IconLoaderSingleton {
public:
IconLoaderSingleton() = default;
KIconLoader self;
};
Q_GLOBAL_STATIC(IconLoaderSingleton, iconLoader)
ToolTipManager::ToolTipManager(QWidget* parent) :
QObject(parent),
m_showToolTipTimer(nullptr),
......@@ -167,8 +177,13 @@ void ToolTipManager::previewFailed()
if (!m_toolTipRequested) {
return;
}
const QPixmap pixmap = QIcon::fromTheme(m_item.iconName()).pixmap(128, 128);
QPalette pal;
for (auto state : { QPalette::Active, QPalette::Inactive, QPalette::Disabled }) {
pal.setBrush(state, QPalette::WindowText, pal.toolTipText());
pal.setBrush(state, QPalette::Window, pal.toolTipBase());
}
iconLoader->self.setCustomPalette(pal);
const QPixmap pixmap = KDE::icon(m_item.iconName(), &iconLoader->self).pixmap(128, 128);
m_fileMetaDataWidget->setPreview(pixmap);
if (!m_showToolTipTimer->isActive()) {
showToolTip();
......
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