refactor: replace StatusWalletColor components with StatusQ components

This commit is contained in:
Pascal Precht 2021-10-27 13:32:10 +02:00 committed by r4bbit.eth
parent 426c116bac
commit b91a423801
8 changed files with 32 additions and 124 deletions

@ -1 +1 @@
Subproject commit 7e02a32f484b08d5c748ef22648cb329241f24e5
Subproject commit ea9a56027786ed5a4910b5bf1f90fd4f495305d8

View File

@ -3,15 +3,17 @@ import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtQuick.Dialogs 1.3
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import utils 1.0
import shared.panels 1.0
import shared.popups 1.0
import shared.status 1.0
import shared.controls 1.0
import "../stores"
import StatusQ.Controls 0.1
import "../stores"
// TODO: replace with StatusModal
ModalPopup {
@ -56,6 +58,7 @@ ModalPopup {
StatusWalletColorSelect {
id: accountColorInput
selectedColor: currentAccount.iconColor.toUpperCase()
model: Theme.palette.accountColors
anchors.top: accountNameInput.bottom
anchors.topMargin: marginBetweenInputs
anchors.left: parent.left

View File

@ -4,12 +4,14 @@ import QtQuick.Dialogs 1.3
import utils 1.0
import StatusQ.Controls 0.1 as StatusQControls
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import shared.panels 1.0
import shared.popups 1.0
import shared.status 1.0
import shared.controls 1.0
import "../stores"
// TODO: replace with StatusModal
@ -109,9 +111,10 @@ ModalPopup {
anchors.topMargin: marginBetweenInputs
anchors.left: parent.left
anchors.right: parent.right
model: Theme.palette.accountColors
}
footer: StatusQControls.StatusButton {
footer: StatusButton {
anchors.top: parent.top
anchors.right: parent.right
text: loading ?

View File

@ -4,12 +4,13 @@ import QtQuick.Dialogs 1.3
import utils 1.0
import StatusQ.Controls 0.1 as StatusQControls
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import shared 1.0
import shared.popups 1.0
import shared.status 1.0
import shared.controls 1.0
import "../stores"
// TODO: replace with StatusModal
@ -110,9 +111,10 @@ ModalPopup {
anchors.topMargin: marginBetweenInputs
anchors.left: parent.left
anchors.right: parent.right
model: Theme.current.accountColors
}
footer: StatusQControls.StatusButton {
footer: StatusButton {
anchors.top: parent.top
anchors.right: parent.right
text: loading ?

View File

@ -4,12 +4,13 @@ import QtQuick.Dialogs 1.3
import utils 1.0
import StatusQ.Controls 0.1 as StatusQControls
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import shared 1.0
import shared.popups 1.0
import shared.status 1.0
import shared.controls 1.0
import "../stores"
// TODO: replace with StatusModal
@ -82,9 +83,10 @@ ModalPopup {
anchors.topMargin: marginBetweenInputs
anchors.left: parent.left
anchors.right: parent.right
model: Theme.palette.accountColors
}
footer: StatusQControls.StatusButton {
footer: StatusButton {
anchors.top: parent.top
anchors.right: parent.right
text: loading ?

View File

@ -4,12 +4,13 @@ import QtQuick.Dialogs 1.3
import utils 1.0
import StatusQ.Controls 0.1 as StatusQControls
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import shared 1.0
import shared.popups 1.0
import shared.status 1.0
import shared.controls 1.0
import "../stores"
// TODO: replace with StatusModal
@ -78,13 +79,14 @@ ModalPopup {
StatusWalletColorSelect {
id: accountColorInput
selectedColor: Style.current.accountColors[0]
selectedColor: Theme.palette.accountColors[0]
anchors.top: accountNameInput.bottom
anchors.topMargin: marginBetweenInputs
width: parent.width
model: Theme.palette.accountColors
}
footer: StatusQControls.StatusButton {
footer: StatusButton {
anchors.top: parent.top
anchors.right: parent.right
text: loading ?

View File

@ -1,43 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import utils 1.0
import shared.panels 1.0
import StatusQ.Controls 0.1
StatusFlatRoundButton {
id: control
property bool selected: false
icon.source: Style.svg("walletIcon")
icon.width: 24
icon.height: 24
color: "transparent"
Rectangle {
anchors.fill: parent
color: control.hovered ? control.icon.color : "transparent"
opacity: 0.1
radius: 8
}
Rectangle {
width: 16
height: 16
anchors.top: parent.top
anchors.topMargin: 2
anchors.right: parent.right
anchors.rightMargin: 2
visible: control.selected
radius: width / 2
color: Style.current.green
SVGImage {
id: checkmark
source: Style.svg("checkmark")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
height: 10
fillMode: Image.PreserveAspectFit
}
}
}

View File

@ -1,61 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import shared 1.0
import shared.panels 1.0
import shared.status 1.0
Item {
id: control
property string selectedColor
//% "Account color"
property string label: qsTrId("account-color")
property var model: Style.current.accountColors
height: childrenRect.height
StyledText {
id: label
text: control.label
font.weight: Font.Medium
anchors.left: parent.left
anchors.top: parent.top
font.pixelSize: 13
height: 18
}
RowLayout {
id: colors
spacing: 6
anchors.top: label.bottom
anchors.topMargin: Style.current.halfPadding
anchors.left: parent.left
anchors.right: parent.right
Repeater {
model: control.model
StatusWalletColorButton {
id: colorBtn
icon.color: modelData
selected: {
const upperCaseColor = control.selectedColor.toUpperCase()
const upperCaseModelDataColor = modelData.toString().toUpperCase()
if (upperCaseColor === upperCaseModelDataColor) {
return true
}
// Check the colors in the other theme
const currentColor = Utils.getCurrentThemeAccountColor(upperCaseColor)
if (!currentColor) {
return false
}
return currentColor === upperCaseModelDataColor
}
onClicked: {
control.selectedColor = modelData.toUpperCase()
}
}
}
}
}