diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-04-10 11:22:34 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-04-18 08:39:28 +0000 |
commit | 9fc3659a678e6d1bd6b2514486bde1d1725963da (patch) | |
tree | 1f77d42e155a9702cdc4a0e36f5eba01ffd217b1 /src/imports/controls/Dial.qml | |
parent | 626977958873752c264604d93cc3564f46aab731 (diff) |
Replace QQuickColorImageProvider with QQuickColorImage
Now that QQuickImage is exported, we can colorize images using a
simple QQuickImage subclass instead of using an image provider. The
main issue with QQuickColorImageProvider was that it was based on
QGuiApplication::devicePixelRatio(). Now each QQuickColorImage handles
its device pixel ratio correctly depending on which screen it is on.
Even though we now have to use two bindings (color and source) instead
of encoding the color to the source, at the same time we can remove the
sourceSize bindings that were added as image provider specific high DPI
workarounds (ca87ab8).
Task-number: QTBUG-58925
Change-Id: Iba14d2afe3bda540189682ba5be7c58d907d88f7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/Dial.qml')
-rw-r--r-- | src/imports/controls/Dial.qml | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml index 555ce340..db8203fe 100644 --- a/src/imports/controls/Dial.qml +++ b/src/imports/controls/Dial.qml @@ -53,15 +53,14 @@ T.Dial { opacity: control.enabled ? 1 : 0.3 } - handle: Image { + handle: ColorImage { id: handleItem x: background.x + background.width / 2 - handle.width / 2 y: background.y + background.height / 2 - handle.height / 2 width: 14 height: 10 - source: "image://default/dial-indicator/" + (control.visualFocus ? Default.focusColor : Default.textColor) - sourceSize.width: width - sourceSize.height: height + color: control.visualFocus ? Default.focusColor : Default.textColor + source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/dial-indicator.png" antialiasing: true opacity: control.enabled ? 1 : 0.3 transform: [ |