Minor fix for plasma folder view filename editor
ClosedPublic

Authored by chinmoyr on Dec 31 2016, 10:26 AM.

Details

Summary

In filename editor(when wrap mode is on) the content height and height of Plasma::TextArea are out of sync.
When text is added the height of TextArea increases as expected but when text is deleted the height doesn't decrease.

This patch attempts to fix the issue.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
chinmoyr updated this revision to Diff 9537.Dec 31 2016, 10:26 AM
chinmoyr retitled this revision from to Minor fix for plasma folder view filename editor.
chinmoyr updated this object.
chinmoyr edited the test plan for this revision. (Show Details)
chinmoyr added a reviewer: Plasma.
chinmoyr set the repository for this revision to R119 Plasma Desktop.
Restricted Application added a project: Plasma. · View Herald TranscriptDec 31 2016, 10:26 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Good find but why does it need to compare _height with contentHeight in the beginning at all? Normally what should imo happen is simply:

  • Compare realHeight with max possible height maxHeight
  • If larger, set _height = realHeight, else _height = maxHeight

So just: _height = Math.min(realHeight, maxHeight)

chinmoyr updated this revision to Diff 9540.Dec 31 2016, 12:06 PM
romangg accepted this revision.Jan 2 2017, 9:37 AM
romangg added a reviewer: romangg.

Just a nitpick: Since you have realHeight as the first argument, maybe also define it as first.

This revision is now accepted and ready to land.Jan 2 2017, 9:37 AM
hein accepted this revision.Jan 2 2017, 10:53 AM
hein added a reviewer: hein.
hein added a subscriber: hein.

This was actually intentional in the original patch, the author preferred to expand but not shrink, and I didn't mind. I also don't mind shrinking though, I see Roman's point here (IRC):

‎[19:51] ‎<‎romangg‎>‎ Don't quite see how this could be unergonomic. tried it out myself and it works well when the text are is also shrinking. In fact it's somehow missleading if it doesn't because it looks like you've pressed space bar a lot or enter key.

Accepting.

chinmoyr updated this revision to Diff 9606.Jan 2 2017, 3:54 PM
chinmoyr edited edge metadata.
This revision was automatically updated to reflect the committed changes.