From 7c5b918ba1c8379faaea30df177c4e41faea8b83 Mon Sep 17 00:00:00 2001 From: blueJpg <2238288979@qq.com> Date: Mon, 15 Jul 2024 23:18:50 +0800 Subject: [PATCH] [*] improve ui --- README.md | 1 + README.zh-CN.md | 3 ++- src/logic/tokens.rs | 7 +------ src/logic/tr.rs | 1 + ui/base/transaction-fee.slint | 14 ++++++++------ ui/base/wait-transaction-confirmed.slint | 14 ++++++++------ 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 9ca6bcf..353ea5f 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ It's a `Solana` wallet. Based on Rust and Slint-ui. You can compile it for Linux - [x] Development mode of TestNet and DevNet - [x] Send SOL and spl token in MainNet - [x] Genarate QrCode for address +- [x] Support sending token with memo and setting prioritization fee ### TODO - [ ] fetch spl token price diff --git a/README.zh-CN.md b/README.zh-CN.md index 46ac525..5277ead 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -24,9 +24,10 @@ - [x] 测试模式:支持测试网和开发网 - [x] 在主网发送和接收Sol和Token - [x] 支持给地址生成QrCode +- [x] 支持发送备注和设置优先费用 ### TODO -- [ ] 获取 spl token 价格 +- [ ] 获取spl token价格 - [ ] 在Android平台复制和粘贴文本 ### 安卓平台编译信息 diff --git a/src/logic/tokens.rs b/src/logic/tokens.rs index afe11df..5b9b5fe 100644 --- a/src/logic/tokens.rs +++ b/src/logic/tokens.rs @@ -462,12 +462,7 @@ pub fn init(ui: &AppWindow) { if v <= max_prioritization_fee { SharedString::default() } else { - slint::format!( - "{}{}, {}", - tr("最大优先费用"), - max_prioritization_fee, - tr("请设置更大的优先费用") - ) + slint::format!("{} {}", tr("最大优先费用为"), max_prioritization_fee) } } } diff --git a/src/logic/tr.rs b/src/logic/tr.rs index 26d8e85..7ebd8fa 100644 --- a/src/logic/tr.rs +++ b/src/logic/tr.rs @@ -271,6 +271,7 @@ pub fn tr(text: &str) -> String { items.insert("优先费用", "Prioritization fee"); items.insert("基础费用", "Base fee"); items.insert("最大优先费用", "Max prioritization fee"); + items.insert("最大优先费用为", "Max prioritization fee is"); items.insert("慢", "Slow"); items.insert("正常", "Normal"); items.insert("快", "Fast"); diff --git a/ui/base/transaction-fee.slint b/ui/base/transaction-fee.slint index 1f281b1..b02b0e6 100644 --- a/ui/base/transaction-fee.slint +++ b/ui/base/transaction-fee.slint @@ -29,13 +29,14 @@ export component TransactionFee inherits SettingDetail { title: Logic.tr(Store.is-cn, "交易信息"); - if loading-status == LoadingStatus.Loading: Loading { - loading-text: Logic.tr(Store.is-cn, "正在估计交易费用..."); - colorize: Theme.secondary-brand-color; - icon-size: Theme.icon-size * 2; - } - SettingDetailInner { + if loading-status == LoadingStatus.Loading: Loading { + height: 150px; + loading-text: Logic.tr(Store.is-cn, "正在估计交易费用..."); + colorize: Theme.secondary-brand-color; + icon-size: Theme.icon-size * 2; + } + SettingDetailInnerVbox { SettingDetailLabel { text: Logic.tr(Store.is-cn, "区块网络"); @@ -171,6 +172,7 @@ export component TransactionFee inherits SettingDetail { HorizontalLayout { padding-top: Theme.padding * 5; + padding-bottom: Theme.padding * 5; if loading-status == LoadingStatus.Loading: CancelBtn { border-radius: Theme.border-radius; diff --git a/ui/base/wait-transaction-confirmed.slint b/ui/base/wait-transaction-confirmed.slint index 0145676..c8106de 100644 --- a/ui/base/wait-transaction-confirmed.slint +++ b/ui/base/wait-transaction-confirmed.slint @@ -20,13 +20,14 @@ export component WaitTransactionConfirmed inherits SettingDetail { title: Logic.tr(Store.is-cn, "交易记录"); - if loading-status == LoadingStatus.Loading: Loading { - loading-text: Logic.tr(Store.is-cn, "等待交易确认..."); - colorize: Theme.secondary-brand-color; - icon-size: Theme.icon-size * 2; - } - SettingDetailInner { + if loading-status == LoadingStatus.Loading: Loading { + height: 150px; + loading-text: Logic.tr(Store.is-cn, "等待交易确认..."); + colorize: Theme.secondary-brand-color; + icon-size: Theme.icon-size * 2; + } + SettingDetailInnerVbox { SettingDetailLabel { text: Logic.tr(Store.is-cn, "区块网络"); @@ -86,6 +87,7 @@ export component WaitTransactionConfirmed inherits SettingDetail { HorizontalLayout { padding-top: Theme.padding * 5; + padding-bottom: Theme.padding * 5; if loading-status == LoadingStatus.Loading: CancelBtn { border-radius: Theme.border-radius;