[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bgluon=5D_player/touch=3A_QML_Player=3A_Add_a_second?=
From: Laszlo Papp <djszapi () archlinux ! us>
Date: 2011-03-31 20:23:40
Message-ID: 20110331202340.DCA19A60A9 () git ! kde ! org
[Download RAW message or body]
Git commit 8930fe5b3199699593fd12384550e14a84a28139 by Laszlo Papp.
Committed on 31/03/2011 at 23:34.
Pushed by lpapp into branch 'master'.
QML Player: Add a second delegate and write the logic for toggling.
M +31 -2 player/touch/Home.qml
http://commits.kde.org/gluon/8930fe5b3199699593fd12384550e14a84a28139
diff --git a/player/touch/Home.qml b/player/touch/Home.qml
index cd26fd4..168e445 100644
--- a/player/touch/Home.qml
+++ b/player/touch/Home.qml
@@ -21,6 +21,8 @@ import QtQuick 1.0
Rectangle {
+ property bool moreGames: false;
+
color: "black";
anchors.fill: parent;
@@ -39,7 +41,24 @@ Rectangle {
}
}
+ Component {
+ id: gameItemsDelegateMoreGames;
+ Button {
+ id: gameItemMoreGames;
+ width: ListView.view.width;
+ icon: "icons/hi32-app-gluon.png";
+ text: qsTr(gameNameDownloadable);
+ subtext: qsTr(gameDescriptionDownloadable);
+
+ onClicked: {
+ detailsPage.propagate(gameNameDownloadable, \
gameDescriptionDownloadable, screenshotUrlsDownloadable, status, index); + \
} + }
+ }
+
ListView {
+ id: gameItemsListView;
+
width: 200;
height: 250;
anchors.fill: parent;
@@ -51,9 +70,9 @@ Rectangle {
Rectangle {
color: homePage.color;
width: ListView.view.width;
- height: moreGames.height + 5;
+ height: listViewHeaderButton.height + 5;
Button {
- id: moreGames;
+ id: listViewHeaderButton;
icon: "icons/get-hot-new-stuff.png";
text: qsTr("Get More Games");
subtext: gameItemsModel.downloadableCount + qsTr(" new games, ") \
+ gameItemsModel.upgradableCount + qsTr(" updated"); @@ -61,6 +80,16 @@ Rectangle {
onClicked: {
if (!mainview.loggedIn) {
mainview.statepoint = "mainwindow";
+ } else {
+ if (!moreGames) {
+ text = qsTr("Back to the downloaded games");
+ gameItemsListView.delegate = \
gameItemsDelegateMoreGames; + moreGames = true;
+ } else {
+ text = qsTr("Get More Games");
+ gameItemsListView.delegate = gameItemsDelegate;
+ moreGames = false;
+ }
}
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic