PanelView length cleanup
ClosedPublic

Authored by davidedmundson on Mar 17 2016, 1:52 PM.

Details

Reviewers
mart
Group Reviewers
Plasma
Summary

don't set min and max sizes twice. We would set it, which would trigger a resize event..which would position panel which would set them again.

Remove rather incorrect emit
We've clearly not changed any of these properties in this method.

Don't save and restore panel length
length gets overriden from the QML side so there is no point loading and
restoring it.


This patch puts all logic for resizing the panel within panelview, with Panel.qml providing only a size hint.
Resizing and positioning are discrete functions which only do their one job, rather than both doing a mismatch.

Seems to fix resizing actually working reliably.

(patch requires change in plasma-desktop)

Test Plan

Set a middle a aligned panel.

added items to/from the taskbar, it resized when I added an item, it resized again when I removed an item up to the user set min/max.

Diff Detail

Repository
R120 Plasma Workspace
Branch
zzzz
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson retitled this revision from to Don't set min and max size of window twice.
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
Restricted Application added a project: Plasma. · View Herald TranscriptMar 17 2016, 1:52 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
  • Don't set min and max size of window twice
  • Remove rather incorrect emit
  • Don't set min and max size of window twice
davidedmundson retitled this revision from Don't set min and max size of window twice to PanelView length cleanup.Mar 17 2016, 2:05 PM
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
davidedmundson added a reviewer: Plasma.
mart added a subscriber: mart.Mar 17 2016, 2:25 PM
mart added inline comments.
shell/panelview.cpp
282

hmm, now resize doesn't position anymore?
does centered or right alignments still work?

shell/panelview.h
189

are you sure you actually need to keep m_contentLength ?
instead of storing it the actual window size (width or height depending from orientation) could always be used instead

davidedmundson added inline comments.Mar 17 2016, 3:02 PM
shell/panelview.cpp
282

it does, because resize calls resizeEvent, which calls position.

shell/panelview.h
189

the reason I keep it is because t's possible for the contents to want to be longer than the user set maximum, or shorter than the user set minimum (which will limit the window size)

by keeping it if we change the min/max size we can adjust to the right value instantly

mart accepted this revision.Mar 17 2016, 3:10 PM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Mar 17 2016, 3:10 PM
aacid closed this revision.Feb 27 2017, 12:12 AM
aacid added a subscriber: aacid.

12f7cbf50df173691f4d60291908cfc11268d8e2