Skip to content

Commit ca61997

Browse files
feat(@desktop/wallet): Adds enabled state for the token selector needed when Simple send is scrolling
1 parent e5fcab7 commit ca61997

File tree

5 files changed

+38
-2
lines changed

5 files changed

+38
-2
lines changed

storybook/pages/TokenSelectorButtonPage.qml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ Pane {
3636

3737
selected: selectionCheckBox.checked
3838
forceHovered: forceHoveredCheckBox.checked
39+
size: smallCheckBox.checked ? TokenSelectorButton.Size.Small :
40+
TokenSelectorButton.Size.Normal
41+
3942

4043
name: "My token" + (longNameCheckBox.checked ? " long name" : "")
4144
icon: Constants.tokenIcon("CFI")
@@ -61,6 +64,13 @@ Pane {
6164

6265
text: "force hovered"
6366
}
67+
68+
69+
CheckBox {
70+
id: smallCheckBox
71+
72+
text: "small"
73+
}
6474
}
6575

6676
Settings {

storybook/pages/TokenSelectorPage.qml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ Pane {
190190

191191
anchors.centerIn: parent
192192

193+
size: smallCheckbox.checked ? TokenSelectorButton.Size.Small :
194+
TokenSelectorButton.Size.Normal
195+
193196
assetsModel: assetsModelCheckBox.checked ? assetsModel : null
194197
collectiblesModel: collectiblesModelCheckBox.checked ? collectiblesModel : null
195198

@@ -215,6 +218,12 @@ Pane {
215218
checked: true
216219
text: "Collectibles model assigned"
217220
}
221+
222+
CheckBox {
223+
id: smallCheckbox
224+
225+
text: "small"
226+
}
218227
}
219228
}
220229

ui/app/AppLayouts/Wallet/controls/TokenSelector.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Control {
1717
/** Expected model structure: see SearchableCollectiblesPanel::model **/
1818
property alias collectiblesModel: tokenSelectorPanel.collectiblesModel
1919

20+
/** Sets size of the TokenSelectorButton **/
21+
property alias size: tokenSelectorButton.size
22+
2023
readonly property bool isTokenSelected: tokenSelectorButton.selected
2124

2225
signal assetSelected(string key)

ui/app/AppLayouts/Wallet/controls/TokenSelectorButton.qml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,17 @@ Control {
2020
property string name
2121
property url icon
2222

23+
/** Sets size of the Token Selector Button **/
24+
property int size: TokenSelectorButton.Size.Normal
25+
2326
signal clicked
2427

25-
padding: 10
28+
enum Size {
29+
Small,
30+
Normal
31+
}
32+
33+
padding: root.selected ? 0 : 10
2634

2735
background: StatusComboboxBackground {
2836
border.width: 0
@@ -83,7 +91,9 @@ Control {
8391
Layout.fillWidth: true
8492

8593
objectName: "tokenSelectorContentItemText"
86-
font.pixelSize: 28
94+
font.pixelSize: root.size === TokenSelectorButton.Size.Normal ? 28 : 22
95+
lineHeightMode: Text.FixedHeight
96+
lineHeight: root.size === TokenSelectorButton.Size.Normal ? 38 : 30
8797
color: root.hovered ? Theme.palette.blue : Theme.palette.darkBlue
8898

8999
elide: Text.ElideRight

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ RowLayout {
8282

8383
Layout.preferredWidth: implicitWidth
8484

85+
size: root.isStickyHeader ?
86+
TokenSelectorButton.Size.Small:
87+
TokenSelectorButton.Size.Normal
88+
8589
assetsModel: root.assetsModel
8690
collectiblesModel: root.collectiblesModel
8791

0 commit comments

Comments
 (0)