fix: fix sticker popups to have the right colors and right size

This commit is contained in:
Jonathan Rainville 2021-03-26 17:21:50 -04:00 committed by Iuri Matias
parent fdf9d0b5ec
commit c460206c58
4 changed files with 58 additions and 56 deletions

View File

@ -27,7 +27,7 @@ Item {
}) })
//% "Buy for %1 SNT" //% "Buy for %1 SNT"
property string text: root.style === StatusStickerButton.StyleType.Default ? packPrice : qsTrId("buy-for--1-snt").arg(packPrice ) property string text: root.style === StatusStickerButton.StyleType.Default ? packPrice : qsTrId("buy-for--1-snt").arg(packPrice )
property color textColor: style === StatusStickerButton.StyleType.Default ? Style.current.pillButtonTextColor : Style.current.buttonForegroundColor property color textColor: style === StatusStickerButton.StyleType.Default ? Style.current.roundedButtonSecondaryForegroundColor : Style.current.buttonForegroundColor
property color bgColor: style === StatusStickerButton.StyleType.Default ? Style.current.blue : Style.current.secondaryBackground property color bgColor: style === StatusStickerButton.StyleType.Default ? Style.current.blue : Style.current.secondaryBackground
signal uninstallClicked() signal uninstallClicked()
signal installClicked() signal installClicked()
@ -44,7 +44,7 @@ Item {
target: root; target: root;
//% "Uninstall" //% "Uninstall"
text: root.style === StatusStickerButton.StyleType.Default ? "" : qsTrId("uninstall"); text: root.style === StatusStickerButton.StyleType.Default ? "" : qsTrId("uninstall");
textColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.pillButtonTextColor : Style.current.red; textColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.roundedButtonSecondaryForegroundColor : Style.current.red;
bgColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.green : Style.current.lightRed; bgColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.green : Style.current.lightRed;
icon: new Object({ icon: new Object({
path: "../../app/img/check.svg", path: "../../app/img/check.svg",
@ -83,7 +83,7 @@ Item {
PropertyChanges { PropertyChanges {
target: root; target: root;
text: root.style === StatusStickerButton.StyleType.Default ? packPrice : packPrice + " SNT"; text: root.style === StatusStickerButton.StyleType.Default ? packPrice : packPrice + " SNT";
textColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.pillButtonTextColor : Style.current.darkGrey textColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.roundedButtonSecondaryForegroundColor : Style.current.darkGrey
bgColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.darkGrey : Style.current.buttonDisabledBackgroundColor; bgColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.darkGrey : Style.current.buttonDisabledBackgroundColor;
enabled: false; enabled: false;
} }
@ -95,7 +95,7 @@ Item {
target: root; target: root;
//% "Pending..." //% "Pending..."
text: qsTrId("pending---"); text: qsTrId("pending---");
textColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.pillButtonTextColor : Style.current.darkGrey textColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.roundedButtonSecondaryForegroundColor : Style.current.darkGrey
bgColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.darkGrey : Style.current.grey; bgColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.darkGrey : Style.current.grey;
enabled: false; enabled: false;
icon: new Object({ icon: new Object({
@ -113,7 +113,7 @@ Item {
target: root; target: root;
//% "Cancel" //% "Cancel"
text: qsTrId("browsing-cancel"); text: qsTrId("browsing-cancel");
textColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.pillButtonTextColor : Style.current.red; textColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.pillButtonTexroundedButtonSecondaryForegroundColortColor : Style.current.red;
bgColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.red : Style.current.lightRed; bgColor: root.style === StatusStickerButton.StyleType.Default ? Style.current.red : Style.current.lightRed;
} }
}, },
@ -141,7 +141,7 @@ Item {
id: pill id: pill
anchors.right: parent.right anchors.right: parent.right
width: textMetrics.width + roundedIconImage.width + (Style.current.smallPadding * 2) + 6.7 width: textMetrics.width + roundedIconImage.width + (Style.current.smallPadding * 2) + 6.7
height: 26 height: 44
color: root.bgColor color: root.bgColor
radius: root.style === StatusStickerButton.StyleType.Default ? (width / 2) : 8 radius: root.style === StatusStickerButton.StyleType.Default ? (width / 2) : 8
@ -187,7 +187,7 @@ Item {
ColorOverlay { ColorOverlay {
anchors.fill: roundedIconImage anchors.fill: roundedIconImage
source: roundedIconImage source: roundedIconImage
color: Style.current.pillButtonTextColor color: Style.current.roundedButtonSecondaryForegroundColor
antialiasing: true antialiasing: true
} }
states: [ states: [

View File

@ -48,23 +48,29 @@ Item {
stickerPackDetailsPopup.open() stickerPackDetailsPopup.open()
} }
} }
ModalPopup { ModalPopup {
id: stickerPackDetailsPopup id: stickerPackDetailsPopup
height: 472 height: 472
header: StatusStickerPackDetails { header: StatusStickerPackDetails {
height: 46
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: Style.current.padding
width: parent.width - (Style.current.padding * 2)
packThumb: thumbnail packThumb: thumbnail
packName: name packName: name
packAuthor: author packAuthor: author
packNameFontSize: 17 packNameFontSize: 17
spacing: Style.current.padding / 2 spacing: Style.current.padding / 2
} }
contentWrapper.anchors.topMargin: 0
contentWrapper.anchors.bottomMargin: 0
StatusStickerList {
id: stickerGridInPopup
anchors.fill: parent
anchors.topMargin: Style.current.padding
model: stickers
}
footer: StatusStickerButton { footer: StatusStickerButton {
height: 76 height: 44
anchors.right: parent.right anchors.right: parent.right
style: StatusStickerButton.StyleType.LargeNoIcon style: StatusStickerButton.StyleType.LargeNoIcon
packPrice: price packPrice: price
@ -80,13 +86,6 @@ Item {
root.buyClicked(packId) root.buyClicked(packId)
} }
} }
contentWrapper.anchors.topMargin: 0
contentWrapper.anchors.bottomMargin: 0
StatusStickerList {
id: stickerGridInPopup
model: stickers
height: 350
}
} }
Component { Component {
id: stickerPackPurchaseModal id: stickerPackPurchaseModal
@ -150,7 +149,7 @@ Item {
height: 28 height: 28
iconWidth: 17.5 iconWidth: 17.5
iconHeight: 13.5 iconHeight: 13.5
iconColor: Style.current.pillButtonTextColor iconColor: Style.current.roundedButtonSecondaryForegroundColor
source: "../../app/img/arrowUp.svg" source: "../../app/img/arrowUp.svg"
rotation: 270 rotation: 270
onClicked: { onClicked: {

View File

@ -37,19 +37,37 @@ ModalPopup {
height: 472 height: 472
header: StatusStickerPackDetails { header: StatusStickerPackDetails {
id: stickerGrid id: stickerGrid
height: 76
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: Style.current.padding
width: parent.width - (Style.current.padding * 2)
packThumb: thumbnail packThumb: thumbnail
packName: name packName: name
packAuthor: author packAuthor: author
packNameFontSize: 17 packNameFontSize: 17
spacing: Style.current.padding / 2 spacing: Style.current.padding / 2
} }
contentWrapper.anchors.topMargin: 0
contentWrapper.anchors.bottomMargin: 0
StatusStickerList {
id: stickerGridInPopup
model: stickers
anchors.fill: parent
anchors.topMargin: Style.current.padding
Component {
id: stickerPackPurchaseModal
StatusStickerPackPurchaseModal {
onClosed: {
destroy()
}
stickerPackId: packId
packPrice: price
width: stickerPackDetailsPopup.width
height: stickerPackDetailsPopup.height
showBackBtn: stickerPackDetailsPopup.opened
}
}
}
footer: StatusStickerButton { footer: StatusStickerButton {
height: 76 height: 44
anchors.right: parent.right anchors.right: parent.right
style: StatusStickerButton.StyleType.LargeNoIcon style: StatusStickerButton.StyleType.LargeNoIcon
packPrice: price packPrice: price
@ -71,24 +89,4 @@ ModalPopup {
root.buyClicked(packId) root.buyClicked(packId)
} }
} }
contentWrapper.anchors.topMargin: 0
contentWrapper.anchors.bottomMargin: 0
StatusStickerList {
id: stickerGridInPopup
model: stickers
height: 350
Component {
id: stickerPackPurchaseModal
StatusStickerPackPurchaseModal {
onClosed: {
destroy()
}
stickerPackId: packId
packPrice: price
width: stickerPackDetailsPopup.width
height: stickerPackDetailsPopup.height
showBackBtn: stickerPackDetailsPopup.opened
}
}
}
} }

View File

@ -6,42 +6,47 @@ import "../../shared"
Item { Item {
id: root id: root
default property alias content: rest.children
property string packThumb: "QmfZrHmLR5VvkXSDbArDR3TX6j4FgpDcrvNz2fHSJk1VvG" property string packThumb: "QmfZrHmLR5VvkXSDbArDR3TX6j4FgpDcrvNz2fHSJk1VvG"
property string packName: "Status Cat" property string packName: "Status Cat"
property string packAuthor: "cryptoworld1373" property string packAuthor: "cryptoworld1373"
property int packNameFontSize: 15 property int packNameFontSize: 15
property int spacing: Style.current.padding property int spacing: Style.current.padding
height: childrenRect.height
width: parent.width
RoundedImage { RoundedImage {
id: imgThumb id: imgThumb
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
width: 40 width: 40
height: 40 height: 40
source: "https://ipfs.infura.io/ipfs/" + packThumb source: "https://ipfs.infura.io/ipfs/" + packThumb
} }
Column { Column {
anchors.left: imgThumb.right anchors.left: imgThumb.right
anchors.leftMargin: root.spacing anchors.leftMargin: root.spacing
anchors.verticalCenter: parent.verticalCenter StyledText {
Text {
id: txtPackName id: txtPackName
text: packName text: packName
color: Style.current.textColor
font.family: Style.current.fontBold.name font.family: Style.current.fontBold.name
font.weight: Font.Bold font.weight: Font.Bold
font.pixelSize: packNameFontSize font.pixelSize: packNameFontSize
} }
Text { StyledText {
color: Style.current.darkGrey color: Style.current.secondaryText
text: packAuthor text: packAuthor
font.family: Style.current.fontRegular.name font.family: Style.current.fontRegular.name
font.pixelSize: 15 font.pixelSize: 15
} }
} }
Item {
Separator {
anchors.top: imgThumb.bottom
anchors.topMargin: Style.current.padding
anchors.left: parent.left
anchors.leftMargin: -Style.current.padding
anchors.right: parent.right anchors.right: parent.right
id: rest anchors.rightMargin: -Style.current.padding
} }
} }