From fd8656ffa00ee09aaaddd73fc90ba1f9ac6453a0 Mon Sep 17 00:00:00 2001 From: administrator Date: Mon, 6 Apr 2026 08:58:22 +0700 Subject: [PATCH] Fix Gio button alignment hints --- internal/gui/app.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/internal/gui/app.go b/internal/gui/app.go index 942e66b..c58e531 100644 --- a/internal/gui/app.go +++ b/internal/gui/app.go @@ -626,7 +626,7 @@ func (u *ui) layoutStatusBanner(gtx layout.Context) layout.Dimensions { connected := u.statusState != nil && u.statusState.Connected statusText := "Offline" statusColor := warningColor - details := "No active tunnel." + details := "No active tunnel. Open the VLESS or WireGuard tab and press Connect on a saved config." if connected { statusText = "Connected" @@ -738,15 +738,11 @@ func (u *ui) layoutDashboard(gtx layout.Context) layout.Dimensions { }), layout.Rigid(spacerW(12)), layout.Flexed(1, func(gtx layout.Context) layout.Dimensions { - return u.metricCard(gtx, "Subscriptions", fmt.Sprintf("%d", len(u.subs.Subscriptions)), accentSoftColor) + return u.metricCard(gtx, "WireGuard configs", fmt.Sprintf("%d", len(u.configs.WireGuard)), accentSoftColor) }), layout.Rigid(spacerW(12)), layout.Flexed(1, func(gtx layout.Context) layout.Dimensions { - state := "Offline" - if u.statusState != nil && u.statusState.Connected { - state = strings.ToUpper(u.statusState.ConfigType) - } - return u.metricCard(gtx, "Active mode", state, successColor) + return u.metricCard(gtx, "Subscriptions", fmt.Sprintf("%d", len(u.subs.Subscriptions)), successColor) }), ) }), @@ -991,10 +987,12 @@ func (u *ui) buttonLike(gtx layout.Context, btn *widget.Clickable, label string, Left: hPad, Right: hPad, }.Layout(gtx, func(gtx layout.Context) layout.Dimensions { - lbl := material.Label(u.theme, unit.Sp(14), label) - lbl.Color = fg - lbl.Alignment = text.Middle - return lbl.Layout(gtx) + return layout.Center.Layout(gtx, func(gtx layout.Context) layout.Dimensions { + lbl := material.Label(u.theme, unit.Sp(14), label) + lbl.Color = fg + lbl.Alignment = text.Middle + return lbl.Layout(gtx) + }) }) }) }