D22375: new class KBusyIndicatorWidget similar to QtQuick's BusyIndicator

Harald Sitter noreply at phabricator.kde.org
Wed Jul 10 14:08:08 BST 2019


sitter created this revision.
sitter added a reviewer: cfeck.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
sitter requested review of this revision.

REVISION SUMMARY
  this mimics QQC's BusyIndicator and more specifically our styling of it.
  
  KBIW loads an icon from the icon theme, scales it to the widget size
  and rotates it 360 degrees every second for as long as it is running.
  
  the intent here is to give an easy to use spinner implementation that looks
  like and feels (to the developer) like the one seen in plasma/kirigami.
  this does however somewhat infringe on the business of kpixmapsequence,
  so here's why KBIW is better for this specific use case:
  
  - not pixmap based
  - because it's not pixmap based scaling works much better for SVGs
  - since we paint a QIcon directly we don't have to manually faff about with pixmap copies/segments
  - more robust as themes may incorrectly or not at all implement the animation icon spec (which is rather offhandedly specified really). KBIW takes care of the animation so the theme need only supply a very standard icon and there is no change for things to go wrong more or less
  - because this fully leverages QIcon/KIconThemes we get full advantage of SVG coloring. i.e. when using a dark theme the icon is correctly using a contrasting color
  - users of KBIW no longer need to explicitly use KIconLoader to resolve a pixmap path

TEST PLAN
  widget works.
  not sure an autotest is worth here, there's not much to assert.

REPOSITORY
  R236 KWidgetsAddons

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D22375

AFFECTED FILES
  src/CMakeLists.txt
  src/kbusyindicatorwidget.cpp
  src/kbusyindicatorwidget.h
  tests/CMakeLists.txt
  tests/kbusyindicatorwidgettest.cpp

To: sitter, cfeck
Cc: kde-frameworks-devel, apol, LeGast00n, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190710/d640d5a8/attachment.html>


More information about the Kde-frameworks-devel mailing list