mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
cleanup
This commit is contained in:
parent
61b738e3cd
commit
545fd1355f
1 changed files with 10 additions and 6 deletions
|
@ -31,7 +31,7 @@ Item {
|
||||||
|
|
||||||
property bool drillDownToPlace: false;
|
property bool drillDownToPlace: false;
|
||||||
property bool showPlace: isConcurrency;
|
property bool showPlace: isConcurrency;
|
||||||
property string messageColor: lozenge.visible ? "white" : hifi.colors.blueAccent;
|
property string messageColor: isAnnouncement ? "white" : hifi.colors.blueAccent;
|
||||||
property string timePhrase: pastTime(timestamp);
|
property string timePhrase: pastTime(timestamp);
|
||||||
property int onlineUsers: 0;
|
property int onlineUsers: 0;
|
||||||
property bool isConcurrency: action === 'concurrency';
|
property bool isConcurrency: action === 'concurrency';
|
||||||
|
@ -71,6 +71,10 @@ Item {
|
||||||
|
|
||||||
property bool hasGif: imageUrl.indexOf('.gif') === (imageUrl.length - 4);
|
property bool hasGif: imageUrl.indexOf('.gif') === (imageUrl.length - 4);
|
||||||
|
|
||||||
|
function pluralize(count, singular, optionalPlural) {
|
||||||
|
return (count === 1) ? singular : (optionalPlural || (singular + "s"));
|
||||||
|
}
|
||||||
|
|
||||||
DropShadow {
|
DropShadow {
|
||||||
visible: isStacked;
|
visible: isStacked;
|
||||||
anchors.fill: shadow1;
|
anchors.fill: shadow1;
|
||||||
|
@ -189,7 +193,7 @@ Item {
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
id: message;
|
id: message;
|
||||||
visible: !isAnnouncement;
|
visible: !isAnnouncement;
|
||||||
text: isConcurrency ? ((onlineUsers === 1) ? "person" : "people") : (isAnnouncement ? "connections" : (drillDownToPlace ? "snapshots" : ("by " + userName)));
|
text: isConcurrency ? pluralize(onlineUsers, "person", "people") : (drillDownToPlace ? "snapshots" : ("by " + userName));
|
||||||
size: textSizeSmall;
|
size: textSizeSmall;
|
||||||
color: messageColor;
|
color: messageColor;
|
||||||
elide: Text.ElideRight; // requires a width to be specified`
|
elide: Text.ElideRight; // requires a width to be specified`
|
||||||
|
@ -205,14 +209,14 @@ Item {
|
||||||
Column {
|
Column {
|
||||||
visible: isAnnouncement;
|
visible: isAnnouncement;
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
text: "connections" + " "; // fixme: pluralize
|
text: pluralize(onlineUsers, "connection") + " "; // hack padding
|
||||||
size: textSizeSmall;
|
size: textSizeSmall;
|
||||||
color: "white"; // fixme not needed? get rid of complication in messageColor?
|
color: messageColor;
|
||||||
}
|
}
|
||||||
RalewayRegular {
|
RalewayRegular {
|
||||||
text: "are here now"; // fixme pluralize
|
text: pluralize(onlineUsers, "is here now", "are here now");
|
||||||
size: textSizeSmall * 0.7;
|
size: textSizeSmall * 0.7;
|
||||||
color: "white"; //' fixme not needed? get rid of complication in messageColor?
|
color: messageColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spacing: textPadding;
|
spacing: textPadding;
|
||||||
|
|
Loading…
Reference in a new issue