Commit 217007a4 authored by Prince Gupta's avatar Prince Gupta Committed by Pierre Lamot

qml: introduce PlayCover widget

parent 15460468
......@@ -449,6 +449,7 @@ libqt_plugin_la_RES = \
gui/qt/pixmaps/noart_artist_small.svg \
gui/qt/pixmaps/pause.svg \
gui/qt/pixmaps/play.svg \
gui/qt/pixmaps/play_button.svg \
gui/qt/pixmaps/playlist/add.svg \
gui/qt/pixmaps/playlist/playlist.svg \
gui/qt/pixmaps/playlist/remove.svg \
......@@ -670,6 +671,7 @@ libqt_plugin_la_QML = \
gui/qt/widgets/qml/NavigableCol.qml \
gui/qt/widgets/qml/NavigableFocusScope.qml \
gui/qt/widgets/qml/NavigableRow.qml \
gui/qt/widgets/qml/PlayCover.qml \
gui/qt/widgets/qml/RoundButton.qml \
gui/qt/widgets/qml/RoundImage.qml \
gui/qt/widgets/qml/ScanProgressBar.qml \
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
width="48" height="48"
viewBox="0 0 48 48"
version="1.1"
id="svg8">
<g transform="translate(0,-186.18266)">
<path
style="fill:#ffffff;fill-opacity:0.5;stroke:#ffffff;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 24.0009,232.68268 C 11.574837,232.68319 1.5009784,222.61057 1.4999822,210.18456 1.4989847,197.75854 11.571225,187.68432 23.997288,187.68283 c 12.42606,-0.002 22.500726,10.0703 22.50272,22.49812 0,12.42781 -10.073046,22.50122 -22.499108,22.50173 z"/>
<path
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4.0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 19.256804,201.93287 11.99988,8.24988 -11.99988,8.24988 z"/>
</g>
</svg>
......@@ -110,6 +110,7 @@
<file alias="noart_album.svg">pixmaps/noart_album.svg</file>
<file alias="noart_artist.svg">pixmaps/noart_artist.svg</file>
<file alias="noart_artist_small.svg">pixmaps/noart_artist_small.svg</file>
<file alias="play_button.svg">pixmaps/play_button.svg</file>
</qresource>
<qresource prefix="/prefsmenu">
<file alias="cone_audio_64.png">pixmaps/prefs/spref_cone_Audio_64.png</file>
......@@ -212,6 +213,7 @@
<file alias="CaptionLabel.qml">widgets/qml/CaptionLabel.qml</file>
<file alias="IconLabel.qml">widgets/qml/IconLabel.qml</file>
<file alias="ListLabel.qml">widgets/qml/ListLabel.qml</file>
<file alias="PlayCover.qml">widgets/qml/PlayCover.qml</file>
</qresource>
<qresource prefix="/util">
<file alias="SelectableDelegateModel.qml">util/qml/SelectableDelegateModel.qml</file>
......
/*****************************************************************************
* Copyright (C) 2020 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import QtQuick 2.11
import QtQuick.Controls 2.4
import "qrc:///style/"
Rectangle {
id: root
property alias iconSize: cover.width
signal iconClicked()
border.color: VLCStyle.colors.accent
border.width: VLCStyle.table_cover_border
opacity: visible ? 1 : 0
gradient: Gradient {
GradientStop { position: 0.0; color: Qt.rgba(0, 0, 0, .5) }
GradientStop { position: 1.0; color: Qt.rgba(0, 0, 0, .7) }
}
Behavior on opacity {
NumberAnimation { duration: 150; easing.type: Easing.OutQuad }
}
Image {
id: cover
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
source: "qrc:/play_button.svg"
MouseArea {
anchors.fill: parent
onClicked: root.iconClicked()
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment