mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:09:24 +02:00
card default image: settable, use to start, and reset when needed
This commit is contained in:
parent
99e229467b
commit
6fb2cedfe0
2 changed files with 5 additions and 5 deletions
|
@ -275,9 +275,7 @@ Window {
|
||||||
}
|
}
|
||||||
console.log('suggestion:', JSON.stringify(data));
|
console.log('suggestion:', JSON.stringify(data));
|
||||||
target.userStory = data;
|
target.userStory = data;
|
||||||
if (data.lobby) {
|
target.image.source = data.lobby || ''; // should fail to load and thus use default
|
||||||
target.image.source = data.lobby;
|
|
||||||
}
|
|
||||||
target.placeText = data.name;
|
target.placeText = data.name;
|
||||||
target.usersText = data.online_users + ((data.online_users === 1) ? ' user' : ' users');
|
target.usersText = data.online_users + ((data.online_users === 1) ? ' user' : ' users');
|
||||||
target.visible = true;
|
target.visible = true;
|
||||||
|
|
|
@ -21,11 +21,14 @@ Rectangle {
|
||||||
property alias image: lobby;
|
property alias image: lobby;
|
||||||
property alias placeText: place.text;
|
property alias placeText: place.text;
|
||||||
property alias usersText: users.text;
|
property alias usersText: users.text;
|
||||||
|
// FIXME: let's get our own
|
||||||
|
property string defaultPicture: "http://www.davidluke.com/wp-content/themes/david-luke/media/ims/placeholder720.gif";
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
Image {
|
Image {
|
||||||
id: lobby;
|
id: lobby;
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
|
source: defaultPicture;
|
||||||
fillMode: Image.PreserveAspectCrop;
|
fillMode: Image.PreserveAspectCrop;
|
||||||
// source gets filled in later
|
// source gets filled in later
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
@ -33,8 +36,7 @@ Rectangle {
|
||||||
onStatusChanged: {
|
onStatusChanged: {
|
||||||
if (status == Image.Error) {
|
if (status == Image.Error) {
|
||||||
console.log("source: " + source + ": failed to load " + JSON.stringify(userStory));
|
console.log("source: " + source + ": failed to load " + JSON.stringify(userStory));
|
||||||
// FIXME: let's get our own
|
source = defaultPicture;
|
||||||
source = "http://www.davidluke.com/wp-content/themes/david-luke/media/ims/placeholder720.gif"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue