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
|
connected := u.statusState != nil && u.statusState.Connected
|
||||||
statusText := "Offline"
|
statusText := "Offline"
|
||||||
statusColor := warningColor
|
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 {
|
if connected {
|
||||||
statusText = "Connected"
|
statusText = "Connected"
|
||||||
@@ -738,15 +738,11 @@ func (u *ui) layoutDashboard(gtx layout.Context) layout.Dimensions {
|
|||||||
}),
|
}),
|
||||||
layout.Rigid(spacerW(12)),
|
layout.Rigid(spacerW(12)),
|
||||||
layout.Flexed(1, func(gtx layout.Context) layout.Dimensions {
|
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.Rigid(spacerW(12)),
|
||||||
layout.Flexed(1, func(gtx layout.Context) layout.Dimensions {
|
layout.Flexed(1, func(gtx layout.Context) layout.Dimensions {
|
||||||
state := "Offline"
|
return u.metricCard(gtx, "Subscriptions", fmt.Sprintf("%d", len(u.subs.Subscriptions)), successColor)
|
||||||
if u.statusState != nil && u.statusState.Connected {
|
|
||||||
state = strings.ToUpper(u.statusState.ConfigType)
|
|
||||||
}
|
|
||||||
return u.metricCard(gtx, "Active mode", state, successColor)
|
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
@@ -991,10 +987,12 @@ func (u *ui) buttonLike(gtx layout.Context, btn *widget.Clickable, label string,
|
|||||||
Left: hPad,
|
Left: hPad,
|
||||||
Right: hPad,
|
Right: hPad,
|
||||||
}.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
|
}.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||||
lbl := material.Label(u.theme, unit.Sp(14), label)
|
return layout.Center.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||||
lbl.Color = fg
|
lbl := material.Label(u.theme, unit.Sp(14), label)
|
||||||
lbl.Alignment = text.Middle
|
lbl.Color = fg
|
||||||
return lbl.Layout(gtx)
|
lbl.Alignment = text.Middle
|
||||||
|
return lbl.Layout(gtx)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user