[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [gcompris] src/core: core, add of a buy me overlay to mask activities
From:       Bruno Coudoin <bruno.coudoin () gcompris ! net>
Date:       2014-11-30 21:26:29
Message-ID: E1XvC0j-00014n-BF () scm ! kde ! org
[Download RAW message or body]

Git commit 0ff7be629aabaf32eac56e5642b4621ba57a767d by Bruno Coudoin.
Committed on 30/11/2014 at 21:00.
Pushed by bcoudoin into branch 'master'.

core, add of a buy me overlay to mask activities

M  +7    -1    src/core/ActivityBase.qml
A  +97   -0    src/core/BuyMeOverlay.qml     [License: UNKNOWN]  *
M  +1    -3    src/core/DialogConfig.qml

The files marked with a * at the end have a non valid license. Please read: \
http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are \
listed at that page.


http://commits.kde.org/gcompris/0ff7be629aabaf32eac56e5642b4621ba57a767d

diff --git a/src/core/ActivityBase.qml b/src/core/ActivityBase.qml
index b220fa3..89fba2e 100644
--- a/src/core/ActivityBase.qml
+++ b/src/core/ActivityBase.qml
@@ -19,7 +19,6 @@
  *   along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 import QtQuick 2.2
-import QtQuick.Controls 1.1
 import GCompris 1.0
 
 Item {
@@ -81,4 +80,11 @@ Item {
         sourceComponent: pageComponent
         anchors.fill: parent
     }
+
+    Loader {
+        id: demoPageLoader
+        sourceComponent: BuyMeOverlay {}
+        anchors.fill: parent
+        active: !activityInfo.demo && ApplicationSettings.isDemoMode
+    }
 }
diff --git a/src/core/BuyMeOverlay.qml b/src/core/BuyMeOverlay.qml
new file mode 100644
index 0000000..9190c53
--- /dev/null
+++ b/src/core/BuyMeOverlay.qml
@@ -0,0 +1,97 @@
+import QtQuick 2.2
+import QtQuick.Controls 1.1
+import QtQuick.Controls.Styles 1.1
+import GCompris 1.0
+
+Component {
+    Item {
+        
+        anchors {
+            fill: parent
+            bottomMargin: bar.height
+        }
+        Rectangle {
+            anchors.fill: parent
+            opacity: 0.5
+            color: "grey"
+        }
+        /* Activation Instruction */
+        Item {
+            id: instruction
+            z: 99
+            anchors {
+                horizontalCenter: parent.horizontalCenter
+                top: parent.top
+                topMargin: 40
+            }
+            width: parent.width * 0.9
+            
+            GCText {
+                id: instructionTxt
+                font.pointSize: 16
+                color: "white"
+                style: Text.Outline
+                styleColor: "black"
+                horizontalAlignment: Text.AlignHCenter
+                width: parent.width
+                wrapMode: TextEdit.WordWrap
+                z: 2
+                text: qsTr("This activity is only available in the full version of \
GCompris.") +            }
+            
+            Button {
+                width: parent.width * 0.8
+                height: 60 * ApplicationInfo.ratio
+                anchors {
+                    horizontalCenter: parent.horizontalCenter
+                    top: instructionTxt.bottom
+                    topMargin: 10
+                }
+                text: qsTr("Buy the full version").toUpperCase()
+                style: ButtonStyle {
+                    background: Rectangle {
+                        implicitWidth: 100
+                        implicitHeight: 25
+                        border.width: control.activeFocus ? 4 : 2
+                        border.color: "black"
+                        radius: 10
+                        gradient: Gradient {
+                            GradientStop { position: 0 ; color: control.pressed ? \
"#87ff5c" : "#ffe85c"} +                            GradientStop { position: 1 ; \
color: control.pressed ? "#44ff00" : "#f8d600"} +                        }
+                    }
+                    label: GCText {
+                        text: control.text
+                        horizontalAlignment: Text.AlignHCenter
+                        verticalAlignment: Text.AlignVCenter
+                        wrapMode: Text.WordWrap
+                    }
+                }
+                
+                onClicked: {
+                    ApplicationSettings.isDemoMode = !ApplicationSettings.isDemoMode
+                    console.log("call buying api")
+                }
+            }
+            
+            Rectangle {
+                anchors.fill: instructionTxt
+                z: 1
+                opacity: 0.8
+                radius: 10
+                border.width: 2
+                border.color: "black"
+                gradient: Gradient {
+                    GradientStop { position: 0.0; color: "#000" }
+                    GradientStop { position: 0.9; color: "#666" }
+                    GradientStop { position: 1.0; color: "#AAA" }
+                }
+            }
+        }
+        
+        MultiPointTouchArea {
+            // Just to catch mouse events
+            anchors.fill: parent
+        }
+    }
+}
diff --git a/src/core/DialogConfig.qml b/src/core/DialogConfig.qml
index 27c865a..31b6cfe 100644
--- a/src/core/DialogConfig.qml
+++ b/src/core/DialogConfig.qml
@@ -101,7 +101,6 @@ Rectangle {
 
                             property bool checked: !isDemoMode
                             onCheckedChanged: {
-                                console.log("onCheckedChanged", checked)
                                 isDemoMode = !checked;
                             }
 
@@ -123,7 +122,7 @@ Rectangle {
                                 anchors.leftMargin: 10
                                 anchors.verticalCenter: parent.verticalCenter
                                 text: demoModeBox.checked ? qsTr("You have the full \
                version") :
-                                                            qsTr("Buy the full \
version") +                                                            qsTr("Buy the \
full version").toUpperCase()  style: ButtonStyle {
                                     background: Rectangle {
                                         implicitWidth: 100
@@ -503,7 +502,6 @@ Rectangle {
 
     function save() {
         ApplicationSettings.isAudioVoicesEnabled = isAudioVoicesEnabled
-        console.log("isDemoMode", isDemoMode)
         ApplicationSettings.isDemoMode = isDemoMode
         ApplicationSettings.isAudioEffectsEnabled = isAudioEffectsEnabled
         ApplicationSettings.isFullscreen = isFullscreen


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic