Warning, /multimedia/amarok/src/context/qml_plugin/AppletHeader.qml is written in an unsupported language. File is not indexed.

0001 /****************************************************************************************
0002  * Copyright (c) 2017 Malte Veerman <malte.veerman@gmail.com>                           *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 import QtQuick 2.4
0018 import QtQuick.Controls 1.4
0019 import QtQuick.Layouts 1.3
0020 
0021 
0022 RowLayout {
0023     id: root
0024 
0025     property var applet: parent
0026     property alias title: label.text
0027     property alias iconSource: icon.source
0028 
0029     anchors {
0030         left: parent.left
0031         right: parent.right
0032         top: parent.top
0033         margins: parent.padding
0034     }
0035     height: collapseButton.height
0036 
0037     Image {
0038         id: icon
0039 
0040         height: collapseButton.height
0041         width: height
0042         sourceSize.width: width
0043         sourceSize.height: height
0044         fillMode: Image.PreserveAspectFit
0045         Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
0046     }
0047 
0048     Label {
0049         id: label
0050 
0051         text: root.title
0052         fontSizeMode: Text.VerticalFit
0053         horizontalAlignment: Text.AlignHCenter
0054         Layout.fillWidth: true
0055         Layout.alignment: Qt.AlignVCenter
0056     }
0057 
0058     ToolButton {
0059         id: configButton
0060 
0061         visible: applet.configEnabled && !!applet.configDialog
0062         iconName: "preferences-other"
0063         Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
0064 
0065         onClicked: applet.configDialog.open()
0066     }
0067     ToolButton {
0068         id: collapseButton
0069 
0070         //TODO: Icons are not part of official standard. Maybe provide our own icons?
0071         iconName: !applet.collapsed ? "window-minimize" : "window-restore"
0072         Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
0073 
0074         onClicked: applet.collapsed = applet.collapsed ? false : true
0075     }
0076 }