Warning, /education/marble/examples/qml/google-search/Button.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
0004 //
0005
0006 import Qt 4.7
0007
0008 Rectangle {
0009 id: container
0010
0011 property alias label: buttonLabel.text
0012 property alias font: buttonLabel.font
0013 property alias color: buttonLabel.color
0014 property color tint: "#FFFFFFFF"
0015 signal clicked
0016
0017 width: buttonLabel.width + 20; height: buttonLabel.height + 6
0018 smooth: true
0019 border { width: 1; color: Qt.darker(activePalette.button) }
0020 radius: 8
0021 color: activePalette.button
0022
0023 gradient: Gradient {
0024 GradientStop {
0025 position: 0.0
0026 color: {
0027 if (mouseArea.pressed)
0028 return activePalette.dark
0029 else
0030 return activePalette.light
0031 }
0032 }
0033 GradientStop { position: 1.0; color: activePalette.button }
0034 }
0035
0036 MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
0037
0038 Text {
0039 id: buttonLabel; text: container.label; anchors.centerIn: container; color: activePalette.buttonText
0040 }
0041 }