Skip to content
Snippets Groups Projects
Commit 7acb2709 authored by Kirill Anisimov's avatar Kirill Anisimov
Browse files

Moved Scroll Button icons to properties.

parent 78be4677
No related branches found
No related tags found
1 merge request!18Features 2923
This commit is part of merge request !18. Comments created here will be created in the context of that merge request.
...@@ -45,11 +45,11 @@ DapScrollViewForm ...@@ -45,11 +45,11 @@ DapScrollViewForm
{ {
if (scrollButton.state === "goUp") if (scrollButton.state === "goUp")
{ {
scrollButton.imageSource = "qrc:/res/icons/ic_scroll-down_hover.png" scrollButtonImage.source = scrollDownButtonHoveredImageSource
} }
else if (scrollButton.state === "goDown") else if (scrollButton.state === "goDown")
{ {
scrollButton.imageSource = "qrc:/res/icons/ic_scroll-up_hover.png" scrollButtonImage.source = scrollUpButtonHoveredImageSource
} }
} }
...@@ -57,11 +57,11 @@ DapScrollViewForm ...@@ -57,11 +57,11 @@ DapScrollViewForm
{ {
if (scrollButton.state === "goUp") if (scrollButton.state === "goUp")
{ {
scrollButton.imageSource = "qrc:/res/icons/ic_scroll-down.png" scrollButtonImage.source = scrollDownButtonImageSource
} }
else if (scrollButton.state === "goDown") else if (scrollButton.state === "goDown")
{ {
scrollButton.imageSource = "qrc:/res/icons/ic_scroll-up.png" scrollButtonImage.source = scrollUpButtonImageSource
} }
} }
......
...@@ -3,10 +3,16 @@ import QtQuick 2.4 ...@@ -3,10 +3,16 @@ import QtQuick 2.4
MouseArea MouseArea
{ {
id: dapScrollMouseArea id: dapScrollMouseArea
////@ Icons for Scroll Button
property string scrollDownButtonImageSource: ""
property string scrollDownButtonHoveredImageSource: ""
property string scrollUpButtonImageSource: ""
property string scrollUpButtonHoveredImageSource: ""
////@ ListView to attach the ScrollButton ////@ ListView to attach the ScrollButton
property ListView viewData: ListView {} property ListView viewData: ListView {}
property alias scrollMouseArea: dapScrollMouseArea property alias scrollMouseArea: dapScrollMouseArea
property alias scrollButton: dapScrollButton property alias scrollButton: dapScrollButton
property alias scrollButtonImage: dapScrollButtonImage
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
...@@ -14,7 +20,6 @@ MouseArea ...@@ -14,7 +20,6 @@ MouseArea
MouseArea MouseArea
{ {
id: dapScrollButton id: dapScrollButton
property string imageSource: "qrc:/res/icons/ic_scroll-down.png"
width: 36 * pt width: 36 * pt
height: width height: width
anchors.right: parent.right anchors.right: parent.right
...@@ -27,9 +32,10 @@ MouseArea ...@@ -27,9 +32,10 @@ MouseArea
Image Image
{ {
id: dapScrollButtonImage
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: dapScrollButton.imageSource source: scrollDownButtonImageSource
sourceSize.height: parent.height sourceSize.height: parent.height
sourceSize.width: parent.width sourceSize.width: parent.width
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment