From a7423b4b997cb9d7740ba834f55a04068242b09c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 27 Sep 2016 12:23:34 +0200 Subject: [PATCH] feat(ForceScrollBar): supports hovered color --- tests/ui/modules/Linphone/ForceScrollBar.qml | 8 ++++++-- tests/ui/modules/Linphone/Styles/DialogStyle.qml | 1 + tests/ui/modules/Linphone/Styles/ForceScrollBarStyle.qml | 9 ++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/ui/modules/Linphone/ForceScrollBar.qml b/tests/ui/modules/Linphone/ForceScrollBar.qml index 464920a33..3c60bee4f 100644 --- a/tests/ui/modules/Linphone/ForceScrollBar.qml +++ b/tests/ui/modules/Linphone/ForceScrollBar.qml @@ -9,10 +9,14 @@ ScrollBar { background: ForceScrollBarStyle.background contentItem: Rectangle { color: pressed - ? ForceScrollBarStyle.pressedColor - : ForceScrollBarStyle.color + ? ForceScrollBarStyle.color.pressed + : (hovered + ? ForceScrollBarStyle.color.hovered + : ForceScrollBarStyle.color.normal + ) implicitHeight: ForceScrollBarStyle.contentItem.implicitHeight implicitWidth: ForceScrollBarStyle.contentItem.implicitWidth radius: ForceScrollBarStyle.contentItem.radius } + hoverEnabled: true } diff --git a/tests/ui/modules/Linphone/Styles/DialogStyle.qml b/tests/ui/modules/Linphone/Styles/DialogStyle.qml index 1faddf315..995462edf 100644 --- a/tests/ui/modules/Linphone/Styles/DialogStyle.qml +++ b/tests/ui/modules/Linphone/Styles/DialogStyle.qml @@ -21,6 +21,7 @@ QtObject { property QtObject description: QtObject { property int fontSize: 12 property int verticalMargin: 25 + property string color: Constants.colors.l } } diff --git a/tests/ui/modules/Linphone/Styles/ForceScrollBarStyle.qml b/tests/ui/modules/Linphone/Styles/ForceScrollBarStyle.qml index 09465c218..514641986 100644 --- a/tests/ui/modules/Linphone/Styles/ForceScrollBarStyle.qml +++ b/tests/ui/modules/Linphone/Styles/ForceScrollBarStyle.qml @@ -4,9 +4,6 @@ import QtQuick 2.7 import Linphone 1.0 QtObject { - property string color: Constants.colors.c - property string pressedColor: Constants.colors.b - property Rectangle background: Rectangle { color: Constants.colors.a } @@ -16,4 +13,10 @@ QtObject { implicitWidth: 8 radius: 10 } + + property QtObject color: QtObject { + property string hovered: Constants.colors.h + property string normal: Constants.colors.c + property string pressed: Constants.colors.b + } }