mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[v3 linux] systray: cleanup + add basic menu
This commit is contained in:
@@ -1157,9 +1157,9 @@ func systrayNew(label string) pointer {
|
||||
indicator := C.app_indicator_new(labelStr, labelStr, C.APP_INDICATOR_CATEGORY_APPLICATION_STATUS)
|
||||
|
||||
trayMenu := C.gtk_menu_new()
|
||||
// item := C.gtk_menu_item_new_with_label(labelStr)
|
||||
// C.gtk_menu_shell_append((*C.GtkMenuShell)(unsafe.Pointer(trayMenu)), item)
|
||||
// C.gtk_widget_show(item)
|
||||
item := C.gtk_menu_item_new_with_label(labelStr)
|
||||
C.gtk_menu_shell_append((*C.GtkMenuShell)(unsafe.Pointer(trayMenu)), item)
|
||||
C.gtk_widget_show(item)
|
||||
C.app_indicator_set_status(indicator, C.APP_INDICATOR_STATUS_ACTIVE)
|
||||
C.app_indicator_set_menu(indicator, (*C.GtkMenu)(unsafe.Pointer(trayMenu)))
|
||||
iconStr := C.CString("wails-systray-icon")
|
||||
@@ -1187,17 +1187,6 @@ func systrayMenuSet(tray pointer, menu pointer) {
|
||||
// C.app_indicator_set_menu((*C.AppIndicator)(tray), (*C.GtkMenu)(unsafe.Pointer(menu)))
|
||||
}
|
||||
|
||||
/*
|
||||
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(icon_file_path, NULL);
|
||||
int width, height;
|
||||
gdk_pixbuf_get_file_info (icon_file_path, &width, &height);
|
||||
gtk_icon_theme_add_builtin_icon ("custom_icon", width, pixbuf);
|
||||
g_object_unref (G_OBJECT (pixbuf));
|
||||
|
||||
GtkToolItem *toolbar_item = gtk_toggle_tool_button_new();
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON(toolbar_item), "custom_icon");
|
||||
*/
|
||||
|
||||
func systraySetTemplateIcon(tray pointer, icon []byte) {
|
||||
dirname, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
|
||||
@@ -95,6 +95,11 @@ func newSystemTrayImpl(s *SystemTray) systemTrayImpl {
|
||||
isTemplateIcon: s.isTemplateIcon,
|
||||
}
|
||||
}
|
||||
func (s *linuxSystemTray) openMenu() {
|
||||
if s.tray == nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (s *linuxSystemTray) openMenu() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user