• Skip to content
  • Skip to link menu
KDE API Documentation - ReadyButton.qml Source File (GCompris-qt)
  • KDE Home
  • Contact Us
 

GCompris-qt

  • src
  • core
ReadyButton.qml
1 /* GCompris - ReadyButton.qml
2  *
3  * Copyright (C) 2014 Bruno Coudoin <bruno.coudoin@gcompris.net>
4  *
5  * Authors:
6  * Bruno Coudoin <bruno.coudoin@gcompris.net>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, see <http://www.gnu.org/licenses/>.
20  */
21 import QtQuick 2.2
22 import GCompris 1.0
23 
24 Rectangle {
25  id: iamReady
26  anchors.horizontalCenter: parent.horizontalCenter
27  anchors.verticalCenter: parent.verticalCenter
28  border.color: "black"
29  visible: true
30  radius: 4
31  smooth: true
32  border.width: 0
33  width: iamReadyText.width + 50 * ApplicationInfo.ratio
34  height: iamReadyText.height + 50 * ApplicationInfo.ratio
35  color: "#AAFFFFFF"
36 
37  signal clicked
38 
39  GCText {
40  id: iamReadyText
41 
42  anchors.horizontalCenter: parent.horizontalCenter
43  anchors.verticalCenter: parent.verticalCenter
44  font.bold: true
45  fontSize: 18
46  text: qsTr("I am Ready")
47  visible: iamReady.visible
48  }
49 
50  MouseArea {
51  id: mouseArea
52  anchors.fill: parent
53  hoverEnabled: true
54 
55  onClicked: {
56  iamReady.visible = false
57  iamReady.clicked()
58  }
59  }
60 
61  states: [
62  State {
63  name: "notclicked"
64  PropertyChanges {
65  target: iamReady
66  scale: 1.0
67  }
68  },
69  State {
70  name: "clicked"
71  when: mouseArea.pressed
72  PropertyChanges {
73  target: iamReady
74  scale: 0.9
75  }
76  },
77  State {
78  name: "hover"
79  when: mouseArea.containsMouse
80  PropertyChanges {
81  target: iamReady
82  scale: 1.1
83  }
84  }
85  ]
86 
87  Behavior on scale { NumberAnimation { duration: 70 } }
88 }
GCText
A QML component unifying text presentation in GCompris.
Definition: GCText.qml:47
QtQuick
GCompris
ApplicationInfo
A general purpose singleton that exposes miscellaneous native functions to the QML layer...
Definition: ApplicationInfo.h:43
ApplicationInfo::ratio
qreal ratio
Ratio factor used for scaling of sizes on high-dpi devices.
Definition: ApplicationInfo.h:91
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Tue Jun 2 2015 21:47:47 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

GCompris-qt

Skip menu "GCompris-qt"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Modules

Class Picker

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal