mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-16 08:59:29 +08:00
Fix IconPosition in Windows/Linux. Update docs.
This commit is contained in:
parent
b21bb16c08
commit
0ecfcee3bf
@ -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
|
||||
|
||||
@ -167,16 +167,16 @@ Explore these examples for more advanced usage:
|
||||
## API Reference
|
||||
|
||||
### 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) |
|
||||
| `Destroy()` | Destroys the system tray |
|
||||
| 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 IconPosition)` | Sets the icon position (macOS) |
|
||||
| `Destroy()` | Destroys the system tray |
|
||||
|
||||
### Menu Management
|
||||
| Method | Description |
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user