Since now the breeze icons can be recolored by kiconloader
with svg stylesheets, use this feature to recolor the
currently selected icon in the sidebar and in the
details view (not the icon view)
look wouldn't change if used with icon themes that
don't support this feature
This makes it look more in line with the breeze style
REVIEW:127877
KItemListWidget::hideEvent(event);
}
KItemListWidget::hideEvent(event);
}
+bool KStandardItemListWidget::event(QEvent *event)
+{
+ if (event->type() == QEvent::WindowDeactivate || event->type() == QEvent::WindowActivate) {
+ m_dirtyContent = true;
+ }
+
+ return KItemListWidget::event(event);
+}
+
void KStandardItemListWidget::slotCutItemsChanged()
{
const QUrl itemUrl = data().value("url").toUrl();
void KStandardItemListWidget::slotCutItemsChanged()
{
const QUrl itemUrl = data().value("url").toUrl();
iconName = QStringLiteral("unknown");
}
const QStringList overlays = values["iconOverlays"].toStringList();
iconName = QStringLiteral("unknown");
}
const QStringList overlays = values["iconOverlays"].toStringList();
- m_pixmap = pixmapForIcon(iconName, overlays, maxIconHeight);
+ m_pixmap = pixmapForIcon(iconName, overlays, maxIconHeight, isSelected() && isActiveWindow() ? QIcon::Selected : QIcon::Normal);
} else if (m_pixmap.width() / m_pixmap.devicePixelRatio() != maxIconWidth || m_pixmap.height() / m_pixmap.devicePixelRatio() != maxIconHeight) {
// A custom pixmap has been applied. Assure that the pixmap
} else if (m_pixmap.width() / m_pixmap.devicePixelRatio() != maxIconWidth || m_pixmap.height() / m_pixmap.devicePixelRatio() != maxIconHeight) {
// A custom pixmap has been applied. Assure that the pixmap
-QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStringList& overlays, int size)
+QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStringList& overlays, int size, QIcon::Mode mode)
{
static const QIcon fallbackIcon = QIcon::fromTheme(QStringLiteral("unknown"));
size *= qApp->devicePixelRatio();
{
static const QIcon fallbackIcon = QIcon::fromTheme(QStringLiteral("unknown"));
size *= qApp->devicePixelRatio();
- const QString key = "KStandardItemListWidget:" % name % ":" % overlays.join(QStringLiteral(":")) % ":" % QString::number(size);
+ const QString key = "KStandardItemListWidget:" % name % ":" % overlays.join(QStringLiteral(":")) % ":" % QString::number(size) % ":" % QString::number(mode);
QPixmap pixmap;
if (!QPixmapCache::find(key, pixmap)) {
QPixmap pixmap;
if (!QPixmapCache::find(key, pixmap)) {
- pixmap = icon.pixmap(requestedSize / qApp->devicePixelRatio(), requestedSize / qApp->devicePixelRatio());
+ pixmap = icon.pixmap(requestedSize / qApp->devicePixelRatio(), requestedSize / qApp->devicePixelRatio(), mode);
if (requestedSize != size) {
KPixmapModifier::scale(pixmap, QSize(size, size));
}
if (requestedSize != size) {
KPixmapModifier::scale(pixmap, QSize(size, size));
}
virtual void resizeEvent(QGraphicsSceneResizeEvent* event) Q_DECL_OVERRIDE;
virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
virtual void hideEvent(QHideEvent* event) Q_DECL_OVERRIDE;
virtual void resizeEvent(QGraphicsSceneResizeEvent* event) Q_DECL_OVERRIDE;
virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
virtual void hideEvent(QHideEvent* event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) Q_DECL_OVERRIDE;
private slots:
void slotCutItemsChanged();
private slots:
void slotCutItemsChanged();
*/
void closeRoleEditor();
*/
void closeRoleEditor();
- static QPixmap pixmapForIcon(const QString& name, const QStringList& overlays, int size);
+ static QPixmap pixmapForIcon(const QString& name, const QStringList& overlays, int size, QIcon::Mode mode);
/**
* @return Preferred size of the rating-image based on the given
/**
* @return Preferred size of the rating-image based on the given