D15744: [weather applet] Fix unwanted ruling of implicit icon sizes on displayed size

Kai Uwe Broulik noreply at phabricator.kde.org
Tue Sep 25 13:59:30 BST 2018


broulik requested changes to this revision.
broulik added a comment.
This revision now requires changes to proceed.


  I think all of this could be cleaned up significantly

INLINE COMMENTS

> ForecastView.qml:38
>          PlasmaComponents.Label {
> +            readonly property int preferredWidth: implicitWidth
> +

`Layout.preferredWidth` defaults to `implicitWidth`, see [1] on the "preference order"

[1] https://doc.qt.io/qt-5/qtquicklayouts-overview.html#specifying-preferred-size

> ForecastView.qml:119
> +                        }
> +                        mw = Math.max(mw, children[i].preferredWidth);
>                      }

You can just do `children[i].Layout.preferredWidth`, no need for a "proxy" property

Also, shouldn't it rather be

  for (var i = 0; i < repeater.count; ++i) {
      var child = repeater.itemAt(i);
      ...
  }

Also I *think* that should auto-propagate, no?

REPOSITORY
  R114 Plasma Addons

REVISION DETAIL
  https://phabricator.kde.org/D15744

To: kossebau, broulik
Cc: plasma-devel, 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/20180925/c1d9bbaa/attachment-0001.html>


More information about the Plasma-devel mailing list