Skip to content

Commit 544fd60

Browse files
committed
Theme: theme usage in Shape and other non-Item components fixed
1 parent b08f9bd commit 544fd60

File tree

5 files changed

+77
-66
lines changed

5 files changed

+77
-66
lines changed

ui/StatusQ/src/StatusQ/Components/StatusCommunityCard.qml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,12 @@ Rectangle {
181181
readonly property int bannerRadius: (root.cardSize === StatusCommunityCard.Size.Big) ? 20 : 8
182182
readonly property int bannerRadiusHovered: (root.cardSize === StatusCommunityCard.Size.Big) ? 30 : 16
183183
readonly property int cardRadius: (root.cardSize === StatusCommunityCard.Size.Big) ? 16 : 8
184-
readonly property color cardColor: Theme.palette.name === "light" ? Theme.palette.indirectColor1 : Theme.palette.baseColor2
185-
readonly property color fontColor: Theme.palette.directColor1
186-
readonly property color loadingColor1: Theme.palette.baseColor5
187-
readonly property color loadingColor2: Theme.palette.baseColor4
184+
readonly property color cardColor: root.Theme.palette.name === "light"
185+
? root.Theme.palette.indirectColor1
186+
: root.Theme.palette.baseColor2
187+
readonly property color fontColor: root.Theme.palette.directColor1
188+
readonly property color loadingColor1: root.Theme.palette.baseColor5
189+
readonly property color loadingColor2: root.Theme.palette.baseColor4
188190
readonly property int titleFontWeight: (root.cardSize === StatusCommunityCard.Size.Big) ? Font.Bold : Font.Medium
189191

190192
function numberFormat(number) {

ui/StatusQ/src/StatusQ/Components/StatusContactVerificationIcons.qml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Row {
1414

1515
property StatusAssetSettings mutualConnectionIcon: StatusAssetSettings {
1616
name: root.tiny ? "tiny/tiny-contact" : "tiny/contact"
17-
color: Theme.palette.indirectColor1
17+
color: root.Theme.palette.indirectColor1
1818
width: Math.min(bgWidth, dummyImage.width)
1919
height: Math.min(bgHeight, dummyImage.height)
2020
bgWidth: root.tiny ? 10 : 16.5
2121
bgHeight: root.tiny ? 10 : 16.5
2222
bgRadius: bgWidth / 2
23-
bgColor: Theme.palette.primaryColor1
23+
bgColor: root.Theme.palette.primaryColor1
2424
// Only used to get implicit width and height from the actual image
2525
property Image dummyImage: Image {
2626
source: mutualConnectionIcon.name ? Qt.resolvedUrl("../../assets/img/icons/" + mutualConnectionIcon.name + ".svg"): ""
@@ -33,13 +33,14 @@ Row {
3333
// None and Untrustworthy types, same aspect (Icon will not be visible in case of None type):
3434
name: root.trustIndicator === StatusContactVerificationIcons.TrustedType.Verified ? root.tiny ? "tiny/tiny-checkmark" : "tiny/checkmark"
3535
: root.tiny ? "tiny/tiny-exclamation" : "tiny/exclamation"
36-
color: Theme.palette.indirectColor1
36+
color: root.Theme.palette.indirectColor1
3737
width: Math.min(bgWidth, dummyImage.width)
3838
height: Math.min(bgHeight, dummyImage.height)
3939
bgWidth: root.tiny ? 10 : 16
4040
bgHeight: root.tiny ? 10 : 16
4141
bgRadius: bgWidth / 2
42-
bgColor: root.trustIndicator === StatusContactVerificationIcons.TrustedType.Verified ? Theme.palette.successColor1 : Theme.palette.dangerColor1
42+
bgColor: root.trustIndicator === StatusContactVerificationIcons.TrustedType.Verified ? root.Theme.palette.successColor1
43+
: root.Theme.palette.dangerColor1
4344
// Only used to get implicit width and height from the actual image
4445
property Image dummyImage: Image {
4546
source: trustContactIcon.name ? Qt.resolvedUrl("../../assets/img/icons/" + trustContactIcon.name + ".svg"): ""
@@ -50,7 +51,7 @@ Row {
5051

5152
property StatusAssetSettings blockedContactIcon: StatusAssetSettings {
5253
name: root.isBlocked ? "cancel" : ""
53-
color: Theme.palette.dangerColor1
54+
color: root.Theme.palette.dangerColor1
5455
width: Math.min(bgWidth, dummyImage.width)
5556
height: Math.min(bgHeight, dummyImage.height)
5657
bgWidth: root.tiny ? 10 : 16

ui/StatusQ/src/StatusQ/Components/private/statusMessage/StatusMessageReply.qml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ Item {
3737
antialiasing: true
3838

3939
ShapePath {
40-
strokeColor: Qt.hsla(Theme.palette.baseColor1.hslHue, Theme.palette.baseColor1.hslSaturation, Theme.palette.baseColor1.hslLightness, 0.4)
40+
strokeColor: {
41+
const base = root.Theme.palette.baseColor1
42+
return Qt.hsla(base.hslHue,
43+
base.hslSaturation,
44+
base.hslLightness, 0.4)
45+
}
4146
strokeWidth: 3
4247
fillColor: "transparent"
4348
capStyle: ShapePath.RoundCap

ui/app/AppLayouts/Wallet/panels/SwapInputPanel.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Control {
177177
background: Shape {
178178
id: shape
179179

180-
property int radius: Theme.radius
180+
property int radius: root.Theme.radius
181181
property int leftTopRadius: radius
182182
property int rightTopRadius: radius
183183
property int leftBottomRadius: radius
@@ -189,8 +189,8 @@ Control {
189189

190190
ShapePath {
191191
id: path
192-
fillColor: Theme.palette.indirectColor3
193-
strokeColor: amountToSendInput.cursorVisible ? Theme.palette.directColor7 : Theme.palette.directColor8
192+
fillColor: root.Theme.palette.indirectColor3
193+
strokeColor: amountToSendInput.cursorVisible ? root.Theme.palette.directColor7 : root.Theme.palette.directColor8
194194
strokeWidth: 1
195195
capStyle: ShapePath.RoundCap
196196

ui/imports/shared/controls/ShapeRectangle.qml

Lines changed: 56 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import utils
2727
\sa Shape
2828
\sa ShapePath
2929
*/
30-
Shape {
30+
Item {
3131
id: root
3232

3333
property string icon
@@ -46,6 +46,61 @@ Shape {
4646
implicitWidth: 448
4747
implicitHeight: 44
4848

49+
Shape {
50+
anchors.fill: parent
51+
ShapePath {
52+
id: path
53+
fillColor: "transparent"
54+
strokeColor: root.Theme.palette.baseColor2
55+
strokeWidth: 1
56+
strokeStyle: ShapePath.DashLine
57+
dashPattern: [4, 4]
58+
59+
startX: root.leftTopRadius
60+
startY: 0
61+
PathLine {
62+
x: root.width - root.rightTopRadius
63+
y: 0
64+
}
65+
PathArc {
66+
x: root.width
67+
y: root.rightTopRadius
68+
radiusX: root.rightTopRadius
69+
radiusY: root.rightTopRadius
70+
}
71+
PathLine {
72+
x: root.width
73+
y: root.height - root.rightBottomRadius
74+
}
75+
PathArc {
76+
x:root.width - root.rightBottomRadius
77+
y: root.height
78+
radiusX: root.rightBottomRadius
79+
radiusY: root.rightBottomRadius
80+
}
81+
PathLine {
82+
x: root.leftBottomRadius
83+
y: root.height
84+
}
85+
PathArc {
86+
x:0
87+
y: root.height - root.leftBottomRadius
88+
radiusX: root.leftBottomRadius
89+
radiusY: root.leftBottomRadius
90+
}
91+
PathLine {
92+
x: 0
93+
y: root.leftTopRadius
94+
}
95+
PathArc {
96+
x:root.leftTopRadius
97+
y: 0
98+
radiusX: root.leftTopRadius
99+
radiusY: root.leftTopRadius
100+
}
101+
}
102+
}
103+
49104
RowLayout {
50105
spacing: 4
51106
anchors.centerIn: parent
@@ -68,56 +123,4 @@ Shape {
68123
visible: !!text
69124
}
70125
}
71-
72-
ShapePath {
73-
id: path
74-
fillColor: "transparent"
75-
strokeColor: Theme.palette.baseColor2
76-
strokeWidth: 1
77-
strokeStyle: ShapePath.DashLine
78-
dashPattern: [4, 4]
79-
80-
startX: root.leftTopRadius
81-
startY: 0
82-
PathLine {
83-
x: root.width - root.rightTopRadius
84-
y: 0
85-
}
86-
PathArc {
87-
x: root.width
88-
y: root.rightTopRadius
89-
radiusX: root.rightTopRadius
90-
radiusY: root.rightTopRadius
91-
}
92-
PathLine {
93-
x: root.width
94-
y: root.height - root.rightBottomRadius
95-
}
96-
PathArc {
97-
x:root.width - root.rightBottomRadius
98-
y: root.height
99-
radiusX: root.rightBottomRadius
100-
radiusY: root.rightBottomRadius
101-
}
102-
PathLine {
103-
x: root.leftBottomRadius
104-
y: root.height
105-
}
106-
PathArc {
107-
x:0
108-
y: root.height - root.leftBottomRadius
109-
radiusX: root.leftBottomRadius
110-
radiusY: root.leftBottomRadius
111-
}
112-
PathLine {
113-
x: 0
114-
y: root.leftTopRadius
115-
}
116-
PathArc {
117-
x:root.leftTopRadius
118-
y: 0
119-
radiusX: root.leftTopRadius
120-
radiusY: root.leftTopRadius
121-
}
122-
}
123126
}

0 commit comments

Comments
 (0)