Tooltips on geyser labels?

Geyser is an object oriented framework for creating, updating and organizing GUI elements within Mudlet.
Post Reply
Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Tooltips on geyser labels?

Post by Nyyrazzilyss » Fri Oct 27, 2017 2:46 pm

If need be I can fake it with :setOnEnter and :setOnLeave, however:

Is there any pre-existing functions in geyser to add tooltips display to labels?

User avatar
Vadi
Posts: 4703
Joined: Sat Mar 14, 2009 3:13 pm

Re: Tooltips on geyser labels?

Post by Vadi » Fri Oct 27, 2017 4:45 pm

I don't believe so.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Tooltips on geyser labels?

Post by Nyyrazzilyss » Sat Oct 28, 2017 10:08 pm

Would there be any way to use QToolTip / stylesheets/ or CSS to force tooltip creation? I sortof got one working using window entry/exit + mouse position, but it's not as quick as it should be. In particular, when it comes to making it work with hover.

User avatar
Vadi
Posts: 4703
Joined: Sat Mar 14, 2009 3:13 pm

Re: Tooltips on geyser labels?

Post by Vadi » Sun Oct 29, 2017 7:04 am

Maybe, I've never tried. Tooltips don't need to follow the mouse though - just appear and stay static?

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Tooltips on geyser labels?

Post by Nyyrazzilyss » Sun Oct 29, 2017 2:38 pm

Just appear on hover / disappear on subsequent mouse movement, yeah.

Looking at the events, there appears to be sysWindowMousePressEvent, sysWindowMouseReleaseEvent. :setOnEnter and :setOnLeave tell me when I enter/or exit a label. getMousePosition() gives the current mouse xp, yp.

Maybe was there also an event created on mouse movement, not just button press?

I've -almost- faked tooltips now, I just need to reduce the sensitivity of it. Creating from :setOnEnter / mouse position -at that time- ended up being just a bit to sensitive (the mouse is still moving and hasn't quite stopped yet to shift in to 'hover')

(edit)

Think I figured out what combination of those commands will work:

Don't display the tooltip from :setOnEnter, just use that to start checking for hover from the mouse position after a half second. I do poll the mouse position every second (which should be accurate enough in regards to whether i'm in hover or not). Creating the tooltip right from :setOnEnter however was the mistake I made.

User avatar
Vadi
Posts: 4703
Joined: Sat Mar 14, 2009 3:13 pm

Re: Tooltips on geyser labels?

Post by Vadi » Sun Oct 29, 2017 3:23 pm

There is an event on mouse move - added in 3.1 or 3.2. I'm on mobile right now, can't link.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest