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

Authored by kossebau on Sep 25 2018, 12:19 PM.

Details

Summary

BUG: 398960
FIXED-IN: 5.14.0

Test Plan

Switching icon sets between newaita, Breeze, or Oxygen no longer results in
different (too large) icon sizes to be used.

Diff Detail

Repository
R114 Plasma Addons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Sep 25 2018, 12:19 PM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 25 2018, 12:19 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Sep 25 2018, 12:19 PM
broulik requested changes to this revision.Sep 25 2018, 12:59 PM

I think all of this could be cleaned up significantly

applets/weather/package/contents/ui/ForecastView.qml
38

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

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

114

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?

This revision now requires changes to proceed.Sep 25 2018, 12:59 PM

Thanks for look, Will update based on feedback later today.

applets/weather/package/contents/ui/ForecastView.qml
38

I did this code to spare some `if Layout && Layout.preferredWidth && Layout.preferredWidth > 0 { use Layout.preferredWidth } else { else use implicitWidth) in the calculation, seems that was not obvious outside my brain :)
Guess I should then not do that optimization, no big loss, will change.

114

Had not yet tried to look at repeater childs, let me try that.

At least from what I remember about testing any auto-propagation from repeater & loader, this did not work as expected, so I turned to do all explicitly. Though not exactly sure what you mean with "that"?

kossebau updated this revision to Diff 42309.Sep 25 2018, 2:32 PM
kossebau marked an inline comment as done.
  • use Repeater.count & Repeater.itemAt(i)
  • drop additional property preferredWidth on cell items, calculate from normal properties
broulik accepted this revision.Sep 25 2018, 2:48 PM
This revision is now accepted and ready to land.Sep 25 2018, 2:48 PM
This revision was automatically updated to reflect the committed changes.