GridViewKCM expose a property to disable the GridView in a KCM without disabling the whole KCM
AbandonedPublic

Authored by crossi on Nov 25 2019, 2:09 PM.

Details

Reviewers
ervin
bport
mart
davidedmundson
Group Reviewers
Plasma
Summary

Some KCM use GridViewKCM as root item, and they may have extra items appended in the footer. Setting 'enabled: false' property of the root item, will disable the whole page, including the header and footer as well. This patch allow to enable/disable only the GridView.

Diff Detail

Repository
R296 KDeclarative
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 19142
Build 19160: arc lint + arc unit
crossi created this revision.Nov 25 2019, 2:09 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 25 2019, 2:09 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
crossi requested review of this revision.Nov 25 2019, 2:09 PM
broulik added a subscriber: broulik.EditedNov 25 2019, 2:18 PM

Can't you do view.enabled: false?
Edit: Never mind, view is bound to scroll.view, not scroll

Can't you do view.enabled: false?
Edit: Never mind, view is bound to scroll.view, not scroll

I did, but the GridView's style was not updateed to show it was disabled.

ervin accepted this revision.Nov 26 2019, 10:29 AM
This revision is now accepted and ready to land.Nov 26 2019, 10:29 AM

Throwing out an alternative suggestion

readonly property alias gridContainer: scroll

(and then your code calling gridContainer.enabled = whatever)

It's more generic for any future stuff, and it solves the issue of trying to convey the difference between "view.enabled" and "viewEnabled"

Throwing out an alternative suggestion

readonly property alias gridContainer: scroll

(and then your code calling gridContainer.enabled = whatever)

It's more generic for any future stuff, and it solves the issue of trying to convey the difference between "view.enabled" and "viewEnabled"

I has the downside of throwing any possibility of encapsulation through the window though... Your call I'd say but that's something to keep in mind.

Alternatively we could fix the scroll view container taking into account the scroll enabled, so that view.enabled does the right thing

Yeah, but we clearly have at least one reason to break the encapsulation.
I can imagine a need to externally force scroll position.

I'm not forcing my version either, just wanted it considered

@notmart I think you have final call?

Alternatively we could fix the scroll view container taking into account the scroll enabled, so that view.enabled does the right thing

enabled is transitive, so having a parent depend on a child would be a loop.

Alternatively we could fix the scroll view container taking into account the scroll enabled, so that view.enabled does the right thing

You mean the other way around right? Like in scroll enabled would be bound to view.enabled? I think I like that in fact, would make the API clearer.

mart added a comment.Nov 26 2019, 11:12 AM

now Kirigami.WheelHandler doesn't scroll disabled views anymore.
This may be enough to not require this (just view.enabled: false), perhaps scrollbars and background could update their look as well on the style side.

mart requested changes to this revision.Nov 26 2019, 11:12 AM

test with kirigami master and let's reevaluate later if this is still needed

This revision now requires changes to proceed.Nov 26 2019, 11:12 AM
crossi abandoned this revision.Nov 26 2019, 2:49 PM

No longer need since 866d3f45b84e