[Icon Item] Fix updating implicit size when icon sizes change
ClosedPublic

Authored by broulik on Jan 8 2017, 11:24 AM.

Details

Summary

The old code was connecting the KIconLoader signal to implicitWidth/HeightChanged but never actually set a new implicit size.
Also, while at it use "setImplicitSize" - it's also marke internal but public like setSize and uses qreal instead of QSizeF.

Test Plan

Comes with a unit test

Also ran the following in qml scene and changed settings, the icon item would adjust itself:

import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore

Item {
    width: 500
    height: 500

    PlasmaCore.IconItem {
        source: "user-home"
    }
}

I wonder if we shouldn't scale the implicit size with Units

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik updated this revision to Diff 9840.Jan 8 2017, 11:24 AM
broulik retitled this revision from to [Icon Item] Fix updating implicit size when icon sizes change.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added a reviewer: Plasma.
broulik set the repository for this revision to R242 Plasma Framework (Library).
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptJan 8 2017, 11:24 AM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
davidedmundson accepted this revision.Jan 8 2017, 1:48 PM
davidedmundson added a reviewer: davidedmundson.
This revision is now accepted and ready to land.Jan 8 2017, 1:48 PM
This revision was automatically updated to reflect the committed changes.