Warning, /plasma-bigscreen/soundcloud-voice-application/ui/+mediacenter/SoundcloudSearch.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  Copyright 2018 by Aditya Mehra <aix.m@outlook.com>
0003  *  Copyright 2018 Marco Martin <mart@kde.org>
0004  *
0005  *  This program is free software: you can redistribute it and/or modify
0006  *  it under the terms of the GNU General Public License as published by
0007  *  the Free Software Foundation, either version 3 of the License, or
0008  *  (at your option) any later version.
0009 
0010  *  This program is distributed in the hope that it will be useful,
0011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  *  GNU General Public License for more details.
0014 
0015  *  You should have received a copy of the GNU General Public License
0016  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017  */
0018 
0019 import QtQuick 2.9
0020 import QtQuick.Layouts 1.4
0021 import QtGraphicalEffects 1.0
0022 import QtQuick.Controls 2.3
0023 import org.kde.kirigami 2.8 as Kirigami
0024 import org.kde.mycroft.bigscreen 1.0 as BigScreen
0025 import Mycroft 1.0 as Mycroft
0026 import "+mediacenter/views" as Views
0027 import "+mediacenter/delegates" as Delegates
0028 
0029 Mycroft.Delegate {
0030     id: delegate
0031 
0032     property var scSearchModel: JSON.parse(sessionData.scSearchBlob)
0033     property var scCurrentSongUrl: sessionData.audioSource
0034     property var scCurrentTitle: sessionData.audioTitle
0035 
0036     skillBackgroundSource: "https://source.unsplash.com/1920x1080/?+music"
0037     fillWidth: true
0038     
0039     Keys.onBackPressed: {
0040         parent.parent.parent.currentIndex--
0041         parent.parent.parent.currentItem.contentItem.forceActiveFocus()
0042     }
0043     
0044     onFocusChanged: {
0045         if(focus) {
0046             relatedSongListView.view.forceActiveFocus()
0047         }
0048     }
0049     
0050     Views.TileView {
0051         id: relatedSongListView
0052         anchors.fill: parent
0053         title: "Related Music"
0054         cellWidth: view.width / 4
0055         cellHeight: cellWidth / 1.8 + Kirigami.Units.gridUnit * 5
0056         focus: true
0057         model: scSearchModel
0058         delegate: Delegates.SideAudioCard {
0059             width: relatedSongListView.cellWidth
0060             height: relatedSongListView.cellHeight
0061         }
0062     }
0063 }
0064