diff --git a/build/config.yml b/build/config.yml index 37da251..26dfc4e 100644 --- a/build/config.yml +++ b/build/config.yml @@ -5,12 +5,12 @@ version: '3' # This information is used to generate the build assets. info: - companyName: "My Company" # The name of the company - productName: "My Product" # The name of the application - productIdentifier: "com.mycompany.myproduct" # The unique product identifier - description: "A program that does X" # The application description - copyright: "(c) 2024, My Company" # Copyright text - comments: "Some Product Comments" # Comments + companyName: "Voidraft" # The name of the company + productName: "Voidraftt" # The name of the application + productIdentifier: "landaiqing" # The unique product identifier + description: "Your Inspiration Catcher - Instant thought-capturing tool with minimalist design" # The application description + copyright: "© 2025 Voidraft. All rights reserved." # Copyright text + comments: "Effortlessly capture and organize fleeting ideas with minimal design" # Comments version: "v0.0.1" # The application version # Dev mode configuration diff --git a/build/linux/nfpm/nfpm.yaml b/build/linux/nfpm/nfpm.yaml index 012dd04..722356f 100644 --- a/build/linux/nfpm/nfpm.yaml +++ b/build/linux/nfpm/nfpm.yaml @@ -10,9 +10,9 @@ version: "0.1.0" section: "default" priority: "extra" maintainer: ${GIT_COMMITTER_NAME} <${GIT_COMMITTER_EMAIL}> -description: "My Product Description" -vendor: "My Company" -homepage: "https://wails.io" +description: "Voidraft: Your Inspiration Catcher - Instant thought-capturing tool with minimalist design" +vendor: "Voidraft" +homepage: "https://voidraft.app" license: "MIT" release: "1" diff --git a/build/windows/info.json b/build/windows/info.json index 850b2b5..48fdfd4 100644 --- a/build/windows/info.json +++ b/build/windows/info.json @@ -5,11 +5,11 @@ "info": { "0000": { "ProductVersion": "0.1.0", - "CompanyName": "My Company", - "FileDescription": "My Product Description", - "LegalCopyright": "© now, My Company", - "ProductName": "My Product", - "Comments": "This is a comment" + "CompanyName": "Voidraft", + "FileDescription": "Voidraft: Your Inspiration Catcher - Instant thought-capturing tool with minimalist design", + "LegalCopyright": "© 2025 Voidraft. All rights reserved.", + "ProductName": "Voidraft", + "Comments": "Effortlessly capture and organize fleeting ideas with minimal design" } } } \ No newline at end of file diff --git a/frontend/src/App.vue b/frontend/src/App.vue index c560b67..7a5914c 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,10 +1,9 @@ + + + + + {{ t('settings.title') }} + + + + + {{ t('settings.general') }} + + {{ t('settings.comingSoon') }} + + + + + + + \ No newline at end of file diff --git a/internal/systray/systray.go b/internal/systray/systray.go index 675ed30..8925da7 100644 --- a/internal/systray/systray.go +++ b/internal/systray/systray.go @@ -9,7 +9,7 @@ import ( ) // SetupSystemTray 设置系统托盘及其功能 -func SetupSystemTray(app *application.App, mainWindow *application.WebviewWindow, assets embed.FS) { +func SetupSystemTray(app *application.App, mainWindow *application.WebviewWindow, settingsWindow *application.WebviewWindow, assets embed.FS) { // 创建系统托盘 systray := app.NewSystemTray() @@ -22,9 +22,12 @@ func SetupSystemTray(app *application.App, mainWindow *application.WebviewWindow // 创建托盘菜单 menu := app.NewMenu() - menu.Add("显示主窗口").OnClick(func(data *application.Context) { + menu.Add("主窗口").OnClick(func(data *application.Context) { mainWindow.Show() }) + menu.Add("设置").OnClick(func(data *application.Context) { + settingsWindow.Show() + }) menu.AddSeparator() menu.Add("退出").OnClick(func(data *application.Context) { app.Quit() @@ -51,4 +54,16 @@ func SetupSystemTray(app *application.App, mainWindow *application.WebviewWindow mainWindow.Hide() }) + // 设置窗口关闭事件处理 + settingsWindow.RegisterHook(events.Common.WindowClosing, func(event *application.WindowEvent) { + // 取消默认关闭行为 + event.Cancel() + // 隐藏窗口 + settingsWindow.Hide() + }) + + // 注册事件监听器,用于处理前端发送的显示设置窗口事件 + app.OnEvent("show_settings_window", func(event *application.CustomEvent) { + settingsWindow.Show() + }) } diff --git a/main.go b/main.go index a4b505e..ba7bcc6 100644 --- a/main.go +++ b/main.go @@ -60,9 +60,26 @@ func main() { BackgroundColour: application.NewRGB(27, 38, 54), URL: "/", }) + mainWindow.Center() + settingsWindow := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ + Title: "voidraft设置", + Width: 500, + Height: 600, + Hidden: true, // 初始时隐藏设置窗口 + AlwaysOnTop: true, + Mac: application.MacWindow{ + Backdrop: application.MacBackdropTranslucent, + TitleBar: application.MacTitleBarHiddenInset, + InvisibleTitleBarHeight: 50, + }, + Windows: application.WindowsWindow{}, + BackgroundColour: application.NewRGB(27, 38, 54), + URL: "/settings", + }) + settingsWindow.Center() // 设置系统托盘 - systray.SetupSystemTray(app, mainWindow, assets) + systray.SetupSystemTray(app, mainWindow, settingsWindow, assets) // Create a goroutine that emits an event containing the current time every second. // The frontend can listen to this event and update the UI accordingly.