feat : add new feature doubleClick LMB, context menu RMB update : Demo project update, add pseudo animation#5
feat : add new feature doubleClick LMB, context menu RMB update : Demo project update, add pseudo animation#5anomal3 wants to merge 1 commit into
Conversation
update : Demo project update, add pseudo animation
Bip901
left a comment
There was a problem hiding this comment.
I have confirmed that the double click event works. However:
- The tooltip does not appear for me when hovering over the icon. I'm testing on Windows 11.
- Note to self: need to recompile for Linux, since the tray struct has changed.
| @@ -1,7 +1,7 @@ | |||
| cmake_minimum_required(VERSION 3.0.0) | |||
|
|
|||
| cmake_minimum_required(VERSION 3.5.0) | |||
There was a problem hiding this comment.
Any specific reason to raise the minimum?
There was a problem hiding this comment.
In this case, I had to bump the version, as it's easier to change it here than to install a different CMake—if you catch my drift.
There was a problem hiding this comment.
Well, when working on an existing open-source project, you should fit your setup to the project and not the other way around.
| return HeapAlloc<Tray>.Copy(tray); | ||
| } | ||
| } | ||
| } No newline at end of file |
| Icon = icon; | ||
| } | ||
| } | ||
| } No newline at end of file |
| string iconPath, | ||
| IReadOnlyList<MenuItem> menuItems, | ||
| string? tooltip = null, | ||
| Action<NotifyIcon>? onDoubleClick = null) |
There was a problem hiding this comment.
I don't think that the Create method should accept a delegate. Users can simply subscribe to the DoubleClick event themselves using the returned NotifyIcon instance.
There was a problem hiding this comment.
I'm saying there shouldn't be 2 options to do the same thing.
| nid.hIcon = icon; | ||
| nid.uFlags |= NIF_TIP; | ||
| if (tray->tooltip != NULL) { | ||
| wcscpy_s(nid.szTip, sizeof(nid.szTip) / sizeof(WCHAR), (LPCWSTR)tray->tooltip); |
There was a problem hiding this comment.
Use _TRUNCATE to prevent crashes if the tooltip is too long, and _countof instead of calculating manually
| wcscpy_s(nid.szTip, sizeof(nid.szTip) / sizeof(WCHAR), (LPCWSTR)tray->tooltip); | |
| wcsncpy_s(nid.szTip, _countof(nid.szTip), (LPCWSTR)tray->tooltip, _TRUNCATE); |
|
It's strange that the tooltip isn't working. I might have messed something up. I'll look into it. |
No description provided.