D18341: Support icons from local files in buttons
Nicolas Fella
noreply at phabricator.kde.org
Thu Jan 17 22:08:26 GMT 2019
nicolasfella created this revision.
nicolasfella added reviewers: Plasma, mart.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
nicolasfella requested review of this revision.
REVISION SUMMARY
Trying to assign an icon from a file to a button like in
import QtQuick 2.2
import QtQuick.Controls 2.4
Button {
icon.source: "/usr/share/icons/breath/emotes/22/face-smirk.svg"
}
results in no icon being shown. The current code interprets the filename as QString and tries to load an icon with that name from the theme, which obviously doesn't exist. This patch checks whether the icon points to a local file
and if it is loads it. If not it falls back to loading it from the theme.
TEST PLAN
Above code now correctly displays a face.
Ran systemsettings, checked QML KCMs' buttons for icons
REPOSITORY
R858 Qt Quick Controls 2: Desktop Style
BRANCH
icons
REVISION DETAIL
https://phabricator.kde.org/D18341
AFFECTED FILES
plugin/kquickstyleitem.cpp
To: nicolasfella, #plasma, mart
Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190117/b9bdbc61/attachment.html>
More information about the Plasma-devel
mailing list