add a background in ScrollView
ClosedPublic

Authored by mart on Oct 27 2017, 3:02 PM.

Details

Summary

add a background in scrollview similar to what qwidget's scrollviews do
hide it by default since is not something that seems much in line with qqc2

the api to show it would be scrollview.background.visible = true

which is not really public/nice but it would work without adding extra api

Test Plan

tested with the new design of qml kcms

Diff Detail

Repository
R858 Qt Quick Controls 2: Desktop Style
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Oct 27 2017, 3:02 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 27 2017, 3:02 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

In general ++. The frame is useful for keyboard focus indication if nothing else.

org.kde.desktop/ScrollView.qml
47

As in a textedit?

The QQC1 code used "frame" which is semantically more appropriate.

Did you do this to get the white background?

In QWidgets a scrollarea is transparent, and an itemview is white.

I think we might need some way (extra Kirigami class ?) to have both.

I suggest holding out on merging till we do a bit more KCM porting and figure that out.

82

:D

maybe don't find and replace this

mart added a comment.Oct 30 2017, 2:42 PM

so, may be worth to have in kirigami a component called like ItemScrollView intended for this?

davidedmundson requested changes to this revision.Nov 16 2017, 10:57 AM

so, may be worth to have in kirigami a component called like ItemScrollView intended for this?

I think so.
The component can be just one line of ScrollView{}, and the styles can do something like

if typeOf(control) == "ItemView"

Also we shoudn't use "edit" as the elementType for something that's not a textedit now that we control the C++ classes.

This revision now requires changes to proceed.Nov 16 2017, 10:57 AM
mart added a comment.Nov 16 2017, 2:53 PM

so, may be worth to have in kirigami a component called like ItemScrollView intended for this?

I think so.
The component can be just one line of ScrollView{}, and the styles can do something like

hmm, tough if is in Kirigami i can't really use the desktop style private plugin to paint it, or would be cross dependency?

if typeOf(control) == "ItemView"

afaik typeof doesn't work there, all qml item will just return "Object", so the only way is to testing the presence of some properties and hope it goes well :/

mart added a comment.Nov 17 2017, 3:48 PM

tried a version which provides its own component in the kcm controls for the background problem, still not happy about it.
https://phabricator.kde.org/D8692

mart updated this revision to Diff 22637.Nov 20 2017, 12:04 PM
  • create the background only after onCompleted
mart updated this revision to Diff 22638.Nov 20 2017, 12:05 PM

frame background

mart updated this revision to Diff 22639.Nov 20 2017, 12:06 PM

fix fix and replace problems

mart marked 2 inline comments as done.Nov 20 2017, 12:06 PM
davidedmundson accepted this revision.Nov 20 2017, 12:12 PM

Can you throw in a tonne of documentation explaining why things are being done the way they are.

This revision is now accepted and ready to land.Nov 20 2017, 12:12 PM
mart updated this revision to Diff 22647.Nov 20 2017, 1:15 PM
  • component can't be a child of scrollview
This revision was automatically updated to reflect the committed changes.