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 »

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: 4833
Joined: Sat Mar 14, 2009 3:13 pm

Re: Tooltips on geyser labels?

Post by Vadi »

I don't believe so.

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

Re: Tooltips on geyser labels?

Post by Nyyrazzilyss »

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: 4833
Joined: Sat Mar 14, 2009 3:13 pm

Re: Tooltips on geyser labels?

Post by Vadi »

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 »

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: 4833
Joined: Sat Mar 14, 2009 3:13 pm

Re: Tooltips on geyser labels?

Post by Vadi »

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

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

Re: Tooltips on geyser labels?

Post by Vadi »

You can now add a tooltip out of the box: https://wiki.mudlet.org/w/Manual:Geyser ... to_a_label

Post Reply