Idea: clickthrough property in a label

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

Idea: clickthrough property in a label

Post by Vadi »

Adding a enableLabelClickthrough("label name") and disableLabelClickthrough("label name") would bring a number of advantages to UI design. One idea I had in mind was setting custom labels on top of the mapper (replacing the default room info option which you can't modify) while still having the label act like the room info option - so you can still click on things underneath.

It would also allow you to layer labels and for easier design and have the relevant one accept the clicks at the bottom.

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Idea: clickthrough property in a label

Post by Akaya »

This is a great idea. I'd find this useful in a multitude of ways.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Idea: clickthrough property in a label

Post by Heiko »

And clickthru() would do what exactly?

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

Re: Idea: clickthrough property in a label

Post by Vadi »

There wouldn't be such a function. Just a function to enable clickthrough (which is defined as not capturing the click event and passing it on) and disabling the property.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Idea: clickthrough property in a label

Post by Heiko »

I'm not sure if this is easily doable with Qt without 2 much work (i. e. essentially setting up a backend on our own to provide a label stacking order feature)

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

Re: Idea: clickthrough property in a label

Post by Vadi »

I could be wrong, but I think that we already override the on click handler in labels to make function callbacks work - and from there we just return a value that says keep propagating.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Idea: clickthrough property in a label

Post by chris »

You can just add an enabled property to labels and toggle it. All that's needed is 3-4 lines of code. That's without a z ordering though, which may not be such a bad thing to implement as well.

phasma
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm
Discord: phasma#4694

Re: Idea: clickthrough property in a label

Post by phasma »

I wrote code for this months ago if I am interpreting this post correctly. Check out my timed warning labels post for a cool Growl-style stacking feature.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Idea: clickthrough property in a label

Post by chris »

It wouldn't accomplish the same goal. In essence, Vadi is saying if you have a label over the mapper, he would like the ability to 1) keep the label appear and 2) being able to double click/right click/etc a room.

User avatar
SlySven
Posts: 1023
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Idea: clickthrough property in a label

Post by SlySven »

Am I correct in thinking Qt would do this by having the Label's OnClick event handler either "accept"ing the event to handle it or "reject"ing it to pass it on through to the underlying mapper widget? Would the Z-ordering be OK if labels are all drawn after the rooms/exits/custom-lines or is it more magical than that? Is this only intended for the 2D mapper or do we eventually envisage adding label and other functionality to the 3D one?

Post Reply