5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-16 17:09:28 +08:00

Fix IconPosition in Windows/Linux. Update docs.

This commit is contained in:
Lea Anthony 2025-02-03 19:24:40 +11:00
parent b21bb16c08
commit 0ecfcee3bf
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
3 changed files with 13 additions and 13 deletions

View File

@ -2,7 +2,7 @@
title: System Tray
description: Learn how to create and use system tray icons in Wails
---
import {Badge} from '@astrojs/starlight/components';
## Introduction
@ -168,14 +168,14 @@ Explore these examples for more advanced usage:
### Core Methods
| Method | Description |
|--------------------------------|--------------------------------------------|
|------------------------------------------|--------------------------------------------|
| `NewSystemTray()` | Creates a new system tray instance |
| `Run()` | Starts the system tray |
| `SetLabel(label string)` | Sets the text label |
| `SetIcon(icon []byte)` | Sets the icon image |
| `SetDarkModeIcon(icon []byte)` | Sets the dark mode variant of the icon |
| `SetTemplateIcon(icon []byte)` | Marks the icon as a template image (macOS) |
| `SetIconPosition(position int)`| Sets the icon position (macOS) |
| `SetIconPosition(position IconPosition)` | Sets the icon position (macOS) |
| `Destroy()` | Destroys the system tray |
### Menu Management

View File

@ -112,7 +112,7 @@ func (i systrayMenuItem) dbus() *dbusMenu {
return item
}
func (s *linuxSystemTray) setIconPosition(position int) {
func (s *linuxSystemTray) setIconPosition(position IconPosition) {
s.iconPosition = position
}

View File

@ -377,7 +377,7 @@ func (s *windowsSystemTray) setTemplateIcon(_ []byte) {
// Unsupported - do nothing
}
func (s *windowsSystemTray) setIconPosition(position int) {
func (s *windowsSystemTray) setIconPosition(position IconPosition) {
// Unsupported - do nothing
}