Comment 7 for bug 1327614

Revision history for this message
Daniel Schürmann (daschuer) wrote :

> I thought that I saw an example of conditional image rendering somewhere in the codebase but it eludes me at the moment. Know of any?

Probably this:
https://github.com/mixxxdj/mixxx/blob/0d89ecbdaaa1a785665fe5791222fa3ef8dd4467/src/widget/wpixmapstore.cpp

----

> I'm wondering if getIcon() should be abstracted a level up ...

Yes, good idea. But the Icon name should be still set inside the specific feature (child class)

What about a
LibraryFeature::getIcon()

And a virtual RecordingFeature::getIconName()

Pseudo code:
LibraryFeature::getIcon() {
    Name = getIconName()
    icon = Look up in skin
    if nothing found {
         icon = Lookup from resources
    }