Animate Sidebar ContentView focus switch
This commit is contained in:
@@ -4,11 +4,13 @@ import QtQuick.Controls 1.4
|
||||
import Ikinuki.Client 1.0
|
||||
|
||||
TabView {
|
||||
id: tabView
|
||||
property var providers
|
||||
property bool viewSelected: false
|
||||
state: viewSelected ? "selected" : "deselected"
|
||||
property int xSelect: 0
|
||||
property int ySelect: 0
|
||||
width: parent.width * 0.8
|
||||
width: viewSelected ? parent.width * 0.95 : parent.width * 0.8
|
||||
height: parent.height
|
||||
|
||||
property var maxElements: providers.length
|
||||
@@ -45,6 +47,32 @@ TabView {
|
||||
}
|
||||
}
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "deselected"
|
||||
PropertyChanges {
|
||||
target: tabView
|
||||
width: parent.width * 0.8
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "selected"
|
||||
PropertyChanges {
|
||||
target: tabView
|
||||
width: parent.width * 0.95
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
NumberAnimation {
|
||||
properties: "width"
|
||||
duration: 150
|
||||
easing.type: Easing.Linear
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Keys.onPressed: (event)=> {
|
||||
console.log(Qt.Key_Left);
|
||||
if (event.key == Qt.Key_Left) {
|
||||
|
||||
Reference in New Issue
Block a user