WIP: Save PanelView settings in terms of grid units
AbandonedPublic

Authored by davidedmundson on Jun 23 2016, 8:04 PM.

Details

Reviewers
None
Group Reviewers
Plasma
Summary

This is useful for HighDPI otherwise a user needs to manually resize the
panel initially and/or after they change high DPI settings.

It also means if you adjust the font the panel will resize in proportion
to the contents resizing so it won't all end up cramped.

Reason it's a WIP, we need to:

  • fix scripting (just a copy and paste of this)
  • a migration solution.

It'll take as long to write that as this whole patch, so I want to check
we're happy with the idea first.

Diff Detail

Repository
R120 Plasma Workspace
Branch
arcpatch-D1976
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson retitled this revision from to WIP: Save PanelView settings in terms of grid units.
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
davidedmundson added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptJun 23 2016, 8:04 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart added a subscriber: mart.Jun 28 2016, 8:23 AM
mart added inline comments.
shell/panelview.cpp
1096

why adding a new setter and getter that work in pixels? if something like that should be added, i wuld like just working with grid units.

perhaps having the old thickness/setThickness etc that still accept sizes in pixels for compatibility and have new setUnitsThickness or whatever that accepts units?

1098

in the scripting the m height is binded, not the width

mart added a comment.Jun 28 2016, 8:37 AM

anyways, i like the idea.

uh, also no more plans of supporting QT_SCREEN_SCALE_FACTORS instead? (in this case the pixel based sizes should be just fine as they would be scaled?)

uh, also no more plans of supporting QT_SCREEN_SCALE_FACTORS instead? (in this case the pixel based sizes should be just fine as they would be scaled?)

We /could/ but using a hybrid of two scaling systems seems like it'll get complex

shell/panelview.cpp
1096

I can, but that just moves the conversion into being in multiple places instead of just 1.

None of the other users of the thickness (the drag handles or working out the workspace screen area) want grid units.

1098

you're right.

int gridUnit = QFontMetrics(QGuiApplication::font()).boundingRect(QStringLiteral("M")).height();

Will fix.

davidedmundson abandoned this revision.Nov 15 2017, 3:32 PM

Can't remember what the state of this is, and the original code probably changed. Closing.