OpenVPN / openvpn-gui

OpenVPN GUI is a graphical frontend for OpenVPN running on Windows 7 / 8 / 10. It creates an icon in the notification area from which you can control OpenVPN to start/stop your VPN tunnels, view the log and do other useful things.
Other
1.44k stars 403 forks source link

Use a custom tooltip window for the tray icon #670

Closed selvanair closed 7 months ago

selvanair commented 7 months ago

Built-in tray notification icon has a tip text length limit of 128 characters which is often limited for showing the connected profile name, connected since time and IP addresses. If the profile name is long the IP numbers could get truncated.

Fix by using a custom tooltip window and display it when mouse hovers over the icon. As the status bar need not be at the bottom of the screen (could be at right, left or top as well), the location of the window is chosen based on the mouse co-ordinates that trigger the hover event.

In case of errors while setting up the tooltip window, fall back to the current behaviour.

If the message is too long to include time and IP, truncate the profile name part of the message.

Fixes issue #666

Edit: force pushed after fixing some typos in commit message and buggy text truncation logic.

old

Screenshot from 2024-02-10 17-11-34

new

Screenshot from 2024-02-10 17-14-56

cron2 commented 7 months ago

I like the idea, but do not feel qualified today to ACK or NAK the code. @lstipakov something for you?

lstipakov commented 7 months ago

Hi,

On Windows 11 there are two issues;

Näyttökuva 2024-02-12 110139

selvanair commented 7 months ago

linking to my comment https://github.com/OpenVPN/openvpn-gui/issues/666#issuecomment-1938927344

selvanair commented 7 months ago

Force pushed with changes:

selvanair commented 7 months ago

(Moving this to the right place) Pushed two commits: (i) Remove title and prepend it to the message. And make tip_msg local. (ii) Position the tooltip window at a fixed distance above the icon instead of tracking the mouse position (figured how to do this :)

On Win11 the tip window should probably have more rounded corners, but will leave it at that.