Fix Gio button alignment hints
This commit is contained in:
@@ -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)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user