Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,3 +489,27 @@ func formatShutterSpeed(num, den int64) string {
return fmt.Sprintf("%d/%ds", reducedNum, reducedDen)
}
}

// OpenSettingsWindow opens the settings window or focuses it if already open.
func (a *App) OpenSettingsWindow() {
app := application.Get()

// If the window already exists, focus it
if win, ok := app.Window.GetByName("settings"); ok && win != nil {
win.Show()
win.Focus()
return
}

app.Window.NewWithOptions(application.WebviewWindowOptions{
Name: "settings",
Title: "Preferences",
Width: 600,
Height: 500,
Mac: application.MacWindow{
TitleBar: application.MacTitleBarHiddenInsetUnified,
},
BackgroundColour: application.NewRGB(27, 38, 54),
URL: "/settings",
})
}
Loading