ui: rounded touch keys, vertically centered row keys, right-aligned connection status on the wallets page

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Sonnet 5.5 committed 2026-11-04 10:59:06 +08:00
1 parent 8645298b41
commit 12a63c562f
4 files changed
+44 -10

No files matched your search

+22 -6
View File
@@ -1003,15 +1003,21 @@ namespace Decentralized
Cell(b, cols[1], w.Address, false, TextAnchor.MiddleLeft);
Cell(b, cols[2], Fmt.Credits(w.Value(Session.Price)), false, TextAnchor.MiddleRight);
Cell(b, cols[3], Fmt.Credits(w.Taint), false, TextAnchor.MiddleRight);
b.BeginPanel(cols[4], 28f, TextAnchor.MiddleLeft, 0f, 0f);
// 操作键一组(垂直居中、固定高度),连接状态单独靠右
b.BeginPanel(cols[4] - 140f, 32f, TextAnchor.MiddleLeft, 0f, 0f);
_clear.Add(b.Last.image);
b.BeginRow(4f, TextAnchor.MiddleLeft);
b.AddButton(L.T("wallets.open"), () => WalletWindow.Open(w));
b.AddButton(L.T("hw.copy"), () => { Clipboard.Copy(w.Address); _message = L.T("hw.copied.addr", w.Address); Open(); });
b.AddButton(L.T("wallets.rename"), () => { _renamePick = w.Address; _renameText = w.Label ?? ""; _message = null; Open(); });
if (idx != d.Current) b.AddButton(L.T("wallets.use"), () => { d.Current = idx; Session.Save(); Open(); });
RowKey(b, L.T("wallets.open"), () => WalletWindow.Open(w));
RowKey(b, L.T("hw.copy"), () => { Clipboard.Copy(w.Address); _message = L.T("hw.copied.addr", w.Address); Open(); });
RowKey(b, L.T("wallets.rename"), () => { _renamePick = w.Address; _renameText = w.Label ?? ""; _message = null; Open(); });
if (idx > 0) RowKey(b, _destroyPick == w.Address ? L.T("wallets.destroy.sure") : L.T("wallets.destroy"), () => DestroyWallet(w));
b.End();
b.End();
b.BeginPanel(100f, 32f, TextAnchor.MiddleRight, 0f, 0f);
_clear.Add(b.Last.image);
b.BeginRow(0f, TextAnchor.MiddleRight);
if (idx != d.Current) RowKey(b, L.T("wallets.use"), () => { d.Current = idx; Session.Save(); Open(); });
else b.AddLabel(L.T("wallets.current"), "wallets_cur_dim");
if (idx > 0) b.AddButton(_destroyPick == w.Address ? L.T("wallets.destroy.sure") : L.T("wallets.destroy"), () => DestroyWallet(w));
b.End();
b.End();
b.End();
@@ -1020,6 +1026,16 @@ namespace Decentralized
if (_renamePick != null) RenameRow(b);
}
/// <summary>表格行里的操作键:固定 24 高,垂直居中(行高 32)。</summary>
private static void RowKey(CustomUIBuilder b, string text, Action onClick)
{
b.AddButton(text, onClick);
var go = b.Last.root;
if (go == null) return;
var le = go.GetComponent<LayoutElement>() ?? go.AddComponent<LayoutElement>();
le.minHeight = 24f; le.preferredHeight = 24f; le.flexibleHeight = 0f;
}
private static string _destroyPick, _renamePick, _renameText = "";
/// <summary>改名:表格下方一行输入框;留空恢复默认名。</summary>