Warning, /multimedia/kid3/src/qml/app/IconButton.qml is written in an unsupported language. File is not indexed.

0001 /**
0002  * \file IconButton.qml
0003  * Tool button with an icon.
0004  *
0005  * \b Project: Kid3
0006  * \author Urs Fleisch
0007  * \date 9 Feb 2018
0008  *
0009  * Copyright (C) 2018  Urs Fleisch
0010  *
0011  * This program is free software; you can redistribute it and/or modify
0012  * it under the terms of the GNU Lesser General Public License as published by
0013  * the Free Software Foundation; version 3.
0014  *
0015  * This program is distributed in the hope that it will be useful,
0016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0018  * GNU Lesser General Public License for more details.
0019  *
0020  * You should have received a copy of the GNU Lesser General Public License
0021  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0022  */
0023 
0024 import QtQuick 2.11
0025 import QtQuick.Controls 2.4
0026 
0027 ToolButton {
0028   property string iconName
0029   property alias color: text.color
0030 
0031   Text {
0032     id: text
0033     x: (parent.width - width) / 2
0034     y: (parent.height - height) / 2
0035     font.family: materialFont.name
0036     font.pixelSize: 24
0037     text: if (iconName) ({
0038               "go-up": "^",
0039               "go-down": "V",
0040               "select": "S",
0041               "clear": "X",
0042               "go-previous": "<",
0043               "go-next": ">",
0044               "drawer": "=",
0045               "navigation-menu": ":",
0046               "edit": "/",
0047               "add": "+",
0048               "remove": "-"
0049             })[iconName]
0050   }
0051 }