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

GCompris-qt

  • src
  • core
BuyMeOverlay.qml
1 /* GCompris - BuyMeOverlay.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 QtQuick.Controls 1.0
23 import GCompris 1.0
24 
25 Item {
26 
27  anchors {
28  fill: parent
29  bottomMargin: bar.height * 1.2
30  }
31  Rectangle {
32  anchors.fill: parent
33  opacity: 0.5
34  color: "grey"
35  }
36  /* Activation Instruction */
37  Item {
38  id: instruction
39  z: 99
40  anchors {
41  horizontalCenter: parent.horizontalCenter
42  top: parent.top
43  topMargin: 40
44  }
45  width: parent.width * 0.9
46 
47  GCText {
48  id: instructionTxt
49  fontSize: mediumSize
50  color: "white"
51  style: Text.Outline
52  styleColor: "black"
53  horizontalAlignment: Text.AlignHCenter
54  width: parent.width
55  wrapMode: TextEdit.WordWrap
56  z: 2
57  text: qsTr("This activity is only available in the full version of GCompris.")
58  }
59 
60  Button {
61  width: parent.width * 0.8
62  height: 60 * ApplicationInfo.ratio
63  anchors {
64  horizontalCenter: parent.horizontalCenter
65  top: instructionTxt.bottom
66  topMargin: 10
67  }
68  text: qsTr("Buy the full version").toUpperCase()
69  style: GCButtonStyle {
70  }
71 
72  onClicked: {
73  if(ApplicationSettings.isDemoMode)
74  ApplicationSettings.isDemoMode = false
75  }
76  }
77 
78  Rectangle {
79  anchors.fill: instructionTxt
80  z: 1
81  opacity: 0.8
82  radius: 10
83  border.width: 2
84  border.color: "black"
85  gradient: Gradient {
86  GradientStop { position: 0.0; color: "#000" }
87  GradientStop { position: 0.9; color: "#666" }
88  GradientStop { position: 1.0; color: "#AAA" }
89  }
90  }
91  }
92 
93  MultiPointTouchArea {
94  // Just to catch mouse events
95  anchors.fill: parent
96  }
97 
98  Keys.onEscapePressed: home()
99  Keys.onPressed: {
100  event.accepted = true
101  if (event.modifiers === Qt.ControlModifier &&
102  event.key === Qt.Key_Q) {
103  // Ctrl+Q exit the application
104  Core.quit(page);
105  } else if (event.modifiers === Qt.ControlModifier &&
106  event.key === Qt.Key_B) {
107  // Ctrl+B toggle the bar
108  ApplicationSettings.isBarHidden = !ApplicationSettings.isBarHidden;
109  } else if (event.modifiers === Qt.ControlModifier &&
110  event.key === Qt.Key_F) {
111  // Ctrl+F toggle fullscreen
112  ApplicationSettings.isFullscreen = !ApplicationSettings.isFullscreen
113  } else if (event.modifiers === Qt.ControlModifier &&
114  event.key === Qt.Key_M) {
115  // Ctrl+M toggle sound
116  ApplicationSettings.isAudioEffectsEnabled = !ApplicationSettings.isAudioEffectsEnabled
117  } else if (event.modifiers === Qt.ControlModifier &&
118  event.key === Qt.Key_W) {
119  // Ctrl+W exit the current activity
120  home()
121  }
122  }
123 }
GCText
A QML component unifying text presentation in GCompris.
Definition: GCText.qml:47
QtQuick
ApplicationSettings::isFullscreen
bool isFullscreen
Whether GCompris should run in fullscreen mode.
Definition: ApplicationSettings.h:88
ApplicationSettings::isDemoMode
bool isDemoMode
Whether in demo mode.
Definition: ApplicationSettings.h:144
GCompris
GCButtonStyle
Provides styling for GCompris' Buttons.
Definition: GCButtonStyle.qml:31
ApplicationSettings::isAudioEffectsEnabled
bool isAudioEffectsEnabled
Whether audio effects should be enabled.
Definition: ApplicationSettings.h:83
ApplicationSettings
Singleton that contains GCompris' persistent settings.
Definition: ApplicationSettings.h:63
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