diff --git a/src/HeaderBar.qml b/src/HeaderBar.qml index 210f5eaa..a4a07209 100644 --- a/src/HeaderBar.qml +++ b/src/HeaderBar.qml @@ -1,403 +1,389 @@ /* * Copyright 2016 Matthieu Gallien * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ import QtQuick 2.7 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.2 import QtQuick.Window 2.2 import QtGraphicalEffects 1.0 FocusScope { id: headerBar property string title property string artist property string album property string image property string newImage property string oldImage property string tracksCount property int trackRating property bool ratingVisible property alias playerControl: playControlItem onImageChanged: { if (changeBackgroundTransition.running) { changeBackgroundTransition.complete() } newImage = image changeBackgroundTransition.start() } Item { id: background anchors.fill: parent Image { id: oldBackground source: (oldImage ? oldImage : Qt.resolvedUrl(elisaTheme.defaultBackgroundImage)) asynchronous: true anchors.fill: parent fillMode: Image.PreserveAspectCrop sourceSize.width: parent.width opacity: 1 layer.enabled: true layer.effect: HueSaturation { cached: true lightness: -0.5 saturation: 0.9 layer.enabled: true layer.effect: GaussianBlur { cached: true radius: 256 deviation: 12 samples: 129 transparentBorder: false } } } Image { id: newBackground source: (newImage ? newImage : Qt.resolvedUrl(elisaTheme.defaultBackgroundImage)) asynchronous: true anchors.fill: parent fillMode: Image.PreserveAspectCrop sourceSize.width: parent.width visible: false opacity: 0 layer.enabled: true layer.effect: HueSaturation { cached: true lightness: -0.5 saturation: 0.9 layer.enabled: true layer.effect: GaussianBlur { cached: true radius: 256 deviation: 12 samples: 129 transparentBorder: false } } } } MediaPlayerControl { id: playControlItem focus: true anchors.left: background.left anchors.right: background.right anchors.bottom: background.bottom height: elisaTheme.mediaPlayerControlHeight } - LabelWithToolTip { - id: backgroundCopyright - anchors.bottom: playControlItem.top - anchors.right: parent.right - anchors.bottomMargin: elisaTheme.layoutVerticalMargin - anchors.rightMargin: elisaTheme.layoutVerticalMargin - - text: i18nc("Copyright text shown for an image", "by Edward Betts (Own work) [CC BY-SA 3.0]") - color: myPalette.highlightedText - opacity: 0.4 - - visible: !image - } - ColumnLayout { id: contentZone anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right anchors.bottom: playControlItem.top spacing: 0 Item { Layout.fillHeight: true Layout.fillWidth: true } RowLayout { spacing: 0 Layout.alignment: Qt.AlignVCenter Layout.fillWidth: true Layout.fillHeight: true Item { Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter Layout.preferredHeight: contentZone.height * 0.9 Layout.minimumHeight: contentZone.height * 0.9 Layout.maximumHeight: contentZone.height * 0.9 Layout.preferredWidth: contentZone.height * 0.9 Layout.minimumWidth: contentZone.height * 0.9 Layout.maximumWidth: contentZone.height * 0.9 Layout.leftMargin: !LayoutMirroring.enabled ? contentZone.width * 0.15 : 0 Layout.rightMargin: LayoutMirroring.enabled ? contentZone.width * 0.15 : 0 Image { id: oldMainIcon anchors.fill: parent asynchronous: true source: (oldImage ? oldImage : Qt.resolvedUrl(elisaTheme.defaultAlbumImage)) sourceSize { width: contentZone.height * 0.9 height: contentZone.height * 0.9 } fillMode: Image.PreserveAspectFit } Image { id: newMainIcon anchors.fill: parent asynchronous: true source: (newImage ? newImage : Qt.resolvedUrl(elisaTheme.defaultAlbumImage)) visible: false opacity: 0 sourceSize { width: contentZone.height * 0.9 height: contentZone.height * 0.9 } fillMode: Image.PreserveAspectFit } } ColumnLayout { spacing: 0 Layout.alignment: Qt.AlignTop | Qt.AlignHCenter Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 Layout.fillWidth: true Layout.fillHeight: true TextMetrics { id: titleFontInfo font { bold: albumLabel.font.bold pixelSize: albumLabel.font.pixelSize } text: albumLabel.text } LabelWithToolTip { id: mainLabel text: title Layout.fillWidth: true Layout.alignment: Qt.AlignLeft elide: Text.ElideRight color: myPalette.highlightedText font.pixelSize: elisaTheme.defaultFontPixelSize * 2.5 font.bold: true Layout.bottomMargin: titleFontInfo.height * 0.5 } LabelWithToolTip { id: authorLabel text: artist Layout.fillWidth: true Layout.alignment: Qt.AlignLeft elide: Text.ElideRight color: myPalette.highlightedText font.pixelSize: elisaTheme.defaultFontPixelSize * 1.5 layer.effect: Glow { cached: true color: myPalette.shadow radius: 4.0 samples: 9 } } LabelWithToolTip { id: albumLabel text: album Layout.fillWidth: true Layout.alignment: Qt.AlignLeft elide: Text.ElideRight color: myPalette.highlightedText font.weight: Font.Light font.pixelSize: elisaTheme.defaultFontPixelSize * 1 layer.effect: Glow { cached: true color: myPalette.shadow radius: 4.0 samples: 9 } } RatingStar { id: mainRating visible: ratingVisible starSize: elisaTheme.ratingStarSize starRating: trackRating Layout.alignment: Qt.AlignLeft } } LabelWithToolTip { id: remainingTracksLabel text: i18np("1 track remaining", "%1 tracks remaining", tracksCount) Layout.alignment: Qt.AlignRight | Qt.AlignBottom - Layout.bottomMargin: (backgroundCopyright.visible ? elisaTheme.layoutVerticalMargin + backgroundCopyright.height : elisaTheme.layoutVerticalMargin) + Layout.bottomMargin: elisaTheme.layoutVerticalMargin Layout.leftMargin: elisaTheme.layoutHorizontalMargin Layout.rightMargin: elisaTheme.layoutHorizontalMargin elide: Text.ElideRight visible: tracksCount > 0 color: myPalette.highlightedText } } Item { Layout.fillHeight: true Layout.fillWidth: true } } SequentialAnimation { id: changeBackgroundTransition PropertyAction { targets: [newBackground, newMainIcon] property: 'opacity' value: 0 } PropertyAction { targets: [newBackground, newMainIcon] property: 'visible' value: true } PropertyAction { target: newBackground property: "source" value: (newImage ? newImage : Qt.resolvedUrl(elisaTheme.defaultBackgroundImage)) } PropertyAction { target: newMainIcon property: "source" value: (newImage ? newImage : Qt.resolvedUrl(elisaTheme.defaultAlbumImage)) } ParallelAnimation { NumberAnimation { targets: [newBackground, newMainIcon] property: 'opacity' from: 0 to: 1 duration: 250 easing.type: Easing.Linear } NumberAnimation { targets: [oldBackground, oldMainIcon] property: 'opacity' from: 1 to: 0 duration: 250 easing.type: Easing.Linear } } PropertyAction { target: headerBar property: "oldImage" value: image } PropertyAction { target: oldBackground property: 'source' value: (headerBar.oldImage ? headerBar.oldImage : Qt.resolvedUrl(elisaTheme.defaultBackgroundImage)) } PropertyAction { target: oldMainIcon property: 'source' value: (headerBar.oldImage ? headerBar.oldImage : Qt.resolvedUrl(elisaTheme.defaultAlbumImage)) } PropertyAction { targets: [oldBackground, oldMainIcon] property: 'opacity' value: 1 } PropertyAction { targets: [newBackground, newMainIcon] property: 'visible' value: false } onStopped: { oldImage = newImage } } } diff --git a/src/Theme.qml b/src/Theme.qml index e5fe612a..84ae331a 100644 --- a/src/Theme.qml +++ b/src/Theme.qml @@ -1,81 +1,81 @@ /* * Copyright 2017 Matthieu Gallien * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ import QtQuick 2.7 import QtQuick.Controls 1.4 Item { property string defaultAlbumImage: 'image://icon/media-optical-audio' property string defaultArtistImage: 'image://icon/view-media-artist' - property string defaultBackgroundImage: 'background.jpg' + property string defaultBackgroundImage: 'background.png' property string artistIcon: 'image://icon/view-media-artist' property string albumIcon: 'image://icon/media-album-cover' property string playlistIcon: 'image://icon/amarok_playlist' property string tracksIcon: 'image://icon/media-album-track' property string clearIcon: 'image://icon/edit-clear' property string skipBackwardIcon: 'image://icon/media-skip-backward' property string pauseIcon: 'image://icon/media-playback-pause' property string playIcon: 'image://icon/media-playback-start' property string skipForwardIcon: 'image://icon/media-skip-forward' property string playerVolumeMutedIcon: 'image://icon/player-volume-muted' property string playerVolumeIcon: 'image://icon/player-volume' property string ratingIcon: 'image://icon/rating' property string ratingUnratedIcon: 'image://icon/rating-unrated' property string errorIcon: 'image://icon/error' property int layoutHorizontalMargin: 8 property int layoutVerticalMargin: 6 property int delegateHeight: 28 property int delegateWithHeaderHeight: 68 property int trackDelegateHeight: 45 property int coverImageSize: 180 property int smallImageSize: 32 property int tooltipRadius: 3 property int shadowOffset: 2 property int delegateToolButtonSize: 34 property int smallDelegateToolButtonSize: 20 property int ratingStarSize: 15 property int mediaPlayerControlHeight: 48 property int smallControlButtonHeight: 32 property int bigControlButtonHeight: 44 property int volumeSliderWidth: 140 property int dragDropPlaceholderHeight: 28 property int navigationBarHeight: 100 property int gridDelegateHeight: 100 + layoutVerticalMargin + fontSize.height * 2 property int gridDelegateWidth: 100 property int viewSelectorDelegateHeight: 32 property int filterClearButtonMargin: layoutVerticalMargin property alias defaultFontPixelSize: fontSize.font.pixelSize Label { id: fontSize } } diff --git a/src/background.jpg b/src/background.jpg deleted file mode 100644 index f449a464..00000000 Binary files a/src/background.jpg and /dev/null differ diff --git a/src/background.png b/src/background.png new file mode 100644 index 00000000..0201a8a3 Binary files /dev/null and b/src/background.png differ diff --git a/src/upnpControl.qrc b/src/upnpControl.qrc index 9083862d..68da2f89 100644 --- a/src/upnpControl.qrc +++ b/src/upnpControl.qrc @@ -1,40 +1,40 @@ MediaPlayerControl.qml RatingStar.qml MediaPlayListView.qml MediaAlbumView.qml MediaServer.qml HeaderBar.qml - background.jpg ContextView.qml DraggableItem.qml PassiveNotification.qml NavigationActionBar.qml PlayListEntry.qml MediaBrowser.qml Theme.qml PlatformIntegration.qml LabelWithToolTip.qml MediaAllTracksView.qml TopNotification.qml TrackImportNotification.qml TopNotificationItem.qml ViewSelector.qml FilterBar.qml MediaTrackDelegate.qml MediaAlbumTrackDelegate.qml GridBrowserView.qml GridBrowserDelegate.qml + background.png windows/WindowsTheme.qml windows/PlatformIntegration.qml windows/LabelWithToolTip.qml android/MediaServer.qml android/AndroidTheme.qml android/PlatformIntegration.qml diff --git a/src/windows/WindowsTheme.qml b/src/windows/WindowsTheme.qml index d4b2ef9d..10dc3530 100644 --- a/src/windows/WindowsTheme.qml +++ b/src/windows/WindowsTheme.qml @@ -1,81 +1,81 @@ /* * Copyright 2017 Matthieu Gallien * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ import QtQuick 2.7 import QtQuick.Controls 1.4 Item { property string defaultAlbumImage: 'image://icon/media-optical-audio' property string defaultArtistImage: 'image://icon/view-media-artist' - property string defaultBackgroundImage: 'background.jpg' + property string defaultBackgroundImage: 'background.png' property string artistIcon: 'image://icon/view-media-artist' property string albumIcon: 'image://icon/media-album-cover' property string playlistIcon: 'image://icon/amarok_playlist' property string tracksIcon: 'image://icon/media-album-track' property string clearIcon: 'image://icon/edit-clear' property string skipBackwardIcon: 'image://icon/media-skip-backward' property string pauseIcon: 'image://icon/media-playback-pause' property string playIcon: 'image://icon/media-playback-start' property string skipForwardIcon: 'image://icon/media-skip-forward' property string playerVolumeMutedIcon: 'image://icon/player-volume-muted' property string playerVolumeIcon: 'image://icon/player-volume' property string ratingIcon: 'image://icon/rating' property string ratingUnratedIcon: 'image://icon/rating-unrated' property string errorIcon: 'image://icon/error' property int layoutHorizontalMargin: 8 property int layoutVerticalMargin: 6 property int delegateHeight: 28 property int delegateWithHeaderHeight: 68 property int trackDelegateHeight: 45 property int coverImageSize: 180 property int smallImageSize: 32 property int tooltipRadius: 3 property int shadowOffset: 2 property int delegateToolButtonSize: 34 property int smallDelegateToolButtonSize: 20 property int ratingStarSize: 15 property int mediaPlayerControlHeight: 48 property int smallControlButtonHeight: 32 property int bigControlButtonHeight: 44 property int volumeSliderWidth: 140 property int dragDropPlaceholderHeight: 28 property int navigationBarHeight: 100 property int gridDelegateHeight: 100 + layoutVerticalMargin + fontSize.height * 2 property int gridDelegateWidth: 100 property int viewSelectorDelegateHeight: 32 property int filterClearButtonMargin: 1 property alias defaultFontPixelSize: fontSize.font.pixelSize Label { id: fontSize } }