import QtQuick 2.5
import fbx.application 1.0
import fbx.ui.layout 1.0
import fbx.ui.menu 1.0

Application {

Background{
background: "player"
}

Text {
id: txt
focus: true
anchors.centerIn: parent
text: "Ceci est un test des menus sur Freebox"
color: "white"
font.pixelSize: 40
Keys.onMenuPressed: menu.focus = true
}
View
{
id: menu
returnFocusTo: txt
root: menu0
Menu{
id: menu0
title: "menu 1"
Section { text: "Section 1"}
Submenu { target: menu1}
Section { text: "Section 2"}
Submenu { target: menu2 }
}

Menu{
id : menu1
title: "Sous menu 1"
Section{ text: "CheckBox" }
CheckBox{
text: "CheckBox"
onCheckedChanged: {
if(check.enabled == false)
check.enabled = true
else
check.enabled = false
}
}
Submenu{ id: check; enabled: false; target: menu2}
}
Menu{
id : menu2
title: "Sous menu 2"
Section{ text: "Action"}
Action{ text: "Fermer menu"; onClicked: close();}
}
}
}