Changeset View
Changeset View
Standalone View
Standalone View
src/qml/ContentView.qml
Show All 39 Lines | 24 | RowLayout { | |||
---|---|---|---|---|---|
40 | 40 | | |||
41 | function openAlbum(album, artist, image, albumID) { | 41 | function openAlbum(album, artist, image, albumID) { | ||
42 | image = !image ? elisaTheme.defaultAlbumImage : image; | 42 | image = !image ? elisaTheme.defaultAlbumImage : image; | ||
43 | viewManager.openChildView(album, artist, image, albumID, ElisaUtils.Album); | 43 | viewManager.openChildView(album, artist, image, albumID, ElisaUtils.Album); | ||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | function openNowPlaying() { | 46 | function openNowPlaying() { | ||
47 | viewManager.closeAllViews(); | 47 | viewManager.closeAllViews(); | ||
48 | | ||||
49 | // This is needed to trigger the state change | | |||
50 | listViews.currentIndex = 0; | | |||
51 | } | 48 | } | ||
52 | 49 | | |||
53 | ViewManager { | 50 | ViewManager { | ||
54 | id: viewManager | 51 | id: viewManager | ||
55 | 52 | | |||
56 | onSwitchOffAllViews: { | 53 | onSwitchOffAllViews: { | ||
57 | listViews.setCurrentIndex(pageModel.indexFromViewType(viewType)) | 54 | listViews.setCurrentIndex(pageModel.indexFromViewType(viewType)) | ||
58 | 55 | | |||
▲ Show 20 Lines • Show All 297 Lines • ▼ Show 20 Line(s) | 336 | Rectangle { | |||
356 | Layout.maximumWidth: 1 | 353 | Layout.maximumWidth: 1 | ||
357 | } | 354 | } | ||
358 | 355 | | |||
359 | MediaPlayListView { | 356 | MediaPlayListView { | ||
360 | id: playList | 357 | id: playList | ||
361 | 358 | | |||
362 | Layout.fillHeight: true | 359 | Layout.fillHeight: true | ||
363 | Layout.leftMargin: elisaTheme.layoutHorizontalMargin | 360 | Layout.leftMargin: elisaTheme.layoutHorizontalMargin | ||
364 | Layout.rightMargin: elisaTheme.layoutHorizontalMargin | | |||
365 | 361 | | |||
366 | Layout.minimumWidth: contentZone.width | 362 | Layout.minimumWidth: contentZone.width | ||
367 | Layout.maximumWidth: contentZone.width | 363 | Layout.maximumWidth: contentZone.width | ||
368 | Layout.preferredWidth: contentZone.width | 364 | Layout.preferredWidth: contentZone.width | ||
369 | 365 | | |||
370 | onStartPlayback: elisa.audioControl.ensurePlay() | 366 | onStartPlayback: elisa.audioControl.ensurePlay() | ||
371 | 367 | | |||
372 | onPausePlayback: elisa.audioControl.playPause() | 368 | onPausePlayback: elisa.audioControl.playPause() | ||
Show All 16 Lines | 373 | Rectangle { | |||
389 | 385 | | |||
390 | Layout.fillHeight: true | 386 | Layout.fillHeight: true | ||
391 | 387 | | |||
392 | Layout.preferredWidth: 1 | 388 | Layout.preferredWidth: 1 | ||
393 | Layout.minimumWidth: 1 | 389 | Layout.minimumWidth: 1 | ||
394 | Layout.maximumWidth: 1 | 390 | Layout.maximumWidth: 1 | ||
395 | } | 391 | } | ||
396 | 392 | | |||
397 | ContextView { | 393 | Loader { | ||
398 | id: albumContext | 394 | id: albumContext | ||
399 | 395 | | |||
400 | Layout.fillHeight: true | 396 | active: Layout.minimumWidth != 0 | ||
401 | 397 | | |||
402 | Layout.minimumWidth: contentZone.width | 398 | sourceComponent: ContextView { | ||
403 | Layout.maximumWidth: contentZone.width | | |||
404 | Layout.preferredWidth: contentZone.width | | |||
405 | 399 | | |||
406 | visible: Layout.minimumWidth != 0 | 400 | anchors.fill: parent | ||
407 | 401 | | |||
402 | databaseId: elisa.manageHeaderBar.databaseId | ||||
403 | title: elisa.manageHeaderBar.title | ||||
408 | artistName: elisa.manageHeaderBar.artist | 404 | artistName: elisa.manageHeaderBar.artist | ||
409 | albumName: elisa.manageHeaderBar.album | 405 | albumName: elisa.manageHeaderBar.album | ||
410 | albumArtUrl: elisa.manageHeaderBar.image | 406 | albumArtUrl: elisa.manageHeaderBar.image | ||
407 | fileUrl: elisa.manageHeaderBar.fileName | ||||
408 | } | ||||
409 | | ||||
410 | Layout.fillHeight: true | ||||
411 | | ||||
412 | Layout.minimumWidth: 0 | ||||
413 | Layout.maximumWidth: 0 | ||||
414 | Layout.preferredWidth: 0 | ||||
415 | Layout.leftMargin: elisaTheme.layoutHorizontalMargin * 1.5 | ||||
416 | | ||||
417 | visible: Layout.minimumWidth != 0 | ||||
411 | } | 418 | } | ||
412 | } | 419 | } | ||
413 | } | 420 | } | ||
414 | 421 | | |||
415 | states: [ | 422 | states: [ | ||
416 | State { | 423 | State { | ||
417 | name: 'playList' | 424 | name: 'playList' | ||
418 | when: listViews.currentIndex === 0 | 425 | when: listViews.currentIndex === 0 | ||
419 | PropertyChanges { | 426 | PropertyChanges { | ||
420 | target: mainContentView | 427 | target: mainContentView | ||
421 | Layout.minimumWidth: 0 | 428 | Layout.minimumWidth: 0 | ||
422 | Layout.maximumWidth: 0 | 429 | Layout.maximumWidth: 0 | ||
423 | Layout.preferredWidth: 0 | 430 | Layout.preferredWidth: 0 | ||
424 | } | 431 | } | ||
425 | PropertyChanges { | 432 | PropertyChanges { | ||
426 | target: firstViewSeparatorItem | 433 | target: firstViewSeparatorItem | ||
427 | Layout.minimumWidth: 0 | 434 | Layout.minimumWidth: 0 | ||
428 | Layout.maximumWidth: 0 | 435 | Layout.maximumWidth: 0 | ||
429 | Layout.preferredWidth: 0 | 436 | Layout.preferredWidth: 0 | ||
430 | } | 437 | } | ||
431 | PropertyChanges { | 438 | PropertyChanges { | ||
432 | target: playList | 439 | target: playList | ||
433 | Layout.minimumWidth: contentZone.width / 2 | 440 | Layout.minimumWidth: contentZone.width * 2 / 5 + elisaTheme.layoutHorizontalMargin | ||
434 | Layout.maximumWidth: contentZone.width / 2 | 441 | Layout.maximumWidth: contentZone.width * 2 / 5 + elisaTheme.layoutHorizontalMargin | ||
435 | Layout.preferredWidth: contentZone.width / 2 | 442 | Layout.preferredWidth: contentZone.width * 2 / 5 + elisaTheme.layoutHorizontalMargin | ||
436 | } | 443 | } | ||
437 | PropertyChanges { | 444 | PropertyChanges { | ||
438 | target: viewSeparatorItem | 445 | target: viewSeparatorItem | ||
439 | Layout.minimumWidth: 1 | 446 | Layout.minimumWidth: 1 | ||
440 | Layout.maximumWidth: 1 | 447 | Layout.maximumWidth: 1 | ||
441 | Layout.preferredWidth: 1 | 448 | Layout.preferredWidth: 1 | ||
442 | } | 449 | } | ||
443 | PropertyChanges { | 450 | PropertyChanges { | ||
444 | target: albumContext | 451 | target: albumContext | ||
445 | Layout.minimumWidth: contentZone.width / 2 | 452 | Layout.minimumWidth: contentZone.width * 3 / 5 - 2 - 3.5 * elisaTheme.layoutHorizontalMargin | ||
446 | Layout.maximumWidth: contentZone.width / 2 | 453 | Layout.maximumWidth: contentZone.width * 3 / 5 - 2 - 3.5 * elisaTheme.layoutHorizontalMargin | ||
447 | Layout.preferredWidth: contentZone.width / 2 | 454 | Layout.preferredWidth: contentZone.width * 3 / 5 - 2 - 3.5 * elisaTheme.layoutHorizontalMargin | ||
448 | } | 455 | } | ||
449 | }, | 456 | }, | ||
450 | State { | 457 | State { | ||
451 | name: "browsingViewsNoPlaylist" | 458 | name: "browsingViewsNoPlaylist" | ||
452 | when: listViews.currentIndex !== 0 && contentViewContainer.showPlaylist !== true | 459 | when: listViews.currentIndex !== 0 && contentViewContainer.showPlaylist !== true | ||
453 | extend: "browsingViews" | 460 | extend: "browsingViews" | ||
454 | PropertyChanges { | 461 | PropertyChanges { | ||
455 | target: mainContentView | 462 | target: mainContentView | ||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |