Resize the preferences dialogue to avoid horizontal scrolling
Needs RevisionPublic

Authored by kadabash on Oct 8 2018, 4:18 PM.

Details

Reviewers
aacid
Group Reviewers
Okular
Summary

Scrolling horizontally for a small bit of the page feels awkward.

BUG: 373957

Diff Detail

Repository
R223 Okular
Branch
resize_config_window (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 3644
Build 3662: arc lint + arc unit
kadabash created this revision.Oct 8 2018, 4:18 PM
Restricted Application added a project: Okular. · View Herald TranscriptOct 8 2018, 4:18 PM
Restricted Application added a subscriber: okular-devel. · View Herald Transcript
kadabash requested review of this revision.Oct 8 2018, 4:18 PM

Screenshot before change:

Screenshot after change

aacid added a comment.Oct 8 2018, 4:46 PM

629 is a random number, random numbers are bad.

What about people using other styles? other fonts?

ngraham added a subscriber: ngraham.

@aacid is correct. If the size is not being set correctly, we should look at the dialog's sizeHint rather than overriding it entirely.

ngraham edited the summary of this revision. (Show Details)Oct 8 2018, 4:48 PM

You are right, of course. Magic constants are bad.

I could not, however, find a way to obtain the side bar width in order to calculate the correct sizeHint of the dialogue.
The only way I could get it to work is by modifying the KConfigDialog::KConfigDialogPrivate::addPageInternal() function in the KConfigWidgets library.

Would such a change even be considered to solve this minor issue?

In Dolphin, the solution also seems to have been a magic constant (see the relevant line in dolphinsettingsdialog.cpp).

aacid added a comment.Oct 9 2018, 7:04 PM

If you can fix this correctly once in KConfigDialog instead of adding bad magic numbers everywhere, fixing it in KConfigDialog seems to be a no brainer (maybe with an flag option to not change behaviour for people that don't want that)

aacid requested changes to this revision.Jun 22 2019, 3:00 PM

Setting to requested changes to clean it from my queue.

This revision now requires changes to proceed.Jun 22 2019, 3:00 PM

Similar incorrect solution as the one suggested in D21910.

Might be worth some time investigating why the window gets the wrong sizeHint.