Skip to content

third attempt at Cards rework

This MR breaks how Card resizes because it will have a fixed size set by default (or by the user), so I suggest this MR to be merged in KF6.

  • Calculate card width in CardsGridView to reduce calculations made per size change, use card size as a base to calculate cell size
  • New widget: CardTemplate. This widget includes a background (and exposing its properties to the user) and includes some generic size setters.
  • BannerImage: allow positioning the title at vertical center, if title background does not cover enough space, it can expand horizontally to cover all of it.
  • AbstractCard:
    • better visible setters for parent items
    • strict column and row positioning
    • parent item size constraints: maximum, minimum parent item size properties
    • update doc

How to expose these chanegs to the users ?

  • kirigami-gallery
    • Needs to set CardsGridViewGallery's Label in a Card to elide to the right
    • CardsGridView gallery needs to show that changing card size is indeed possible (maximum, minimum size, or even static size)
    • CardsLayoutGallery needs to showcase an example of CardTemplate
    • Showcase changes to BannerImage with options to customize BannerImage title (color, word wrap, elide), title background (color, opacity, horizontal expansion)
  • kirigami documentation
    • CardTemplate documentation doesn't exist
    • CardsGridView documentation needs an update (card size)
Edited by Matej Starc

Merge request reports