-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
393 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Theme, Icons } from "../theme.slint"; | ||
import { IconBtn } from "icon-btn.slint"; | ||
import { TextBtn } from "btn.slint"; | ||
import { Label } from "label.slint"; | ||
import { Link } from "link.slint"; | ||
|
||
export component AccountBalance inherits Rectangle { | ||
in-out property account-name <=> account.text; | ||
in-out property balance <=> balance-label.text; | ||
|
||
callback account-clicked <=> account.clicked; | ||
callback copy <=> copy-btn.clicked; | ||
|
||
VerticalLayout { | ||
padding-top: Theme.padding * 5; | ||
padding-bottom: Theme.padding * 5; | ||
spacing: Theme.spacing * 2; | ||
alignment: LayoutAlignment.start; | ||
|
||
HorizontalLayout { | ||
alignment: LayoutAlignment.center; | ||
spacing: Theme.spacing * 2; | ||
|
||
account := Link { | ||
horizontal-alignment: TextHorizontalAlignment.center; | ||
font-weight: 0.5; | ||
font-size: Theme.title4-font-size; | ||
} | ||
|
||
copy-btn := IconBtn { | ||
icon: Icons.copy; | ||
} | ||
} | ||
|
||
balance-label := Label { | ||
horizontal-alignment: TextHorizontalAlignment.center; | ||
font-weight: 0.5; | ||
font-size: Theme.title1-font-size * 2; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Theme } from "../theme.slint"; | ||
import { TokenTile, TokenTileEntry } from "token-tile.slint"; | ||
import { SettingDetailInner } from "setting-detail.slint"; | ||
|
||
|
||
export component TokenList inherits SettingDetailInner { | ||
in-out property <[TokenTileEntry]> entries; | ||
|
||
vbox-alignment: LayoutAlignment.start; | ||
vbox-spacing: Theme.spacing * 2; | ||
|
||
callback clicked(TokenTileEntry); | ||
|
||
for item[index] in entries: TokenTile { | ||
entry: item; | ||
|
||
clicked => { | ||
root.clicked(item); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { Switch } from "std-widgets.slint"; | ||
import { Theme } from "../theme.slint"; | ||
import { ListTile } from "list-tile.slint"; | ||
import { Label } from "label.slint"; | ||
import { IconBtn } from "icon-btn.slint"; | ||
|
||
export struct TokenTileEntry { | ||
uuid: string, | ||
icon: image, | ||
symbol: string, | ||
mint-address: string, | ||
balance: string, | ||
balance-usdt: string, | ||
} | ||
|
||
component Tile inherits Rectangle { | ||
in-out property <TokenTileEntry> entry; | ||
|
||
in property <length> icon-size: Theme.icon-size; | ||
in property <color> icon-colorize; | ||
|
||
in property <length> symbol-font-size: Theme.title3-font-size; | ||
in property <length> balance-font-size: Theme.default-font-size; | ||
in property <length> balance-usdt-font-size: Theme.title3-font-size; | ||
|
||
out property <bool> has-hover: ta.has-hover; | ||
|
||
callback clicked <=> ta.clicked; | ||
|
||
height: hbox.preferred-height; | ||
background: has-hover ? Theme.base-background.darker(3%) : Theme.base-background; | ||
border-radius: Theme.border-radius; | ||
drop-shadow-blur: Theme.padding * 2; | ||
drop-shadow-color: Theme.base-background-drop-shadow; | ||
|
||
ta := TouchArea { | ||
mouse-cursor: MouseCursor.pointer; | ||
} | ||
|
||
hbox := HorizontalLayout { | ||
padding: Theme.padding * 2; | ||
spacing: Theme.spacing * 2; | ||
alignment: LayoutAlignment.space-between; | ||
|
||
HorizontalLayout { | ||
horizontal-stretch: 1; | ||
spacing: Theme.spacing * 2; | ||
|
||
VerticalLayout { | ||
alignment: LayoutAlignment.center; | ||
Rectangle { | ||
width: root.icon-size + Theme.padding * 4; | ||
height: self.width; | ||
|
||
img := Image { | ||
height: root.icon-size; | ||
width: self.height; | ||
source: entry.icon; | ||
colorize: root.icon-colorize; | ||
} | ||
} | ||
} | ||
|
||
VerticalLayout { | ||
alignment: LayoutAlignment.space-between; | ||
spacing: Theme.spacing * 2; | ||
padding-top: Theme.padding; | ||
padding-bottom: Theme.padding; | ||
|
||
Label { | ||
font-size: root.symbol-font-size; | ||
text: entry.symbol; | ||
wrap: TextWrap.no-wrap; | ||
overflow: TextOverflow.elide; | ||
font-weight: 0.5; | ||
} | ||
|
||
Label { | ||
font-size: root.balance-font-size; | ||
text: entry.balance; | ||
wrap: TextWrap.no-wrap; | ||
overflow: TextOverflow.elide; | ||
} | ||
} | ||
} | ||
|
||
@children | ||
} | ||
} | ||
|
||
export component TokenTile inherits Tile { | ||
Label { | ||
font-size: root.balance-usdt-font-size; | ||
text: root.entry.balance-usdt; | ||
} | ||
} | ||
|
||
export component TokenTileWithSwitch inherits Rectangle { | ||
in-out property checked <=> sw.checked; | ||
|
||
callback toggled <=> sw.toggled; | ||
|
||
sw := Switch { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.