Commit 433cbec8 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen Committed by GitHub

Merge pull request #33 from neochapay/master

Update ButtonRow and fix CheckBox style
parents 7606980a b7eb4320
Name: qt5-qtquickcontrols-nemo
Summary: Nemomobile Qt Quick Controls
Version: 5.1.0
Version: 5.1.1
Release: nemo1
Group: Qt/Qt
License: LGPLv2.1 with exception or GPLv3
......
......@@ -50,14 +50,20 @@ Rectangle {
Rectangle{
id: selecter
height: 50
x: rowElement.children[main.currentIndex].x || 0
y: -5
width: rowElement.children[main.currentIndex].width || 0
height: 50
color: "#0091e5"
z:0
visible: false
anchors{
top: rowElement.top
topMargin: -5
visible: main.currentIndex > -1
Behavior on x {
NumberAnimation { duration: 200 }
}
Behavior on width {
NumberAnimation { duration: 200 }
}
}
......@@ -69,36 +75,32 @@ Rectangle {
delegate: Rectangle {
id: rowItem
height: 50
y: -5
width: text.width+(text.width/name.length*2)
y: -5
color: "transparent"
MouseArea {
enabled: main.enabled
width: parent.width
height: parent.height
enabled: main.enabled
onClicked: {
main.currentIndex = index
selecter.visible = true
moveSelecter.start()
}
}
Label {
id: text
text: name
anchors.horizontalCenter: parent.horizontalCenter
Component.onCompleted: {
width = paintedWidth
}
z:1
font.bold: main.currentIndex == index
}
ParallelAnimation {
id: moveSelecter
NumberAnimation { target: selecter; property: "x"; from: selecter.x; to: rowItem.x; duration: 100}
NumberAnimation { target: selecter; property: "width"; from: selecter.width; to: rowItem.width; duration: 100}
}
}
}
}
......
......@@ -77,6 +77,12 @@ CheckBoxStyle {
}
}
Component.onCompleted: {
back1.opacity = control.checked ? 1 : 0
back2.opacity = control.checked ? 0 : 1
ball.x = control.checked ? 32 : 0
}
SequentialAnimation {
id: anim1
running: false
......
......@@ -73,7 +73,7 @@ themes.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH/themes
images.files = $$_PRO_FILE_PWD_/images/*.svg\
$$_PRO_FILE_PWD_/images/*.png
images.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
images.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH/images/
HEADERS += \
qquicknemostyleextensionplugin.h \
......
Markdown is supported
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