mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 06:47:01 +00:00
Adjusted badge positions as designs. Fixes #1619
This commit is contained in:
parent
05f38fa966
commit
c84806aa4e
@ -32,42 +32,12 @@ Item {
|
|||||||
text: qsTrId("security")
|
text: qsTrId("security")
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
StatusSettingsLineButton {
|
||||||
id: backupSeedPhrase
|
|
||||||
height: backupText.height
|
|
||||||
width: parent.width
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: backupText
|
|
||||||
//% "Backup Seed Phrase"
|
|
||||||
text: qsTrId("backup-seed-phrase")
|
text: qsTrId("backup-seed-phrase")
|
||||||
font.pixelSize: 15
|
isBadge: !profileModel.mnemonic.isBackedUp
|
||||||
color: !badge.visible ? Style.current.darkGrey : Style.current.textColor
|
isEnabled: !profileModel.mnemonic.isBackedUp
|
||||||
}
|
onClicked: {
|
||||||
|
backupSeedModal.open()
|
||||||
Rectangle {
|
|
||||||
id: badge
|
|
||||||
visible: !profileModel.mnemonic.isBackedUp
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: 0
|
|
||||||
radius: 9
|
|
||||||
color: Style.current.blue
|
|
||||||
width: 18
|
|
||||||
height: 18
|
|
||||||
Text {
|
|
||||||
font.pixelSize: 12
|
|
||||||
color: Style.current.white
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
enabled: !profileModel.mnemonic.isBackedUp
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: backupSeedModal.open()
|
|
||||||
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,15 +202,24 @@ RowLayout {
|
|||||||
anchors.topMargin: 0
|
anchors.topMargin: 0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: chatBadge
|
||||||
visible: chatsModel.unreadMessagesCount > 0
|
visible: chatsModel.unreadMessagesCount > 0
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.right
|
anchors.left: parent.right
|
||||||
anchors.leftMargin: -10
|
anchors.leftMargin: -16
|
||||||
anchors.topMargin: -5
|
anchors.topMargin: 1
|
||||||
radius: width / 2
|
radius: height / 2
|
||||||
|
color: Style.current.white
|
||||||
|
width: chatsModel.unreadMessagesCount < 10 ? 22 : messageCount.width + 14
|
||||||
|
height: 22
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.width - 4
|
||||||
|
height: parent.height - 4
|
||||||
|
radius: height / 2
|
||||||
color: Style.current.blue
|
color: Style.current.blue
|
||||||
width: chatsModel.unreadMessagesCount < 10 ? 18 : messageCount.width + 10
|
|
||||||
height: 18
|
|
||||||
Text {
|
Text {
|
||||||
id: messageCount
|
id: messageCount
|
||||||
font.pixelSize: chatsModel.unreadMessagesCount > 99 ? 10 : 12
|
font.pixelSize: chatsModel.unreadMessagesCount > 99 ? 10 : 12
|
||||||
@ -220,6 +229,7 @@ RowLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StatusIconTabButton {
|
StatusIconTabButton {
|
||||||
id: walletBtn
|
id: walletBtn
|
||||||
@ -252,12 +262,20 @@ RowLayout {
|
|||||||
visible: !profileModel.mnemonic.isBackedUp && sLayout.children[sLayout.currentIndex] !== profileLayoutContainer
|
visible: !profileModel.mnemonic.isBackedUp && sLayout.children[sLayout.currentIndex] !== profileLayoutContainer
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.right
|
anchors.left: parent.right
|
||||||
anchors.leftMargin: -10
|
anchors.leftMargin: -17
|
||||||
anchors.topMargin: -5
|
anchors.topMargin: -2
|
||||||
radius: width / 2
|
radius: height / 2
|
||||||
|
color: Style.current.white
|
||||||
|
width: 22
|
||||||
|
height: 22
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.width - 4
|
||||||
|
height: parent.height - 4
|
||||||
|
radius: height / 2
|
||||||
color: Style.current.blue
|
color: Style.current.blue
|
||||||
width: 18
|
|
||||||
height: 18
|
|
||||||
Text {
|
Text {
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
color: Style.current.white
|
color: Style.current.white
|
||||||
@ -266,6 +284,7 @@ RowLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StatusIconTabButton {
|
StatusIconTabButton {
|
||||||
id: nodeBtn
|
id: nodeBtn
|
||||||
|
@ -8,6 +8,9 @@ Item {
|
|||||||
property bool isSwitch: false
|
property bool isSwitch: false
|
||||||
property bool switchChecked: false
|
property bool switchChecked: false
|
||||||
property string currentValue
|
property string currentValue
|
||||||
|
property bool isBadge: false
|
||||||
|
property string badgeText: "1"
|
||||||
|
property bool isEnabled: true
|
||||||
signal clicked(bool checked)
|
signal clicked(bool checked)
|
||||||
|
|
||||||
id: root
|
id: root
|
||||||
@ -18,6 +21,7 @@ Item {
|
|||||||
id: textItem
|
id: textItem
|
||||||
text: root.text
|
text: root.text
|
||||||
font.pixelSize: 15
|
font.pixelSize: 15
|
||||||
|
color: !root.isEnabled ? Style.current.darkGrey : Style.current.textColor
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@ -37,12 +41,31 @@ Item {
|
|||||||
|
|
||||||
StatusSwitch {
|
StatusSwitch {
|
||||||
id: switchItem
|
id: switchItem
|
||||||
|
enabled: root.isEnabled
|
||||||
visible: root.isSwitch
|
visible: root.isSwitch
|
||||||
checked: root.switchChecked
|
checked: root.switchChecked
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: textItem.verticalCenter
|
anchors.verticalCenter: textItem.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: badge
|
||||||
|
visible: root.isBadge & !root.isSwitch
|
||||||
|
anchors.right: root.isSwitch ? switchItem.left : caret.left
|
||||||
|
anchors.rightMargin: Style.current.padding
|
||||||
|
anchors.verticalCenter: textItem.verticalCenter
|
||||||
|
radius: 9
|
||||||
|
color: Style.current.blue
|
||||||
|
width: 18
|
||||||
|
height: 18
|
||||||
|
Text {
|
||||||
|
font.pixelSize: 12
|
||||||
|
color: Style.current.white
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: root.badgeText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SVGImage {
|
SVGImage {
|
||||||
id: caret
|
id: caret
|
||||||
visible: !root.isSwitch
|
visible: !root.isSwitch
|
||||||
@ -61,6 +84,7 @@ Item {
|
|||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
enabled: root.isEnabled
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.clicked(!root.switchChecked)
|
root.clicked(!root.switchChecked)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user