mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 01:37:02 +02:00
Use OpacityMask instead of hack; fix connectionsTab
This commit is contained in:
parent
a7623dcac8
commit
98ee02f84f
2 changed files with 17 additions and 22 deletions
|
@ -42,8 +42,7 @@ Item {
|
||||||
property bool selected: false
|
property bool selected: false
|
||||||
property bool isAdmin: false
|
property bool isAdmin: false
|
||||||
property bool isPresent: true
|
property bool isPresent: true
|
||||||
property string imageMaskColor: pal.color;
|
property string profilePicBorderColor: (connectionStatus == "connection" ? hifi.colors.indigoAccent : (connectionStatus == "friend" ? hifi.colors.greenHighlight : "transparent"))
|
||||||
property string profilePicBorderColor: (connectionStatus == "connection" ? hifi.colors.indigoAccent : (connectionStatus == "friend" ? hifi.colors.greenHighlight : imageMaskColor))
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: avatarImage
|
id: avatarImage
|
||||||
|
@ -61,25 +60,25 @@ Item {
|
||||||
mipmap: true;
|
mipmap: true;
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
layer.enabled: true
|
||||||
|
layer.effect: OpacityMask {
|
||||||
|
maskSource: Item {
|
||||||
|
width: userImage.width;
|
||||||
|
height: userImage.height;
|
||||||
|
Rectangle {
|
||||||
|
anchors.centerIn: parent;
|
||||||
|
width: userImage.width; // This works because userImage is square
|
||||||
|
height: width;
|
||||||
|
radius: width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
AnimatedImage {
|
AnimatedImage {
|
||||||
source: "../../icons/profilePicLoading.gif"
|
source: "../../icons/profilePicLoading.gif"
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
visible: userImage.status != Image.Ready;
|
visible: userImage.status != Image.Ready;
|
||||||
}
|
}
|
||||||
// Circular mask
|
|
||||||
Rectangle {
|
|
||||||
id: avatarImageMask;
|
|
||||||
visible: avatarImage.visible;
|
|
||||||
anchors.verticalCenter: avatarImage.verticalCenter;
|
|
||||||
anchors.horizontalCenter: avatarImage.horizontalCenter;
|
|
||||||
width: avatarImage.width * 2;
|
|
||||||
height: avatarImage.height * 2;
|
|
||||||
color: "transparent"
|
|
||||||
radius: avatarImage.height;
|
|
||||||
border.color: imageMaskColor;
|
|
||||||
border.width: avatarImage.height/2;
|
|
||||||
}
|
|
||||||
StateImage {
|
StateImage {
|
||||||
id: infoHoverImage;
|
id: infoHoverImage;
|
||||||
visible: false;
|
visible: false;
|
||||||
|
|
|
@ -126,7 +126,6 @@ Rectangle {
|
||||||
id: myCard;
|
id: myCard;
|
||||||
// Properties
|
// Properties
|
||||||
profileUrl: myData.profileUrl;
|
profileUrl: myData.profileUrl;
|
||||||
imageMaskColor: pal.color;
|
|
||||||
displayName: myData.displayName;
|
displayName: myData.displayName;
|
||||||
userName: myData.userName;
|
userName: myData.userName;
|
||||||
audioLevel: myData.audioLevel;
|
audioLevel: myData.audioLevel;
|
||||||
|
@ -300,15 +299,14 @@ Rectangle {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
connectionsLoading.visible = false;
|
||||||
|
connectionsLoading.visible = true;
|
||||||
if (activeTab != "connectionsTab") {
|
if (activeTab != "connectionsTab") {
|
||||||
connectionsLoading.visible = false;
|
connectionsLoading.visible = false;
|
||||||
connectionsLoading.visible = true;
|
connectionsLoading.visible = true;
|
||||||
pal.sendToScript({method: 'refreshConnections'});
|
pal.sendToScript({method: 'refreshConnections'});
|
||||||
}
|
}
|
||||||
activeTab = "connectionsTab";
|
activeTab = "connectionsTab";
|
||||||
connectionsLoading.visible = false;
|
|
||||||
connectionsLoading.visible = true;
|
|
||||||
connectionsRefreshProblemText.visible = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -589,7 +587,7 @@ Rectangle {
|
||||||
property bool isCheckBox: styleData.role === "personalMute" || styleData.role === "ignore";
|
property bool isCheckBox: styleData.role === "personalMute" || styleData.role === "ignore";
|
||||||
property bool isButton: styleData.role === "mute" || styleData.role === "kick";
|
property bool isButton: styleData.role === "mute" || styleData.role === "kick";
|
||||||
property bool isAvgAudio: styleData.role === "avgAudioLevel";
|
property bool isAvgAudio: styleData.role === "avgAudioLevel";
|
||||||
opacity: model && model.isPresent ? 1.0 : 0.4;
|
opacity: !isButton ? (model && model.isPresent ? 1.0 : 0.4) : 1.0; // Admin actions shouldn't turn gray
|
||||||
|
|
||||||
// This NameCard refers to the cell that contains an avatar's
|
// This NameCard refers to the cell that contains an avatar's
|
||||||
// DisplayName and UserName
|
// DisplayName and UserName
|
||||||
|
@ -597,7 +595,6 @@ Rectangle {
|
||||||
id: nameCard;
|
id: nameCard;
|
||||||
// Properties
|
// Properties
|
||||||
profileUrl: (model && model.profileUrl) || "";
|
profileUrl: (model && model.profileUrl) || "";
|
||||||
imageMaskColor: rowColor(styleData.selected, styleData.row % 2);
|
|
||||||
displayName: styleData.value;
|
displayName: styleData.value;
|
||||||
userName: model ? model.userName : "";
|
userName: model ? model.userName : "";
|
||||||
connectionStatus: model ? model.connection : "";
|
connectionStatus: model ? model.connection : "";
|
||||||
|
@ -918,7 +915,6 @@ Rectangle {
|
||||||
// Properties
|
// Properties
|
||||||
visible: styleData.role === "userName";
|
visible: styleData.role === "userName";
|
||||||
profileUrl: (model && model.profileUrl) || "";
|
profileUrl: (model && model.profileUrl) || "";
|
||||||
imageMaskColor: rowColor(styleData.selected, styleData.row % 2);
|
|
||||||
displayName: "";
|
displayName: "";
|
||||||
userName: model ? model.userName : "";
|
userName: model ? model.userName : "";
|
||||||
connectionStatus : model ? model.connection : "";
|
connectionStatus : model ? model.connection : "";
|
||||||
|
|
Loading…
Reference in a new issue