adjust smb kcm size to be sufficient vis a vis headers
ClosedPublic

Authored by sitter on Apr 8 2020, 12:22 PM.

Details

Summary

we use Stretch to get a somewhat uniform appearance between the two views
but Stretch is bit meh when it comes to actual sizing as it acts kind of
like QSizePolicy::Preferred in that it allows shrinking columns so small
that even the header gets cut off. this of course looks silly, so we
now set the largest required width as minimal section width. this prevents
the user from cutting off headers by resizing the window.

secondly, and entirely related to that, because KCMs are embedded into
a scrollview their sizehint kinda doesn't make any difference for
the window size which then combined with the aforementioned stretch problem
can lead to cut off headers by default as the window size is too small
making the stretch cut into header text.
to ensure the default size is reasonable let the view adjust to content
on first show, effectively making the window as large as needed
regardless of implicit hints.

BUG: 419786
FIXED-IN: 5.18.5

Test Plan
  • empty dialog
  • dialog with only shares
  • dialog with shares and mounts

Diff Detail

Repository
R102 KInfoCenter
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Apr 8 2020, 12:22 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 8 2020, 12:22 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sitter requested review of this revision.Apr 8 2020, 12:22 PM
ngraham accepted this revision.Apr 9 2020, 4:22 PM

I really wish that KCMshell didn't add its own scrollview, so we didn't end up with issues like this. The KCM itself should be responsible for its own layouting needs.

Then again I also wish we didn't have KCMshell at all and that opening a specific KCM just opened system settings/kinfocenter. It would eliminate this entirely class of kcmshell sizing bugs immediately.

Oh well, LGTM.

This revision is now accepted and ready to land.Apr 9 2020, 4:22 PM
This revision was automatically updated to reflect the committed changes.
mart added a subscriber: mart.Apr 14 2020, 2:15 PM

I really wish that KCMshell didn't add its own scrollview, so we didn't end up with issues like this. The KCM itself should be responsible for its own layouting needs.

Then again I also wish we didn't have KCMshell at all and that opening a specific KCM just opened system settings/kinfocenter. It would eliminate this entirely class of kcmshell sizing bugs immediately.

Oh well, LGTM.

I think I'll take a look into that (i mean, replacing kcmshell with systemsettings)

In D28678#648072, @mart wrote:

I think I'll take a look into that (i mean, replacing kcmshell with systemsettings)

<3 <3 <3