From a19b2027071b003083deabca49f4db09b7db62b7 Mon Sep 17 00:00:00 2001 From: Jumar Macato <16554748+jmacato@users.noreply.github.com> Date: Fri, 17 Sep 2021 21:54:24 +0800 Subject: [PATCH] more updates --- .../DBusSystemTray/SNIDBus.cs | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/Avalonia.FreeDesktop/DBusSystemTray/SNIDBus.cs b/src/Avalonia.FreeDesktop/DBusSystemTray/SNIDBus.cs index fc62d24a7d..f659c710a1 100644 --- a/src/Avalonia.FreeDesktop/DBusSystemTray/SNIDBus.cs +++ b/src/Avalonia.FreeDesktop/DBusSystemTray/SNIDBus.cs @@ -55,10 +55,6 @@ namespace Avalonia.FreeDesktop.DBusSystemTray } await snw.RegisterStatusNotifierItemAsync(sysTraySrvName); - - tx.Ready(); - - await yx.ActivateAsync(1, 1); } } @@ -83,9 +79,19 @@ namespace Avalonia.FreeDesktop.DBusSystemTray ObjectPath = new ObjectPath($"/StatusNotifierItem"); props = new StatusNotifierItemProperties(); + var dummyicons = new[] { (1, 1, new byte[8 * 4]), (1, 1, new byte[8 * 4]), }; + + + props.Title = "Avalonia Test Tray"; + props.IconPixmap = dummyicons; props.Id = ID; -// + props.IconName = "Avalonia"; + props.ToolTip = ("Avalonia Test Tooltip", dummyicons, "Avalonia Test Tooltip Message", "And another one"); + + + + // // // public string Category { get; set; } = default; // @@ -98,6 +104,7 @@ namespace Avalonia.FreeDesktop.DBusSystemTray // public int WindowId { get; set; } = default; } + // static class StatusNotifierItemExtensions // { @@ -148,7 +155,7 @@ namespace Avalonia.FreeDesktop.DBusSystemTray public async Task SecondaryActivateAsync(int X, int Y) { - throw new NotImplementedException(); + //throw new NotImplementedException(); } public async Task ScrollAsync(int Delta, string Orientation) @@ -193,6 +200,11 @@ namespace Avalonia.FreeDesktop.DBusSystemTray return Disposable.Create(() => NewStatusAsync -= handler); } + public async Task GetAsync(string prop) + { + return default; + } + public Action NewStatusAsync { get; set; } public async Task GetAllAsync() @@ -200,6 +212,11 @@ namespace Avalonia.FreeDesktop.DBusSystemTray return props; } + public async Task SetAsync(string prop, object val) + { + throw new NotImplementedException(); + } + public async Task WatchPropertiesAsync(Action handler) { OnPropertyChange += handler; @@ -335,7 +352,9 @@ namespace Avalonia.FreeDesktop.DBusSystemTray Task WatchNewOverlayIconAsync(Action handler, Action onError = null); Task WatchNewToolTipAsync(Action handler, Action onError = null); Task WatchNewStatusAsync(Action handler, Action onError = null); + Task GetAsync(string prop); Task GetAllAsync(); + Task SetAsync(string prop, object val); Task WatchPropertiesAsync(Action handler); }