Warning, /education/marble/examples/qml/where-is-that/FloatButton.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 SystemPalette { id: activePalette }
0018
0019 width: buttonLabel.width + 20; height: buttonLabel.height + 6
0020 smooth: true
0021 border { width: 1; color: Qt.darker(activePalette.button) }
0022 radius: 8
0023 color: activePalette.button
0024
0025 gradient: Gradient {
0026 GradientStop {
0027 position: 0.0
0028 color: {
0029 if (mouseArea.pressed)
0030 return activePalette.dark
0031 else
0032 return activePalette.light
0033 }
0034 }
0035 GradientStop { position: 1.0; color: activePalette.button }
0036 }
0037
0038 MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
0039
0040 Text {
0041 id: buttonLabel; text: container.label; anchors.centerIn: container; color: activePalette.buttonText
0042 }
0043 }