Skip to content

Commit

Permalink
feat(@desktop/wallet): Adds enabled state for the token selector need…
Browse files Browse the repository at this point in the history
…ed when Simple send is scrolling
  • Loading branch information
Khushboo-dev-cpp committed Dec 4, 2024
1 parent f742050 commit da50bdc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
10 changes: 10 additions & 0 deletions storybook/pages/TokenSelectorButtonPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Pane {

selected: selectionCheckBox.checked
forceHovered: forceHoveredCheckBox.checked
size: smallCheckBox.checked ? TokenSelectorButton.Size.Small :
TokenSelectorButton.Size.Normal


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

text: "force hovered"
}


CheckBox {
id: smallCheckBox

text: "small"
}
}

Settings {
Expand Down
9 changes: 9 additions & 0 deletions storybook/pages/TokenSelectorPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ Pane {

anchors.centerIn: parent

size: smallCheckbox.checked ? TokenSelectorButton.Size.Small :
TokenSelectorButton.Size.Normal

assetsModel: assetsModelCheckBox.checked ? assetsModel : null
collectiblesModel: collectiblesModelCheckBox.checked ? collectiblesModel : null

Expand All @@ -215,6 +218,12 @@ Pane {
checked: true
text: "Collectibles model assigned"
}

CheckBox {
id: smallCheckbox

text: "small"
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions ui/app/AppLayouts/Wallet/controls/TokenSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Control {
/** Expected model structure: see SearchableCollectiblesPanel::model **/
property alias collectiblesModel: tokenSelectorPanel.collectiblesModel

/** Sets size of the TokenSelectorButton **/
property alias size: tokenSelectorButton.size

readonly property bool isTokenSelected: tokenSelectorButton.selected

signal assetSelected(string key)
Expand Down
14 changes: 12 additions & 2 deletions ui/app/AppLayouts/Wallet/controls/TokenSelectorButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,17 @@ Control {
property string name
property url icon

/** Sets size of the Token Selector Button **/
property int size: TokenSelectorButton.Size.Normal

signal clicked

padding: 10
enum Size {
Small,
Normal
}

padding: root.selected ? 0 : 10

background: StatusComboboxBackground {
border.width: 0
Expand Down Expand Up @@ -83,7 +91,9 @@ Control {
Layout.fillWidth: true

objectName: "tokenSelectorContentItemText"
font.pixelSize: 28
font.pixelSize: root.size === TokenSelectorButton.Size.Normal ? 28 : 22
lineHeightMode: Text.FixedHeight
lineHeight: root.size === TokenSelectorButton.Size.Normal ? 38 : 30
color: root.hovered ? Theme.palette.blue : Theme.palette.darkBlue

elide: Text.ElideRight
Expand Down

0 comments on commit da50bdc

Please sign in to comment.