fix: add various fixes/improvements to identicons
This commit is contained in:
parent
ddbffa7f28
commit
6221c0a540
@ -62,7 +62,9 @@ QtObject {
|
|||||||
itemId: "x012340000"
|
itemId: "x012340000"
|
||||||
name: "#status"
|
name: "#status"
|
||||||
icon: ""
|
icon: ""
|
||||||
|
emoji: ""
|
||||||
isIdenticon: false
|
isIdenticon: false
|
||||||
|
colorHash: []
|
||||||
color: "blue"
|
color: "blue"
|
||||||
description: ""
|
description: ""
|
||||||
type: StatusChatListItem.Type.PublicChat
|
type: StatusChatListItem.Type.PublicChat
|
||||||
@ -78,7 +80,9 @@ QtObject {
|
|||||||
itemId: "x012340001"
|
itemId: "x012340001"
|
||||||
name: "status-desktop"
|
name: "status-desktop"
|
||||||
icon: ""
|
icon: ""
|
||||||
|
emoji: ""
|
||||||
isIdenticon: false
|
isIdenticon: false
|
||||||
|
colorHash: []
|
||||||
color: "red"
|
color: "red"
|
||||||
description: ""
|
description: ""
|
||||||
type: StatusChatListItem.Type.PublicChat
|
type: StatusChatListItem.Type.PublicChat
|
||||||
@ -95,7 +99,9 @@ QtObject {
|
|||||||
name: "Amazing Funny Squirrel"
|
name: "Amazing Funny Squirrel"
|
||||||
icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0Bh
|
icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0Bh
|
||||||
CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
|
CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
|
||||||
|
emoji: ""
|
||||||
isIdenticon: true
|
isIdenticon: true
|
||||||
|
colorHash: []
|
||||||
color: "green"
|
color: "green"
|
||||||
description: ""
|
description: ""
|
||||||
type: StatusChatListItem.Type.OneToOneChat
|
type: StatusChatListItem.Type.OneToOneChat
|
||||||
@ -111,7 +117,9 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
itemId: "x012340003"
|
itemId: "x012340003"
|
||||||
name: "Black Ops"
|
name: "Black Ops"
|
||||||
icon: ""
|
icon: ""
|
||||||
|
emoji: ""
|
||||||
isIdenticon: false
|
isIdenticon: false
|
||||||
|
colorHash: []
|
||||||
color: "purple"
|
color: "purple"
|
||||||
description: ""
|
description: ""
|
||||||
type: StatusChatListItem.Type.OneToOneChat
|
type: StatusChatListItem.Type.OneToOneChat
|
||||||
@ -127,7 +135,9 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
itemId: "x012340004"
|
itemId: "x012340004"
|
||||||
name: "Spectacular Growing Otter"
|
name: "Spectacular Growing Otter"
|
||||||
icon: ""
|
icon: ""
|
||||||
|
emoji: ""
|
||||||
isIdenticon: false
|
isIdenticon: false
|
||||||
|
colorHash: []
|
||||||
color: "orange"
|
color: "orange"
|
||||||
description: ""
|
description: ""
|
||||||
type: StatusChatListItem.Type.OneToOneChat
|
type: StatusChatListItem.Type.OneToOneChat
|
||||||
@ -143,7 +153,9 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
itemId: "x012340005"
|
itemId: "x012340005"
|
||||||
name: "channel-with-a-super-duper-long-name"
|
name: "channel-with-a-super-duper-long-name"
|
||||||
icon: ""
|
icon: ""
|
||||||
|
emoji: ""
|
||||||
isIdenticon: false
|
isIdenticon: false
|
||||||
|
colorHash: []
|
||||||
color: "green"
|
color: "green"
|
||||||
description: ""
|
description: ""
|
||||||
type: StatusChatListItem.Type.PublicChat
|
type: StatusChatListItem.Type.PublicChat
|
||||||
@ -397,7 +409,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: ""
|
imageSource: ""
|
||||||
iconName: "chat"
|
iconName: "chat"
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: false
|
|
||||||
subItems: [
|
subItems: [
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "sub_item_1_1"
|
value: "sub_item_1_1"
|
||||||
@ -405,7 +416,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
imageSource: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
||||||
iconName: ""
|
iconName: ""
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: false
|
|
||||||
},
|
},
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "sub_item_1_2"
|
value: "sub_item_1_2"
|
||||||
@ -413,7 +423,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
|
imageSource: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
|
||||||
iconName: ""
|
iconName: ""
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: true
|
|
||||||
}]}
|
}]}
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "item_2"
|
value: "item_2"
|
||||||
@ -421,7 +430,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
imageSource: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
||||||
iconName: ""
|
iconName: ""
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: false
|
|
||||||
subItems: [
|
subItems: [
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "sub_item_2_1"
|
value: "sub_item_2_1"
|
||||||
@ -429,7 +437,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: ""
|
imageSource: ""
|
||||||
iconName: "channel"
|
iconName: "channel"
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: false
|
|
||||||
},
|
},
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "sub_item_2_2"
|
value: "sub_item_2_2"
|
||||||
@ -437,7 +444,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: ""
|
imageSource: ""
|
||||||
iconName: "channel"
|
iconName: "channel"
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: false
|
|
||||||
},
|
},
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "sub_item_2_3"
|
value: "sub_item_2_3"
|
||||||
@ -445,7 +451,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: ""
|
imageSource: ""
|
||||||
iconName: "channel"
|
iconName: "channel"
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: false
|
|
||||||
}]}
|
}]}
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "item_3"
|
value: "item_3"
|
||||||
@ -453,7 +458,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: "";
|
imageSource: "";
|
||||||
iconName: "info"
|
iconName: "info"
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: false
|
|
||||||
subItems: [
|
subItems: [
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "sub_item_3_1"
|
value: "sub_item_3_1"
|
||||||
@ -461,7 +465,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: ""
|
imageSource: ""
|
||||||
iconName: "channel"
|
iconName: "channel"
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: false
|
|
||||||
}]}
|
}]}
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "item_4"
|
value: "item_4"
|
||||||
@ -469,7 +472,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: "";
|
imageSource: "";
|
||||||
iconName: ""
|
iconName: ""
|
||||||
iconColor: "red"
|
iconColor: "red"
|
||||||
isIdenticon: false
|
|
||||||
subItems: [
|
subItems: [
|
||||||
ListElement {
|
ListElement {
|
||||||
value: "sub_item_4_1"
|
value: "sub_item_4_1"
|
||||||
@ -477,7 +479,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||||||
imageSource: ""
|
imageSource: ""
|
||||||
iconName: "channel"
|
iconName: "channel"
|
||||||
iconColor: ""
|
iconColor: ""
|
||||||
isIdenticon: false
|
|
||||||
}]}
|
}]}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,23 +90,25 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StatusChatListItem {
|
StatusChatListItem {
|
||||||
|
|
||||||
id: statusChatListItem
|
id: statusChatListItem
|
||||||
|
|
||||||
opacity: dragSensor.active ? 0.0 : 1.0
|
opacity: dragSensor.active ? 0.0 : 1.0
|
||||||
originalOrder: model.position
|
originalOrder: model.position
|
||||||
chatId: model.itemId
|
chatId: model.itemId
|
||||||
categoryId: model.parentItemId? model.parentItemId : ""
|
categoryId: model.parentItemId? model.parentItemId : ""
|
||||||
name: model.name
|
name: model.name
|
||||||
icon.emoji: model.emoji
|
|
||||||
type: !!model.type ? model.type : StatusChatListItem.Type.CommunityChat
|
type: !!model.type ? model.type : StatusChatListItem.Type.CommunityChat
|
||||||
muted: model.muted
|
muted: model.muted
|
||||||
hasUnreadMessages: model.hasUnreadMessages
|
hasUnreadMessages: model.hasUnreadMessages
|
||||||
notificationsCount: model.notificationsCount
|
notificationsCount: model.notificationsCount
|
||||||
highlightWhenCreated: !!model.highlight
|
highlightWhenCreated: !!model.highlight
|
||||||
selected: model.active
|
selected: model.active
|
||||||
|
|
||||||
|
icon.emoji: model.emoji
|
||||||
icon.color: model.color
|
icon.color: model.color
|
||||||
image.isIdenticon: model.isIdenticon
|
image.isIdenticon: false
|
||||||
image.source: model.icon
|
image.source: model.icon
|
||||||
|
ringSettings.ringSpecModel: model.colorHash
|
||||||
|
|
||||||
sensor.cursorShape: dragSensor.cursorShape
|
sensor.cursorShape: dragSensor.cursorShape
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -10,7 +10,7 @@ import StatusQ.Components 0.1
|
|||||||
import StatusQ.Controls 0.1
|
import StatusQ.Controls 0.1
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: statusChatListItem
|
id: root
|
||||||
|
|
||||||
objectName: "chatItem"
|
objectName: "chatItem"
|
||||||
property int originalOrder: -1
|
property int originalOrder: -1
|
||||||
@ -29,11 +29,10 @@ Rectangle {
|
|||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
color: Theme.palette.miscColor5
|
color: Theme.palette.miscColor5
|
||||||
letterSize: emoji ? 11 : 15
|
|
||||||
emoji: ""
|
emoji: ""
|
||||||
emojiSize: Emoji.size.verySmall
|
charactersLen: root.type === StatusChatListItem.Type.OneToOneChat ? 2 : 1
|
||||||
charactersLen: 1
|
|
||||||
}
|
}
|
||||||
|
property alias ringSettings: identicon.ringSettings
|
||||||
property int type: StatusChatListItem.Type.PublicChat
|
property int type: StatusChatListItem.Type.PublicChat
|
||||||
property bool highlighted: false
|
property bool highlighted: false
|
||||||
property bool highlightWhenCreated: false
|
property bool highlightWhenCreated: false
|
||||||
@ -79,16 +78,16 @@ Rectangle {
|
|||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
|
||||||
onClicked: statusChatListItem.clicked(mouse)
|
onClicked: root.clicked(mouse)
|
||||||
|
|
||||||
StatusSmartIdenticon {
|
StatusSmartIdenticon {
|
||||||
id: identicon
|
id: identicon
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 8
|
anchors.leftMargin: 8
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
image: statusChatListItem.image
|
image: root.image
|
||||||
icon: statusChatListItem.icon
|
icon: root.icon
|
||||||
name: statusChatListItem.name
|
name: root.name
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusIcon {
|
StatusIcon {
|
||||||
@ -98,21 +97,21 @@ Rectangle {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
width: 14
|
width: 14
|
||||||
visible: statusChatListItem.type !== StatusChatListItem.Type.OneToOneChat
|
visible: root.type !== StatusChatListItem.Type.OneToOneChat
|
||||||
opacity: {
|
opacity: {
|
||||||
if (statusChatListItem.muted && !hoverHander.hovered && !statusChatListItem.highlighted) {
|
if (root.muted && !hoverHander.hovered && !root.highlighted) {
|
||||||
return 0.4
|
return 0.4
|
||||||
}
|
}
|
||||||
return statusChatListItem.hasUnreadMessages ||
|
return root.hasUnreadMessages ||
|
||||||
statusChatListItem.notificationsCount > 0 ||
|
root.notificationsCount > 0 ||
|
||||||
statusChatListItem.selected ||
|
root.selected ||
|
||||||
statusChatListItem.highlighted ||
|
root.highlighted ||
|
||||||
statusBadge.visible ||
|
statusBadge.visible ||
|
||||||
hoverHander.hovered ? 1.0 : 0.7
|
hoverHander.hovered ? 1.0 : 0.7
|
||||||
}
|
}
|
||||||
|
|
||||||
icon: {
|
icon: {
|
||||||
switch (statusChatListItem.type) {
|
switch (root.type) {
|
||||||
case StatusChatListItem.Type.PublicCat:
|
case StatusChatListItem.Type.PublicCat:
|
||||||
return Theme.palette.name == "light" ? "tiny/public-chat" : "tiny/public-chat-white"
|
return Theme.palette.name == "light" ? "tiny/public-chat" : "tiny/public-chat-white"
|
||||||
break;
|
break;
|
||||||
@ -137,27 +136,27 @@ Rectangle {
|
|||||||
anchors.rightMargin: 6
|
anchors.rightMargin: 6
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
text: (statusChatListItem.type === StatusChatListItem.Type.PublicChat &&
|
text: (root.type === StatusChatListItem.Type.PublicChat &&
|
||||||
!statusChatListItem.name.startsWith("#") ?
|
!root.name.startsWith("#") ?
|
||||||
"#" + statusChatListItem.name :
|
"#" + root.name :
|
||||||
statusChatListItem.name)
|
root.name)
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
color: {
|
color: {
|
||||||
if (statusChatListItem.muted && !hoverHander.hovered && !statusChatListItem.highlighted) {
|
if (root.muted && !hoverHander.hovered && !root.highlighted) {
|
||||||
return Theme.palette.directColor5
|
return Theme.palette.directColor5
|
||||||
}
|
}
|
||||||
return statusChatListItem.hasUnreadMessages ||
|
return root.hasUnreadMessages ||
|
||||||
statusChatListItem.notificationsCount > 0 ||
|
root.notificationsCount > 0 ||
|
||||||
statusChatListItem.selected ||
|
root.selected ||
|
||||||
statusChatListItem.highlighted ||
|
root.highlighted ||
|
||||||
statusChatListItem.highlightWhenCreated ||
|
root.highlightWhenCreated ||
|
||||||
hoverHander.hovered ||
|
hoverHander.hovered ||
|
||||||
statusBadge.visible ? Theme.palette.directColor1 : Theme.palette.directColor4
|
statusBadge.visible ? Theme.palette.directColor1 : Theme.palette.directColor4
|
||||||
}
|
}
|
||||||
font.weight: !statusChatListItem.muted &&
|
font.weight: !root.muted &&
|
||||||
(statusChatListItem.hasUnreadMessages ||
|
(root.hasUnreadMessages ||
|
||||||
statusChatListItem.notificationsCount > 0 ||
|
root.notificationsCount > 0 ||
|
||||||
statusChatListItem.highlightWhenCreated ||
|
root.highlightWhenCreated ||
|
||||||
statusBadge.visible) ? Font.Bold : Font.Medium
|
statusBadge.visible) ? Font.Bold : Font.Medium
|
||||||
font.pixelSize: 15
|
font.pixelSize: 15
|
||||||
}
|
}
|
||||||
@ -170,14 +169,14 @@ Rectangle {
|
|||||||
width: 14
|
width: 14
|
||||||
opacity: mutedIconSensor.containsMouse ? 1.0 : 0.2
|
opacity: mutedIconSensor.containsMouse ? 1.0 : 0.2
|
||||||
icon: Theme.palette.name === "light" ? "tiny/muted" : "tiny/muted-white"
|
icon: Theme.palette.name === "light" ? "tiny/muted" : "tiny/muted-white"
|
||||||
visible: statusChatListItem.muted
|
visible: root.muted
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mutedIconSensor
|
id: mutedIconSensor
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: statusChatListItem.unmute()
|
onClicked: root.unmute()
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusToolTip {
|
StatusToolTip {
|
||||||
@ -193,11 +192,11 @@ Rectangle {
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 8
|
anchors.rightMargin: 8
|
||||||
|
|
||||||
color: statusChatListItem.muted ? Theme.palette.primaryColor2 : Theme.palette.primaryColor1
|
color: root.muted ? Theme.palette.primaryColor2 : Theme.palette.primaryColor1
|
||||||
border.width: 4
|
border.width: 4
|
||||||
border.color: color
|
border.color: color
|
||||||
value: statusChatListItem.notificationsCount
|
value: root.notificationsCount
|
||||||
visible: statusChatListItem.notificationsCount > 0
|
visible: root.notificationsCount > 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ Rectangle {
|
|||||||
property alias identiconText: identiconText
|
property alias identiconText: identiconText
|
||||||
property string name
|
property string name
|
||||||
property string emoji
|
property string emoji
|
||||||
property string emojiSize
|
property string emojiSize: Emoji.size.small
|
||||||
property int letterSize: 21
|
property int letterSize: 21
|
||||||
property int charactersLen: 1
|
property int charactersLen: 1
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ Rectangle {
|
|||||||
if(Utils.isHtml(emoji))
|
if(Utils.isHtml(emoji))
|
||||||
return emoji
|
return emoji
|
||||||
else
|
else
|
||||||
return Emoji.parse(emoji, emojiSize || undefined)
|
return Emoji.parse(root.emoji, emojiSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
const shift = (root.name.charAt(0) === "#") ||
|
const shift = (root.name.charAt(0) === "#") ||
|
||||||
|
@ -15,7 +15,6 @@ Loader {
|
|||||||
property StatusIconSettings icon: StatusIconSettings {
|
property StatusIconSettings icon: StatusIconSettings {
|
||||||
width: 40
|
width: 40
|
||||||
height: 40
|
height: 40
|
||||||
charactersLen: 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
property StatusImageSettings image: StatusImageSettings {
|
property StatusImageSettings image: StatusImageSettings {
|
||||||
@ -25,7 +24,7 @@ Loader {
|
|||||||
|
|
||||||
property StatusIdenticonRingSettings ringSettings: StatusIdenticonRingSettings {
|
property StatusIdenticonRingSettings ringSettings: StatusIdenticonRingSettings {
|
||||||
initalAngleRad: 0
|
initalAngleRad: 0
|
||||||
ringPxSize: 1.5
|
ringPxSize: Math.max(1.5, statusSmartIdenticon.image.width / 24.0)
|
||||||
distinctiveColors: Theme.palette.identiconRingColors
|
distinctiveColors: Theme.palette.identiconRingColors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,10 @@ Rectangle {
|
|||||||
property StatusIconSettings icon: StatusIconSettings {
|
property StatusIconSettings icon: StatusIconSettings {
|
||||||
width: 36
|
width: 36
|
||||||
height: 36
|
height: 36
|
||||||
letterSize: 20
|
charactersLen: 2
|
||||||
}
|
}
|
||||||
|
property alias ringSettings: identicon.ringSettings
|
||||||
|
|
||||||
property int type: StatusChatInfoButton.Type.PublicChat
|
property int type: StatusChatInfoButton.Type.PublicChat
|
||||||
property alias tooltip: statusToolTip
|
property alias tooltip: statusToolTip
|
||||||
property alias sensor: sensor
|
property alias sensor: sensor
|
||||||
|
@ -11,6 +11,8 @@ TabButton {
|
|||||||
property string name: ""
|
property string name: ""
|
||||||
property bool highlighted: false
|
property bool highlighted: false
|
||||||
|
|
||||||
|
property alias identicon: identicon
|
||||||
|
|
||||||
implicitWidth: 40
|
implicitWidth: 40
|
||||||
implicitHeight: 40
|
implicitHeight: 40
|
||||||
|
|
||||||
@ -32,7 +34,6 @@ TabButton {
|
|||||||
icon.name: statusIconTabButton.icon.name
|
icon.name: statusIconTabButton.icon.name
|
||||||
icon.color: (statusIconTabButton.hovered || highlighted || statusIconTabButton.checked) ? Theme.palette.primaryColor1 : statusIconTabButton.icon.color
|
icon.color: (statusIconTabButton.hovered || highlighted || statusIconTabButton.checked) ? Theme.palette.primaryColor1 : statusIconTabButton.icon.color
|
||||||
icon.isLetterIdenticon: statusIconTabButton.name !== "" && !statusIconTabButton.icon.source.toString()
|
icon.isLetterIdenticon: statusIconTabButton.name !== "" && !statusIconTabButton.icon.source.toString()
|
||||||
icon.letterSize: 15
|
|
||||||
name: statusIconTabButton.name
|
name: statusIconTabButton.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,9 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getSegmentsCount() {
|
function getSegmentsCount() {
|
||||||
|
if (typeof settings.ringSpecModel.rowCount !== "undefined") {
|
||||||
|
return settings.ringSpecModel.rowCount()
|
||||||
|
}
|
||||||
if (typeof settings.ringSpecModel.count !== "undefined") {
|
if (typeof settings.ringSpecModel.count !== "undefined") {
|
||||||
return settings.ringSpecModel.count
|
return settings.ringSpecModel.count
|
||||||
}
|
}
|
||||||
@ -86,6 +89,9 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getSegment(i) {
|
function getSegment(i) {
|
||||||
|
if (typeof settings.ringSpecModel.rowCount !== "undefined") {
|
||||||
|
return abstactItemModelWrapper.itemAt(i)
|
||||||
|
}
|
||||||
if (typeof settings.ringSpecModel.count !== "undefined") {
|
if (typeof settings.ringSpecModel.count !== "undefined") {
|
||||||
return settings.ringSpecModel.get(i)
|
return settings.ringSpecModel.get(i)
|
||||||
}
|
}
|
||||||
@ -101,6 +107,14 @@ Item {
|
|||||||
return Math.max(1, units)
|
return Math.max(1, units)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
id: abstactItemModelWrapper
|
||||||
|
model: typeof settings.ringSpecModel.rowCount !== "undefined" ? settings.ringSpecModel : null
|
||||||
|
delegate: Item {
|
||||||
|
readonly property int segmentLength: model.segmentLength
|
||||||
|
readonly property int colorId: model.colorId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onPaint: {
|
onPaint: {
|
||||||
const context = getContext("2d")
|
const context = getContext("2d")
|
||||||
|
@ -2,7 +2,7 @@ import QtQuick 2.13
|
|||||||
import StatusQ.Core 0.1
|
import StatusQ.Core 0.1
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: statusIconSettings
|
id: root
|
||||||
|
|
||||||
property string name
|
property string name
|
||||||
property real width
|
property real width
|
||||||
@ -13,9 +13,14 @@ QtObject {
|
|||||||
property url source
|
property url source
|
||||||
property int rotation
|
property int rotation
|
||||||
property bool isLetterIdenticon
|
property bool isLetterIdenticon
|
||||||
property int letterSize
|
property int letterSize: emoji ? 11 : (charactersLen == 1 ? _oneLetterSize : _twoLettersSize)
|
||||||
property int charactersLen: 1
|
property int charactersLen: 1
|
||||||
property string emoji
|
property string emoji
|
||||||
property string emojiSize
|
property string emojiSize: _emojiSize
|
||||||
property StatusIconBackgroundSettings background: StatusIconBackgroundSettings {}
|
property StatusIconBackgroundSettings background: StatusIconBackgroundSettings {}
|
||||||
|
|
||||||
|
// can't have QtObject { id: d } inside QtObject, using '_' to indicate private
|
||||||
|
readonly property int _oneLetterSize: Math.max(15, root.width / 2.0)
|
||||||
|
readonly property int _twoLettersSize: Math.max(12, root.width / 2.2)
|
||||||
|
readonly property string _emojiSize: "%1x%1".arg(Math.max(16, root.width * 0.6))
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@ StatusPopupMenu {
|
|||||||
item.parentIconName = model.iconName;
|
item.parentIconName = model.iconName;
|
||||||
item.parentImageSource = model.imageSource;
|
item.parentImageSource = model.imageSource;
|
||||||
item.parentIdenticonColor = !!model.iconColor ? model.iconColor : Theme.palette.primaryColor1;
|
item.parentIdenticonColor = !!model.iconColor ? model.iconColor : Theme.palette.primaryColor1;
|
||||||
item.parentIsIdenticon = model.isIdenticon;
|
|
||||||
root.subMenuItemIcons.push({
|
root.subMenuItemIcons.push({
|
||||||
source: model.imageSource,
|
source: model.imageSource,
|
||||||
icon: model.iconName,
|
icon: model.iconName,
|
||||||
@ -103,7 +102,6 @@ StatusPopupMenu {
|
|||||||
image.source: model.imageSource
|
image.source: model.imageSource
|
||||||
iconSettings.name: model.iconName
|
iconSettings.name: model.iconName
|
||||||
iconSettings.color: model.iconColor
|
iconSettings.color: model.iconColor
|
||||||
image.isIdenticon: model.isIdenticon
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
searchPopup.resetSearchSelection()
|
searchPopup.resetSearchSelection()
|
||||||
if (menuLoader.parentTitleText === "Chat") {
|
if (menuLoader.parentTitleText === "Chat") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user