Skip to content
Commit 2631be90 authored by Harald Sitter's avatar Harald Sitter 🐧
Browse files

new class KBusyIndicatorWidget similar to QtQuick's BusyIndicator

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.

Reviewers: cfeck, apol

Reviewed By: cfeck, apol

Subscribers: ngraham, kossebau, broulik, kde-frameworks-devel, apol

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D22375
parent c69eda51
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment