From abcbb6ae688f65b9786e8e9f5c859f4543347296 Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 7 Jul 2026 13:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- internal/ui/github.svg | 3 +++ internal/ui/view.go | 25 +++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 internal/ui/github.svg diff --git a/Makefile b/Makefile index cc67ecf..520d5a5 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ APP_BUNDLE = $(APP_NAME).app GO = go CGO_ENABLED = 1 GIT_HASH = $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown) -VERSION = 0.3.2-$(GIT_HASH) +VERSION = 0.3.3-$(GIT_HASH) LDFLAGS = -s -w -X lmvpn/internal/version.Version=$(VERSION) .PHONY: all build app run daemon clean vet tidy fmt icon diff --git a/internal/ui/github.svg b/internal/ui/github.svg new file mode 100644 index 0000000..46b8b07 --- /dev/null +++ b/internal/ui/github.svg @@ -0,0 +1,3 @@ + + + diff --git a/internal/ui/view.go b/internal/ui/view.go index fa3d3e0..855345f 100644 --- a/internal/ui/view.go +++ b/internal/ui/view.go @@ -1,7 +1,9 @@ package ui import ( + _ "embed" "fmt" + "net/url" "time" "lmvpn/internal/i18n" @@ -11,9 +13,13 @@ import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/dialog" + "fyne.io/fyne/v2/layout" "fyne.io/fyne/v2/widget" ) +//go:embed github.svg +var githubIconBytes []byte + // showError displays a titled error dialog. func showError(title, message string, parent fyne.Window) { dialog.NewCustom(title, i18n.T("BtnOK"), widget.NewLabel(message), parent).Show() @@ -77,14 +83,29 @@ func (a *App) buildMainWindow() fyne.CanvasObject { a.connectBtn, a.disconnectBtn, ) - return container.NewVBox( + githubBtn := widget.NewButtonWithIcon("", fyne.NewStaticResource("github.svg", githubIconBytes), func() { + u, err := url.Parse("https://github.com/wuwenfengmi1998/lmvpn_client") + if err != nil { + return + } + _ = a.fyneApp.OpenURL(u) + }) + + content := container.NewVBox( widget.NewLabel(i18n.T("ProfileLabel")), a.profileSelect, buttons, profileListBtn, statusCard, - widget.NewLabel(fmt.Sprintf("v%s", Version)), ) + + bottomBar := container.NewHBox( + widget.NewLabel(fmt.Sprintf("v%s", Version)), + layout.NewSpacer(), + githubBtn, + ) + + return container.NewBorder(nil, bottomBar, nil, nil, content) } // onConnect handles the Connect button click.