6 color: "#" + config.background
7 width: config.main_width
8 height: config.main_height
12 onClicked: openContextMenu()
14 function openContextMenu() {
15 contextMenu.state = 'opened'
16 contextMenu.items = [action_add_media, action_playlist, action_settings,
17 action_play_one, action_save_playlist, action_clear_playlist, action_delete_bookmarks,
18 action_timer, action_about, action_quit]
20 function openAboutDialog(items) {
21 aboutDialog.state = 'opened'
22 aboutDialog.items = items
24 function openPlaylist(open, items) {
26 playlist.state = 'opened'
27 playlist.items = items
29 function openPlaylistItemInfo(metadata) {
30 playlistItemInfo.state = 'opened'
31 playlistItemInfo.metadata = metadata
33 function openSettings() {
34 settings.state = 'opened'
36 function openFilechooser(items, path, action) {
37 filechooser.state = 'opened'
38 filechooser.items = items
39 filechooser.path = path
41 filechooser.action = action
43 function openSleepTimer() {
44 sleepTimer.state = 'opened'
46 function set_text_x() {
47 if (cover.source == "") {
48 artist.x = (config.main_width - artist.width) / 2
49 album.x = (config.main_width - album.width) / 2
51 title_rect.width = config.main_width - 10
52 title.x = (config.main_width - title.width) / 2
55 artist.x = config.cover_height + 5
56 album.x = config.cover_height + 5
57 title_rect.x = config.cover_height + 5
58 title_rect.width = config.main_width - cover.width - 10
62 function start_scrolling_timer(start) {
64 timer_scrolling.start()
66 timer_scrolling.stop()
70 function scrolling_labels() {
71 if (cover.source == "") {
72 title.scrolling_width = config.main_width
73 title.scrolling_margin = 5
76 title.scrolling_width = config.main_width - cover.width
77 title.scrolling_margin = 5 + cover.width
79 if (title.width > title.scrolling_width) {
80 if (title.direction) {
82 if (title.width + 10 < title.scrolling_width - title.x)
83 title.direction = false
88 title.direction = true
94 interval: config.dual_delay
97 onTriggered: button_back.image = "gtk-goto-first-ltr.png"
101 interval: config.dual_delay
104 onTriggered: button_forward.image = "gtk-goto-last-ltr.png"
111 onTriggered: scrolling_labels()
117 width: config.cover_height
118 height: config.cover_height
119 sourceSize.width: config.cover_height
120 sourceSize.height: config.cover_height
122 source: main.cover_string
126 onClicked: {action_player_play.trigger()}
131 x: config.cover_height + 5
132 y: config.cover_height / 4
133 font.pixelSize: config.font_size + 1
134 color: "#" + config.foreground
135 text: main.artist_string
139 x: config.cover_height + 5
140 y: (config.cover_height / 4) + config.font_size + 21
141 font.pixelSize: config.font_size - 1
142 color: "#" + config.foreground
143 text: main.album_string
147 width: config.main_width - 10
148 height: config.font_size + 3
149 x: config.cover_height + 5
150 y: (config.cover_height / 4) + ((config.font_size*2)) + 42
151 color: "#" + config.background
155 font.pixelSize: config.font_size + 1
156 font.weight: Font.Bold
157 color: "#" + config.foreground
158 text: main.title_string
159 property bool direction
161 property int scrolling_width
162 property int scrolling_margin
168 y: config.main_height - config.button_height - config.progress_height - config.button_border_width
169 width: config.main_width
170 height: config.progress_height
171 color: "#" + config.progress_bg_color
175 onClicked: main.on_progress_clicked(mouseX / progressBar.width)
178 width: parent.width*main.progress
179 color: "#" + config.progress_color
183 bottom: parent.bottom
189 anchors.centerIn: progressBar
190 color: "#" + config.foreground
191 font.pixelSize: config.font_size
192 text: main.time_string
193 verticalAlignment: Text.AlignVCenter
198 y: config.main_height - config.button_height
199 image: "media-skip-backward.png"
200 onReleased: image = "media-skip-backward.png"
201 onPressed: timer_back.start()
202 onClicked: { if (timer_back.running == true) {
204 action_player_rrewind.trigger()
207 action_player_skip_back.trigger()
208 image = "media-skip-backward.png"
212 x: config.button_width + config.button_border_width + 2
213 y: config.main_height - config.button_height
214 image: "media-seek-backward.png"
215 onClicked: action_player_rewind.trigger()
218 x: (config.button_width + config.button_border_width + 2) * 2
219 y: config.main_height - config.button_height
220 image: main.play_pause_icon_path
221 onClicked: action_player_play.trigger()
224 x: (config.button_width + config.button_border_width + 2) * 3
225 y: config.main_height - config.button_height
226 image: "media-seek-forward.png"
227 onClicked: action_player_forward.trigger()
231 x: (config.button_width + config.button_border_width + 2) * 4
232 y: config.main_height - config.button_height
233 image: "media-skip-forward.png"
234 onReleased: image = "media-skip-forward.png"
235 onPressed: timer_forward.start()
236 onClicked: { if (timer_forward.running == true) {
238 action_player_fforward.trigger()
241 action_player_skip_forward.trigger()
242 image = "media-skip-forward.png"
246 x: (config.button_width + config.button_border_width + 2) * 5
247 y: config.main_height - config.button_height
248 image: "bookmark-new.png"
249 onClicked: main.bookmark_callback()
258 bottom: parent.bottom
261 onClose: contextMenu.state = 'closed'
262 //onResponse: controller.contextMenuResponse(index)
266 Behavior on opacity { NumberAnimation { duration: 300 } }
277 anchors.right: root.right
288 anchors.right: root.left
291 //script: controller.contextMenuClosed()
296 transitions: Transition {
297 AnchorAnimation { duration: 150 }
307 bottom: parent.bottom
309 onClose: aboutDialog.state = 'closed'
311 Behavior on opacity { NumberAnimation { duration: 300 } }
322 anchors.right: root.right
333 anchors.right: root.left
336 //script: controller.contextMenuClosed()
340 transitions: Transition {
341 AnchorAnimation { duration: 150 }
351 bottom: parent.bottom
353 onClose: playlist.state = 'closed'
355 Behavior on opacity { NumberAnimation { duration: 300 } }
366 anchors.right: root.right
377 anchors.right: root.left
380 //script: controller.contextMenuClosed()
384 transitions: Transition {
385 AnchorAnimation { duration: 150 }
395 bottom: parent.bottom
397 onClose: playlistItemInfo.state = 'closed'
399 Behavior on opacity { NumberAnimation { duration: 300 } }
405 target: playlistItemInfo
409 target: playlistItemInfo
410 anchors.right: root.right
416 target: playlistItemInfo
420 target: playlistItemInfo
421 anchors.right: root.left
424 //script: controller.contextMenuClosed()
428 transitions: Transition {
429 AnchorAnimation { duration: 150 }
439 bottom: parent.bottom
441 onClose: filechooser.state = 'closed'
443 Behavior on opacity { NumberAnimation { duration: 300 } }
454 anchors.right: root.right
465 anchors.right: root.left
468 //script: controller.contextMenuClosed()
472 transitions: Transition {
473 AnchorAnimation { duration: 150 }
483 bottom: parent.bottom
485 onClose: settings.state = 'closed'
487 Behavior on opacity { NumberAnimation { duration: 300 } }
498 anchors.right: root.right
509 anchors.right: root.left
512 //script: controller.contextMenuClosed()
516 transitions: Transition {
517 AnchorAnimation { duration: 150 }
527 bottom: parent.bottom
529 onClose: sleepTimer.state = 'closed'
531 Behavior on opacity { NumberAnimation { duration: 300 } }
542 anchors.right: root.right
553 anchors.right: root.left
556 //script: controller.contextMenuClosed()
560 transitions: Transition {
561 AnchorAnimation { duration: 150 }