Use ShadowedRectangle for Card backgrounds
ClosedPublic

Authored by ahiemstra on Apr 6 2020, 2:55 PM.

Details

Summary

This switches cards to use ShadowedRectangle for their background. It also refreshes their
design a bit, based on feedback from the VDG.

Still WIP because of potential design issues and I'm not entirely happy with the code for
the actual cards. Ideally I'd also move a bunch of this stuff to C++ but that'd involve a
reimplementing a bunch of Control behaviour.

BUG: 415526

Test Plan

New cards, normal colour scheme:

Breeze Dark:

Diff Detail

Repository
R169 Kirigami
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahiemstra created this revision.Apr 6 2020, 2:55 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptApr 6 2020, 2:55 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Apr 6 2020, 2:55 PM
ahiemstra edited the test plan for this revision. (Show Details)Apr 6 2020, 2:56 PM
cblack accepted this revision.Apr 6 2020, 3:01 PM
cblack added a subscriber: cblack.

Looks like a nice visual improvement.

Are the changes to the scenegraph stuff related? They don't look like a related change to making the Kirigami.Card use the ShadowedRectangle to me.

This revision is now accepted and ready to land.Apr 6 2020, 3:01 PM
nicolasfella edited the summary of this revision. (Show Details)Apr 6 2020, 3:20 PM
ngraham added a subscriber: ngraham.Apr 6 2020, 4:46 PM

Dang this looks so good. +1 for the visuals at least.

ahiemstra retitled this revision from [WIP] Use ShadowedRectangle for Card backgrounds to Use ShadowedRectangle for Card backgrounds.Apr 20 2020, 10:15 AM
mart added a subscriber: mart.Apr 20 2020, 11:24 AM

Looks like a nice visual improvement.

Are the changes to the scenegraph stuff related? They don't look like a related change to making the Kirigami.Card use the ShadowedRectangle to me.

they should be, as far i know, a fix for the 1 pixel border that had some blurriness.
@ahiemstra can you confirm?

mart added inline comments.Apr 20 2020, 11:26 AM
src/controls/AbstractCard.qml
30

as we have a ColorUtils class now, since i've seen this super long thing just to make a color translucent many things, is maybe worth to have a ColorUtils.opacity(Kirigami.Theme.highlightColor, 0.3) instead?

mart accepted this revision.Apr 20 2020, 11:26 AM
In D28625#652529, @mart wrote:

Looks like a nice visual improvement.

Are the changes to the scenegraph stuff related? They don't look like a related change to making the Kirigami.Card use the ShadowedRectangle to me.

they should be, as far i know, a fix for the 1 pixel border that had some blurriness.
@ahiemstra can you confirm?

They're both things I encountered while implementing this. One is a crash fix, the other is indeed a fix for pixel correctness.

src/controls/AbstractCard.qml
30

This basically does the same thing as Kirigami.Separator. I think it'd be good to have this entire thing in ColorUtils yeah.

ahiemstra updated this revision to Diff 80735.Apr 21 2020, 9:40 AM
  • Rebase on most recent master
  • Use ShadowedRectangleNode for ShadowedTexture if source is not set
  • Use transparent color for BannerImage's ShadowedImage
  • Hide BannerImage scrim if source or title is not set
  • Don't set ShadowedTexture source if Image is not properly loaded
  • Add tintWithAlpha method to ColorUtils
  • Use new tintWithAlpha for border colors
mart accepted this revision.Apr 21 2020, 9:51 AM
This revision was automatically updated to reflect the committed changes.

This seems to be causing regressions to card behaviour for me.

Cards are running together when they weren't previously:

The images are:

  1. having non-deterministic texture issues (amdgpu/Mesa)
  2. getting distorted when they previously weren't

Additionally, this appears to be having a non-trivial performance regression to large amounts of cards, as Ikona will freeze for much longer with this patch in its Icon Browser than without cards.

Additionally, console output spams something like this when cards are involved:

/usr/lib64/qml/org/kde/kirigami.2/AbstractCard.qml:31: TypeError: Type error (file:////usr/lib64/qml/org/kde/kirigami.2/AbstractCard.qml:31, )