mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-17 01:19: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
|
title: System Tray
|
||||||
description: Learn how to create and use system tray icons in Wails
|
description: Learn how to create and use system tray icons in Wails
|
||||||
---
|
---
|
||||||
import {Badge} from '@astrojs/starlight/components';
|
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
@ -168,14 +168,14 @@ Explore these examples for more advanced usage:
|
|||||||
|
|
||||||
### Core Methods
|
### Core Methods
|
||||||
| Method | Description |
|
| Method | Description |
|
||||||
|--------------------------------|--------------------------------------------|
|
|------------------------------------------|--------------------------------------------|
|
||||||
| `NewSystemTray()` | Creates a new system tray instance |
|
| `NewSystemTray()` | Creates a new system tray instance |
|
||||||
| `Run()` | Starts the system tray |
|
| `Run()` | Starts the system tray |
|
||||||
| `SetLabel(label string)` | Sets the text label |
|
| `SetLabel(label string)` | Sets the text label |
|
||||||
| `SetIcon(icon []byte)` | Sets the icon image |
|
| `SetIcon(icon []byte)` | Sets the icon image |
|
||||||
| `SetDarkModeIcon(icon []byte)` | Sets the dark mode variant of the icon |
|
| `SetDarkModeIcon(icon []byte)` | Sets the dark mode variant of the icon |
|
||||||
| `SetTemplateIcon(icon []byte)` | Marks the icon as a template image (macOS) |
|
| `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 |
|
| `Destroy()` | Destroys the system tray |
|
||||||
|
|
||||||
### Menu Management
|
### Menu Management
|
||||||
|
@ -112,7 +112,7 @@ func (i systrayMenuItem) dbus() *dbusMenu {
|
|||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *linuxSystemTray) setIconPosition(position int) {
|
func (s *linuxSystemTray) setIconPosition(position IconPosition) {
|
||||||
s.iconPosition = position
|
s.iconPosition = position
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ func (s *windowsSystemTray) setTemplateIcon(_ []byte) {
|
|||||||
// Unsupported - do nothing
|
// Unsupported - do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *windowsSystemTray) setIconPosition(position int) {
|
func (s *windowsSystemTray) setIconPosition(position IconPosition) {
|
||||||
// Unsupported - do nothing
|
// Unsupported - do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user