Bug 338605 - The QML code uses hardcoded icon paths
Summary: The QML code uses hardcoded icon paths
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: call-ui (show other bugs)
Version: git-latest
Platform: Other Linux
: NOR normal
Target Milestone: 0.8.80
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-27 21:32 UTC by Martin Klapetek
Modified: 2014-08-28 00:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Klapetek 2014-08-27 21:32:16 UTC
An example:

    function changeHoldIcon(icon) {
        if (icon == "start") {
            hold.iconSource= "/usr/share/icons/oxygen/32x32/actions/media-playback-start.png"
        } else {
            hold.iconSource= "/usr/share/icons/oxygen/32x32/actions/media-playback-pause.png"
        }
    }
Comment 1 Matt Scheirer 2014-08-27 22:23:14 UTC
You can use iconName with a bunch of QML elements to specify icons according to the Freedesktop Naming Scheme (see here: http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html) that will inherit the users icon theme settings, and you can supply a fallback.

Here is an example from one of my other apps I just ripped out to show:

  Action {
    iconName: playing ? "media-playback-pause" : "media-playback-start"
    iconSource: playing ? "icons/kfaenza_media-pause.png" : "icons/kfaenza_media-play.png"
  }

If the iconName has a corresponding system icon, it uses that first. If it does not exist, it falls back to my specified iconSource, in which case I just bundled the kfaenza theme icons in case, but in my experience I've never found a circumstance where this fails. I don't use it anymore - this was just from some old code I had early on.

So instead of setting iconSource, set iconName.
Comment 2 David Edmundson 2014-08-27 22:25:08 UTC
Thanks, but I assume you're talking about QtQuick.Controls.

I'm afraid this is all Qt4 code, just to make our lives harder.
Comment 3 David Edmundson 2014-08-27 22:26:42 UTC
kdeclarative provided an icon:// image provider. 

Given we use use kdeclarative (hopefully?) it should mean it's added automagically.
Comment 4 Martin Klapetek 2014-08-27 22:49:34 UTC
> Given we use use kdeclarative (hopefully?)

Not as far as I see. Should be added then.
Comment 5 David Edmundson 2014-08-28 00:51:29 UTC
Git commit a82a6b998b56abc4f2a271f57b213fa25e4d0582 by David Edmundson.
Committed on 28/08/2014 at 00:52.
Pushed by davidedmundson into branch 'master'.

Set icons properly

Reviewed-by: Diane Trout

M  +1    -0    CMakeLists.txt
M  +1    -0    src/CMakeLists.txt
M  +6    -0    src/dtmf-qml.cpp
M  +8    -0    src/qml-interface.cpp
M  +1    -2    src/qml/core/ToggleButton.qml
M  +7    -7    src/qml/core/Toolbar.qml

http://commits.kde.org/telepathy-call-ui/a82a6b998b56abc4f2a271f57b213fa25e4d0582