Refactoring: move all apps inside a sub folder
This commit is contained in:
1 parent
33e4fe0c4e
commit
b1ca2a7cff
41 files changed
+54
-45
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import QtQuick 2.5
|
||||
import "../Shared"
|
||||
import "../Shared/Remote.js" as Remote
|
||||
|
||||
// Bouton navigable à la télécommande : surbrillance blanche quand il a le focus.
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property alias text: label.text
|
||||
property bool primary: false
|
||||
signal clicked()
|
||||
|
||||
implicitWidth: Math.max(160, label.implicitWidth + Theme.spacingL * 2)
|
||||
implicitHeight: Theme.controlHeight
|
||||
radius: Theme.radius
|
||||
opacity: enabled ? 1 : 0.5
|
||||
color: activeFocus ? Theme.focusBackground : (primary ? Theme.accent : Theme.surface)
|
||||
scale: activeFocus ? 1.05 : 1
|
||||
|
||||
Behavior on scale { NumberAnimation { duration: Theme.animFast } }
|
||||
Behavior on color { ColorAnimation { duration: Theme.animFast } }
|
||||
|
||||
Text {
|
||||
id: label
|
||||
anchors.centerIn: parent
|
||||
color: root.activeFocus ? Theme.textOnFocus : Theme.text
|
||||
font.pixelSize: Theme.fontBody
|
||||
font.bold: root.activeFocus
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
if (Remote.isAccept(event.key)) {
|
||||
event.accepted = true;
|
||||
root.clicked();
|
||||
}
|
||||
}
|
||||
|
||||
// Souris : pratique pour tester hors de la box.
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
enabled: root.enabled
|
||||
onClicked: {
|
||||
root.forceActiveFocus();
|
||||
root.clicked();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user