Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Rings:2-TestDVD
plasma-framework
reload-icon-when-usesPlasmaTheme-changes.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File reload-icon-when-usesPlasmaTheme-changes.patch of Package plasma-framework
From 85699c8d2f5403f19a059a743c8de9483cd71356 Mon Sep 17 00:00:00 2001 From: Marco Martin <notmart@gmail.com> Date: Fri, 5 May 2017 20:18:19 +0200 Subject: reload icon when usesPlasmaTheme changes Summary: when usesPlasmaTheme gets changed, make sure to invalidate the svg icon if there, to reload the icon from the proper source, being either from the plasma theme or the system icon theme. Test Plan: cuttlefish now reloads dynamically the proper icons when the monochrome checkbox is ticked Reviewers: #plasma, sebas Reviewed By: #plasma, sebas Subscribers: plasma-devel, #frameworks Tags: #plasma, #frameworks Differential Revision: https://phabricator.kde.org/D5721 --- src/declarativeimports/core/iconitem.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/declarativeimports/core/iconitem.cpp b/src/declarativeimports/core/iconitem.cpp index 2b96c61..da3bf47 100644 --- a/src/declarativeimports/core/iconitem.cpp +++ b/src/declarativeimports/core/iconitem.cpp @@ -176,6 +176,9 @@ void IconItem::setSource(const QVariant &source) //try as a svg icon from plasma theme m_svgIcon->setImagePath(QLatin1String("icons/") + sourceString.split('-').first()); m_svgIcon->setContainsMultipleImages(true); + //invalidate the image path to recalculate it later + } else { + m_svgIcon->setImagePath(QString()); } //success? @@ -348,12 +351,11 @@ void IconItem::setUsesPlasmaTheme(bool usesPlasmaTheme) m_usesPlasmaTheme = usesPlasmaTheme; // Reload icon with new settings - if (m_svgIcon && m_svgIcon->hasElement(m_source.toString())) { - const QVariant src = m_source; - m_source.clear(); - setSource(src); - } + const QVariant src = m_source; + m_source.clear(); + setSource(src); + update(); emit usesPlasmaThemeChanged(); } -- cgit v0.11.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor