mirror of
https://github.com/AskDavis/Casinotest.git
synced 2026-01-07 21:29:47 -08:00
Adverts widget v0.2 added:
*Querying webAPI for adverts content; *Starting browsers new tab with url specified in json file *Basic QML items and models *Overview tab layout changes *Storing images on harddrive (temporary solution) *Sending queries to webAPI straight from widget (temporary solution) coming next: -store whole json file as url/desription need to be stored for further use -display images of adverts from QImage, not from file stored on harddrive -hide/show adverts button tweaking -proper webAPI base class for querying various servers for data (prypto for instance) *
This commit is contained in:
166
src/qt/qtquick_controls/qml/QmlGUIBannerControl.qml
Normal file
166
src/qt/qtquick_controls/qml/QmlGUIBannerControl.qml
Normal file
@@ -0,0 +1,166 @@
|
||||
import QtQuick 2.2
|
||||
import CasinoCoinControls 1.0
|
||||
|
||||
GUIBannerControl
|
||||
{
|
||||
id: id_bannerControl
|
||||
|
||||
property color colorBackgroundInWidget: "#F2F0F1"
|
||||
Rectangle
|
||||
{
|
||||
id: id_leftArrow
|
||||
height: id_bannerControl.height
|
||||
width: 30
|
||||
color: colorBackgroundInWidget
|
||||
Image
|
||||
{
|
||||
id: id_leftArrowImage
|
||||
|
||||
source: "qrc:/icons/res/icons/adverts_arrow_left.png"
|
||||
|
||||
anchors.centerIn: id_leftArrow
|
||||
}
|
||||
anchors.left: id_bannerControl.left
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: id_leftArrowMouseArea
|
||||
anchors.fill: id_leftArrow
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
onEntered:
|
||||
{
|
||||
id_leftArrowImage.source = "qrc:/icons/res/icons/adverts_arrow_left_hover.png"
|
||||
id_bannerListView.m_PathView.decrementCurrentIndex()
|
||||
id_animationTimer.restart()
|
||||
}
|
||||
onExited:
|
||||
{
|
||||
id_leftArrowImage.source = "qrc:/icons/res/icons/adverts_arrow_left.png"
|
||||
id_animationTimer.stop()
|
||||
}
|
||||
onClicked:
|
||||
{
|
||||
id_bannerListView.m_PathView.decrementCurrentIndex()
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle
|
||||
{
|
||||
id: id_BannersArea
|
||||
height: id_bannerControl.height
|
||||
width: id_bannerControl.width - id_leftArrow.width - id_rightArrow.width
|
||||
color: colorBackgroundInWidget
|
||||
z: -1
|
||||
|
||||
anchors.horizontalCenter: id_bannerControl.horizontalCenter
|
||||
anchors.left: id_leftArrow.left
|
||||
Rectangle
|
||||
{
|
||||
id: id_fadeOutLeft
|
||||
|
||||
height: id_BannersArea.width / 6
|
||||
width: id_BannersArea.height
|
||||
rotation: 270
|
||||
z: 1
|
||||
|
||||
anchors.left: id_BannersArea.left
|
||||
anchors.verticalCenter: id_BannersArea.verticalCenter
|
||||
gradient:
|
||||
Gradient
|
||||
{
|
||||
GradientStop { position: 0.0; color: colorBackgroundInWidget }
|
||||
GradientStop { position: 0.7; color: "transparent" }
|
||||
GradientStop { position: 1.0; color: "transparent" }
|
||||
}
|
||||
}
|
||||
QmlGUIBannerListView
|
||||
{
|
||||
id: id_bannerListView
|
||||
|
||||
anchors.fill: id_BannersArea
|
||||
Component.onCompleted:
|
||||
{
|
||||
id_bannerControl.InitializeAdvertsView( id_bannerListView )
|
||||
}
|
||||
}
|
||||
Rectangle
|
||||
{
|
||||
id: id_fadeOutRight
|
||||
|
||||
height: id_BannersArea.width / 6
|
||||
width: id_BannersArea.height
|
||||
rotation: 90
|
||||
z: 1
|
||||
|
||||
anchors.right: id_BannersArea.right
|
||||
anchors.verticalCenter: id_BannersArea.verticalCenter
|
||||
gradient:
|
||||
Gradient
|
||||
{
|
||||
GradientStop { position: 0.0; color: colorBackgroundInWidget }
|
||||
GradientStop { position: 0.7; color: "transparent" }
|
||||
GradientStop { position: 1.0; color: "transparent" }
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle
|
||||
{
|
||||
id: id_rightArrow
|
||||
height: id_bannerControl.height
|
||||
width: 30
|
||||
color: colorBackgroundInWidget
|
||||
Image
|
||||
{
|
||||
id: id_rightArrowImage
|
||||
source: "qrc:/icons/res/icons/adverts_arrow_right.png"
|
||||
|
||||
anchors.centerIn: id_rightArrow
|
||||
}
|
||||
|
||||
anchors.right: id_bannerControl.right
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: id_rightArrowMouseArea
|
||||
anchors.fill: id_rightArrow
|
||||
|
||||
hoverEnabled: true
|
||||
|
||||
onEntered:
|
||||
{
|
||||
id_rightArrowImage.source = "qrc:/icons/res/icons/adverts_arrow_right_hover.png"
|
||||
id_bannerListView.m_PathView.incrementCurrentIndex()
|
||||
id_animationTimer.restart()
|
||||
}
|
||||
onExited:
|
||||
{
|
||||
id_rightArrowImage.source = "qrc:/icons/res/icons/adverts_arrow_right.png"
|
||||
id_animationTimer.stop()
|
||||
}
|
||||
onClicked:
|
||||
{
|
||||
id_bannerListView.m_PathView.incrementCurrentIndex()
|
||||
}
|
||||
}
|
||||
Timer
|
||||
{
|
||||
id: id_animationTimer
|
||||
interval: id_bannerListView.m_PathView.highlightMoveDuration
|
||||
running: false
|
||||
repeat: true
|
||||
onTriggered:
|
||||
{
|
||||
if ( id_rightArrowMouseArea.containsMouse )
|
||||
{
|
||||
id_bannerListView.m_PathView.incrementCurrentIndex()
|
||||
}
|
||||
if ( id_leftArrowMouseArea.containsMouse )
|
||||
{
|
||||
id_bannerListView.m_PathView.decrementCurrentIndex()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user