[potd] Modernize configuration settings
ClosedPublic

Authored by filipf on May 2 2019, 7:56 PM.

Details

Summary

This patch replaces the ColumnLayout with Kirigami.FormLayout and make use of twinFormLayouts to link child layout with parent layout.

QQC1 comboboxes are retained due to a QQC2 bug with resizing the popup to delegate width.

Test Plan

Diff Detail

Repository
R114 Plasma Addons
Branch
modernize-potd-config (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11544
Build 11562: arc lint + arc unit
filipf created this revision.May 2 2019, 7:56 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 2 2019, 7:56 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.May 2 2019, 7:56 PM
filipf edited the test plan for this revision. (Show Details)May 2 2019, 7:57 PM
filipf added reviewers: Plasma, VDG, ngraham.
filipf added a comment.May 2 2019, 8:02 PM

Combobox popup width is still not fixed though, I have to comment on the bug report.

If it's not getting set on load, the problem is probably somewhere in those funky for loops to get and set the value of the combobox.

If you upload without the combobox changes, I'll be happy to click ship it.

filipf added a comment.EditedMay 2 2019, 10:55 PM

If you upload without the combobox changes, I'll be happy to click ship it.

The problem though I've run into with having QQC1 Combobox in the Form Layout is all the code that was used to fix its width stops working:

property int textLength: 24
width: theme.mSize(theme.defaultFont).width * textLength

And then we get quite narrow, elided comboboxes which don't match the width of the QQC2 comboxes from ConfigurationContainmentAppearance.qml. Will investigate if I can write some new code to hack the width, though my rationale here was that the QQC2 combobox was the lesser evil.

If it's not getting set on load, the problem is probably somewhere in those funky for loops to get and set the value of the combobox.

Hah yeah, possibly, although it works just fine with the QQC1 Combobox.

filipf added a comment.May 3 2019, 1:54 PM

QQC1 Comboboxes:

Hmm, that seems non-ideal. :)

filipf added a comment.EditedMay 3 2019, 3:20 PM

I could set the width of the QQC1 combobox to match the QQC2 ones above, but it won't get resized if a wider entry is selected (as is the case with QQC2). Thoughts on how to proceed?

EDIT: ignore this, I've made them resizable.

filipf updated this revision to Diff 57498.May 3 2019, 6:27 PM
  • go back to using QQC1 comboboxes
  • match the width of the QQC1 comboboxes with the top 2 QQC2 comoboxes
  • if a menu entry is longer than aforementioned width, resize the combobox
filipf updated this revision to Diff 57499.May 3 2019, 6:30 PM

minor cleanup

Nice job. But I shudder to think of how long this string must be in German or Brazilian Portuguese:

wallpapers/potd/contents/ui/config.qml
76

This should not be plural and should probably say "Provider:" or maybe even "Source:".

filipf added a comment.May 3 2019, 7:02 PM

Nice job. But I shudder to think of how long this string must be in German or Brazilian Portuguese:

We need to set a maximum width. Here's what I can do:

  1. put the combobox in a RowLayout
  2. go to ConfigurationContainmentAppearance.qml and give an ID to the "Get New Plugins..." button
  3. now set Combobox's Layout.maximumWidth property to: pluginCombobox.width + newPluginsCombobox.width + units.smallSpacing

End result:

Hmm, setting a maximum width is kind of lousy for really long strings though, because they get elided. I think it might make more sense to make sure that the window expands to accomodate a wide combobox, and them trim down that particular string. It's just way too long right now.

filipf updated this revision to Diff 57557.May 4 2019, 4:35 PM

change string "Providers:" to "Provider:"

filipf added a comment.May 4 2019, 4:35 PM

Hmm, setting a maximum width is kind of lousy for really long strings though, because they get elided. I think it might make more sense to make sure that the window expands to accomodate a wide combobox, and them trim down that particular string. It's just way too long right now.

Is there something else I should do in this diff then?

ngraham accepted this revision.May 5 2019, 8:30 PM

Few changes needed to the Description before landing:

  • Is the NOTE still accurate? I don't see that behavior anymore.
  • Also we're no longer porting to QQC2
This revision is now accepted and ready to land.May 5 2019, 8:30 PM
filipf edited the summary of this revision. (Show Details)May 5 2019, 8:39 PM

Few changes needed to the Description before landing:

  • Is the NOTE still accurate? I don't see that behavior anymore.
  • Also we're no longer porting to QQC2

Fixed. Regarding the note, nope, that was a QQC2 combobox bug.

Thanks, shipit!

This revision was automatically updated to reflect the committed changes.