fix: Moved `StatusTabButton` to StatusQ
This commit is contained in:
parent
7a14cf5640
commit
1870e9a0ce
|
@ -71,12 +71,9 @@ Popup {
|
|||
id: networkText
|
||||
text: {
|
||||
switch (Web3ProviderStore.currentNetwork) {
|
||||
//% "Mainnet"
|
||||
case Constants.networkMainnet: return qsTrId("mainnet");
|
||||
//% "Ropsten"
|
||||
case Constants.networkRopsten: return qsTrId("ropsten");
|
||||
//% "Unknown"
|
||||
default: return qsTrId("active-unknown")
|
||||
case Constants.networkMainnet: return qsTr("Mainnet");
|
||||
case Constants.networkRopsten: return qsTr("Ropsten");
|
||||
default: return qsTrId("Unknown")
|
||||
}
|
||||
}
|
||||
font.pixelSize: 15
|
||||
|
@ -87,8 +84,7 @@ Popup {
|
|||
|
||||
StatusBaseText {
|
||||
id: disconectBtn
|
||||
//% "Disconnect"
|
||||
text: qsTrId("disconnect")
|
||||
text: qsTr("Disconnect")
|
||||
font.pixelSize: 15
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
|
@ -181,29 +177,20 @@ Popup {
|
|||
anchors.topMargin: Style.current.bigPadding
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
TabBar {
|
||||
StatusTabBar {
|
||||
id: walletTabBar
|
||||
width: parent.width
|
||||
anchors.top: parent.top
|
||||
height: assetBtn.height
|
||||
background: Rectangle {
|
||||
color: Style.current.transparent
|
||||
border.width: 0
|
||||
}
|
||||
|
||||
StatusTabButton {
|
||||
id: assetBtn
|
||||
//% "Assets"
|
||||
btnText: qsTrId("wallet-assets")
|
||||
anchors.top: parent.top
|
||||
width: implicitWidth
|
||||
text: qsTr("Assets")
|
||||
}
|
||||
StatusTabButton {
|
||||
id: historyBtn
|
||||
anchors.top: parent.top
|
||||
anchors.left: assetBtn.right
|
||||
anchors.leftMargin: 32
|
||||
//% "History"
|
||||
btnText: qsTrId("history")
|
||||
width: implicitWidth
|
||||
text: qsTrId("History")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ Item {
|
|||
property string title: ""
|
||||
property string searchString: ""
|
||||
property string lowerCaseSearchString: searchString.toLowerCase()
|
||||
readonly property int count: contactsList.count
|
||||
|
||||
signal contactClicked(string publicKey)
|
||||
signal openProfilePopup(string publicKey)
|
||||
|
|
|
@ -51,42 +51,39 @@ SettingsContentBase {
|
|||
input.placeholderText: qsTr("Search by a display name or chat key")
|
||||
}
|
||||
|
||||
TabBar {
|
||||
StatusTabBar {
|
||||
id: contactsTabBar
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Style.current.padding
|
||||
Layout.rightMargin: Style.current.padding
|
||||
Layout.topMargin: 2 * Style.current.padding
|
||||
height: contactsBtn.height
|
||||
background: Rectangle {
|
||||
color: Style.current.transparent
|
||||
}
|
||||
|
||||
StatusTabButton {
|
||||
id: contactsBtn
|
||||
addToWidth: Style.current.bigPadding
|
||||
btnText: qsTr("Contacts")
|
||||
width: implicitWidth
|
||||
text: qsTr("Contacts")
|
||||
}
|
||||
StatusTabButton {
|
||||
id: pendingRequestsBtn
|
||||
addToWidth: Style.current.bigPadding
|
||||
width: implicitWidth
|
||||
enabled: root.contactsStore.receivedContactRequestsModel.count > 0 ||
|
||||
root.contactsStore.sentContactRequestsModel.count > 0
|
||||
btnText: qsTr("Pending Requests")
|
||||
text: qsTr("Pending Requests")
|
||||
badge.value: root.contactsStore.receivedContactRequestsModel.count
|
||||
}
|
||||
// Temporary commented until we provide appropriate flags on the `status-go` side to cover all sections.
|
||||
// StatusTabButton {
|
||||
// id: rejectedRequestsBtn
|
||||
// addToWidth: Style.current.bigPadding
|
||||
// width: implicitWidth
|
||||
// enabled: root.contactsStore.receivedButRejectedContactRequestsModel.count > 0 ||
|
||||
// root.contactsStore.sentButRejectedContactRequestsModel.count > 0
|
||||
// btnText: qsTr("Rejected Requests")
|
||||
// }
|
||||
StatusTabButton {
|
||||
id: blockedBtn
|
||||
addToWidth: Style.current.bigPadding
|
||||
width: implicitWidth
|
||||
enabled: root.contactsStore.blockedContactsModel.count > 0
|
||||
btnText: qsTr("Blocked")
|
||||
text: qsTr("Blocked")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ import QtQuick.Controls 2.13
|
|||
import QtQuick.Layouts 1.13
|
||||
import QtGraphicalEffects 1.13
|
||||
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
import utils 1.0
|
||||
|
||||
import shared 1.0
|
||||
|
@ -40,7 +42,7 @@ Item {
|
|||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
TabBar {
|
||||
StatusTabBar {
|
||||
id: walletTabBar
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.bigPadding
|
||||
|
@ -48,28 +50,24 @@ Item {
|
|||
anchors.leftMargin: Style.current.bigPadding
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Style.current.padding
|
||||
height: assetBtn.height
|
||||
background: Rectangle {
|
||||
color: Style.current.transparent
|
||||
}
|
||||
|
||||
StatusTabButton {
|
||||
id: assetBtn
|
||||
//% "Assets"
|
||||
btnText: qsTrId("wallet-assets")
|
||||
width: implicitWidth
|
||||
text: qsTrId("wallet-assets")
|
||||
}
|
||||
StatusTabButton {
|
||||
id: collectiblesBtn
|
||||
anchors.left: assetBtn.right
|
||||
anchors.leftMargin: 32
|
||||
//% "Collectibles"
|
||||
btnText: qsTrId("wallet-collectibles")
|
||||
width: implicitWidth
|
||||
text: qsTrId("wallet-collectibles")
|
||||
}
|
||||
StatusTabButton {
|
||||
id: historyBtn
|
||||
anchors.left: collectiblesBtn.right
|
||||
anchors.leftMargin: 32
|
||||
//% "History"
|
||||
btnText: qsTrId("history")
|
||||
width: implicitWidth
|
||||
text: qsTrId("history")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
|
||||
import utils 1.0
|
||||
import "../"
|
||||
import "../panels"
|
||||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Components 0.1
|
||||
|
||||
TabButton {
|
||||
property string btnText: "Default Button"
|
||||
property int addToWidth: 0
|
||||
|
||||
property alias badge: statusBadge
|
||||
|
||||
id: tabButton
|
||||
width: tabBtnText.width +
|
||||
(statusBadge.visible ? statusBadge.width + statusBadge.anchors.leftMargin : 0) +
|
||||
addToWidth
|
||||
|
||||
height: tabBtnText.height + 11
|
||||
text: ""
|
||||
padding: 0
|
||||
background: Rectangle {
|
||||
color: Style.current.transparent
|
||||
border.width: 0
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: tabBtnText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: btnText
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 15
|
||||
color: parent.checked || parent.hovered ? Style.current.textColor : Style.current.secondaryText
|
||||
}
|
||||
|
||||
StatusBadge {
|
||||
id: statusBadge
|
||||
visible: value > 0
|
||||
anchors.left: tabBtnText.right
|
||||
anchors.leftMargin: 10
|
||||
anchors.verticalCenter: tabBtnText.verticalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: parent.checked || parent.hovered
|
||||
color: parent.checked ? Style.current.primary : Style.current.secondaryBackground
|
||||
anchors.bottom: parent.bottom
|
||||
width: 40
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
height: 3
|
||||
radius: 4
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: parent
|
||||
onPressed: mouse.accepted = false
|
||||
}
|
||||
}
|
||||
|
||||
/*##^##
|
||||
Designer {
|
||||
D{i:0;formeditorColor:"#ffffff";formeditorZoom:1.75}
|
||||
}
|
||||
##^##*/
|
|
@ -17,7 +17,6 @@ SearchBox 1.0 SearchBox.qml
|
|||
SeedPhraseTextArea 1.0 SeedPhraseTextArea.qml
|
||||
SendToContractWarning 1.0 SendToContractWarning.qml
|
||||
SettingsRadioButton 1.0 SettingsRadioButton.qml
|
||||
StatusTabButton 1.0 StatusTabButton.qml
|
||||
StyledButton 1.0 StyledButton.qml
|
||||
StyledTextArea 1.0 StyledTextArea.qml
|
||||
StyledTextEdit 1.0 StyledTextEdit.qml
|
||||
|
|
|
@ -25,33 +25,29 @@ Item {
|
|||
|
||||
signal contactSelected(string address, int type)
|
||||
|
||||
TabBar {
|
||||
StatusTabBar {
|
||||
id: accountSelectionTabBar
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 20
|
||||
width: parent.width
|
||||
height: assetBtn.height
|
||||
background: Rectangle {
|
||||
color: Style.current.transparent
|
||||
}
|
||||
|
||||
StatusTabButton {
|
||||
id: assetBtn
|
||||
//% "Saved"
|
||||
btnText: qsTr("Saved")
|
||||
width: implicitWidth
|
||||
text: qsTr("Saved")
|
||||
}
|
||||
StatusTabButton {
|
||||
id: collectiblesBtn
|
||||
anchors.left: assetBtn.right
|
||||
anchors.leftMargin: 32
|
||||
//% "My Accounts"
|
||||
btnText: qsTr("My Accounts")
|
||||
width: implicitWidth
|
||||
text: qsTr("My Accounts")
|
||||
}
|
||||
StatusTabButton {
|
||||
id: historyBtn
|
||||
anchors.left: collectiblesBtn.right
|
||||
anchors.leftMargin: 32
|
||||
//% "Recent"
|
||||
btnText: qsTr("Recent")
|
||||
width: implicitWidth
|
||||
text: qsTr("Recent")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue