46
width: 1000; height:300
46
width: 1000; height: 300
48
48
property color fileColor: "plum"
49
49
property color editColor: "powderblue"
51
property real partition: 1/10
51
property real partition: 1 / 10
54
54
anchors.fill: parent
55
//container for the header and the buttons
57
// Container for the header and the buttons
59
height:menuBar.height*partition
60
height: menuBar.height * partition
60
61
width: menuBar.width
62
63
gradient: Gradient {
65
66
GradientStop { position: 0.98;color: "#3F3F3F" }
66
67
GradientStop { position: 1.0; color: "#0e1B20" }
69
71
height: parent.height
70
anchors { right: labelRow.left ; verticalCenter: parent.bottom }
72
anchors { right: labelRow.left; verticalCenter: parent.bottom }
73
75
font { weight: Font.Light; italic: true }
75
//row displays its children in a vertical row
78
// Row displays its children in a vertical row
78
81
anchors.centerIn: parent
84
buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5)
85
scale: menuListView.currentIndex == 0? 1.25: 1
86
labelSize: menuListView.currentIndex == 0? 16:12
88
buttonColor: menuListView.currentIndex == 0 ? fileColor : Qt.darker(fileColor, 1.5)
89
scale: menuListView.currentIndex == 0 ? 1.25 : 1
90
labelSize: menuListView.currentIndex == 0 ? 16 : 12
88
//on a button click, change the list's currently selected item to FileMenu
93
// On a button click, change the list's currently selected item to FileMenu
89
94
onButtonClick: menuListView.currentIndex = 0
90
96
gradient: Gradient {
91
97
GradientStop { position: 0.0; color: fileColor }
92
98
GradientStop { position: 1.0; color: "#136F6F6F" }
98
buttonColor : menuListView.currentIndex == 1? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9)
99
scale: menuListView.currentIndex == 1? 1.25: 1
104
width: 50; height: 20
105
buttonColor : menuListView.currentIndex == 1 ? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9)
106
scale: menuListView.currentIndex == 1 ? 1.25 : 1
102
labelSize: menuListView.currentIndex == 1? 16:12
109
labelSize: menuListView.currentIndex == 1 ? 16 : 12
103
111
//on a button click, change the list's currently selected item to EditMenu
104
onButtonClick: menuListView.currentIndex = 1
112
onButtonClick: menuListView.currentIndex = 1
105
113
gradient: Gradient {
106
114
GradientStop { position: 0.0; color: editColor }
107
115
GradientStop { position: 1.0; color: "#136F6F6F" }
113
//list view will display a model according to a delegate
121
// A ListView will display a model according to a delegate
116
width:menuBar.width; height: 9*menuBar.height*partition
125
height: 9 * menuBar.height * partition
118
//the model contains the data
127
// The model contains the data
119
128
model: menuListModel
121
130
//control the movement of the menu switching
122
131
snapMode: ListView.SnapOneItem
123
132
orientation: ListView.Horizontal
124
boundsBehavior: Flickable.StopAtBounds
133
boundsBehavior: Flickable.StopAtBounds
125
134
flickDeceleration: 5000
126
135
highlightFollowsCurrentItem: true
127
highlightMoveDuration:240
136
highlightMoveDuration: 240
128
137
highlightRangeMode: ListView.StrictlyEnforceRange
131
//a list of visual items already have delegates handling their display
141
// A list of visual items that already have delegates handling their display
133
143
id: menuListModel
137
width: menuListView.width; height: menuListView.height
147
width: menuListView.width
148
height: menuListView.height
142
width: menuListView.width; height: menuListView.height
153
width: menuListView.width
154
height: menuListView.height