[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [elisa] src: provides animations between all artists and albums views
From: Matthieu Gallien <matthieu_gallien () yahoo ! fr>
Date: 2016-12-05 21:14:17
Message-ID: E1cE0aX-0008Qz-TX () code ! kde ! org
[Download RAW message or body]
Git commit 22922286b6f949918e7f86d65ccb37942c95246c by Matthieu Gallien.
Committed on 05/12/2016 at 21:13.
Pushed by mgallien into branch 'master'.
provides animations between all artists and albums views
no longer uses a TabView but uses states to animate between views
M +82 -34 src/MediaServer.qml
https://commits.kde.org/elisa/22922286b6f949918e7f86d65ccb37942c95246c
diff --git a/src/MediaServer.qml b/src/MediaServer.qml
index 5b39c2e..a14dd78 100644
--- a/src/MediaServer.qml
+++ b/src/MediaServer.qml
@@ -377,13 +377,6 @@ ApplicationWindow {
width: viewModeView.width
}
- onCurrentRowChanged:
- {
- if (currentRow > 0) {
- mainContentView.currentIndex = currentRow - 1
- }
- }
-
onRowCountChanged:
{
viewModeView.selection.clear()
@@ -403,12 +396,9 @@ ApplicationWindow {
id: contentZone
- TabView {
+ Item {
id: mainContentView
- tabsVisible: false
- frameVisible: false
-
Layout.leftMargin: Screen.pixelDensity * 0.5
Layout.rightMargin: Screen.pixelDensity * 0.5
@@ -421,34 +411,34 @@ ApplicationWindow {
//z: 1
visible: Layout.minimumWidth != 0
- Tab {
- MediaBrowser {
- id: localAlbums
+ MediaBrowser {
+ id: localAlbums
- anchors.fill: parent
+ anchors.fill: parent
- firstPage: MediaAllAlbumView {
- playListModel: playListModelItem
- musicDatabase: localAlbumDatabase
- playerControl: manageAudioPlayer
- stackView: localAlbums.stackView
- }
+ firstPage: MediaAllAlbumView {
+ playListModel: playListModelItem
+ musicDatabase: localAlbumDatabase
+ playerControl: manageAudioPlayer
+ stackView: localAlbums.stackView
}
+
+ visible: opacity > 0
}
- Tab {
- MediaBrowser {
- id: localArtists
+ MediaBrowser {
+ id: localArtists
- anchors.fill: parent
+ anchors.fill: parent
- firstPage: MediaAllArtistView {
- playListModel: playListModelItem
- musicDatabase: localAlbumDatabase
- playerControl: manageAudioPlayer
- stackView: localArtists.stackView
- }
+ firstPage: MediaAllArtistView {
+ playListModel: playListModelItem
+ musicDatabase: localAlbumDatabase
+ playerControl: manageAudioPlayer
+ stackView: localArtists.stackView
}
+
+ visible: opacity > 0
}
}
@@ -533,8 +523,8 @@ ApplicationWindow {
states: [
State {
- name: 'compact'
- when: viewModeView.currentRow > 0
+ name: 'allAlbums'
+ when: viewModeView.currentRow === 1
PropertyChanges {
target: mainContentView
Layout.minimumWidth: contentZone.width * 0.66
@@ -565,6 +555,56 @@ ApplicationWindow {
Layout.maximumWidth: 0
Layout.preferredWidth: 0
}
+ PropertyChanges {
+ target: localAlbums
+ opacity: 1
+ }
+ PropertyChanges {
+ target: localArtists
+ opacity: 0
+ }
+ },
+ State {
+ name: 'allArtists'
+ when: viewModeView.currentRow === 2
+ PropertyChanges {
+ target: mainContentView
+ Layout.minimumWidth: contentZone.width * 0.66
+ Layout.maximumWidth: contentZone.width * 0.66
+ Layout.preferredWidth: contentZone.width * 0.66
+ }
+ PropertyChanges {
+ target: firstViewSeparatorItem
+ Layout.minimumWidth: 1
+ Layout.maximumWidth: 1
+ Layout.preferredWidth: 1
+ }
+ PropertyChanges {
+ target: playList
+ Layout.minimumWidth: contentZone.width * 0.33
+ Layout.maximumWidth: contentZone.width * 0.33
+ Layout.preferredWidth: contentZone.width * 0.33
+ }
+ PropertyChanges {
+ target: viewSeparatorItem
+ Layout.minimumWidth: 0
+ Layout.maximumWidth: 0
+ Layout.preferredWidth: 0
+ }
+ PropertyChanges {
+ target: albumContext
+ Layout.minimumWidth: 0
+ Layout.maximumWidth: 0
+ Layout.preferredWidth: 0
+ }
+ PropertyChanges {
+ target: localAlbums
+ opacity: 0
+ }
+ PropertyChanges {
+ target: localArtists
+ opacity: 1
+ }
},
State {
name: 'full'
@@ -599,11 +639,19 @@ ApplicationWindow {
Layout.maximumWidth: contentZone.width / 2
Layout.preferredWidth: contentZone.width / 2
}
+ PropertyChanges {
+ target: localAlbums
+ opacity: 0
+ }
+ PropertyChanges {
+ target: localArtists
+ opacity: 0
+ }
}
]
transitions: Transition {
NumberAnimation {
- properties: "Layout.minimumWidth, Layout.maximumWidth, \
Layout.preferredWidth" + properties: "Layout.minimumWidth, \
Layout.maximumWidth, Layout.preferredWidth, opacity" easing.type: Easing.InOutQuad
duration: 300
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic