It is currently March 29th, 2024, 6:56 am

How to clickthrough font?

General topics related to Rainmeter.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

How to clickthrough font?

Post by kyriakos876 »

Hello, is there any InlineSetting that can make the font clickthrough ? Didn't find anything on the docs so I'm writing here.
If you want, in order to better understand what I mean, download the attached skin I'm currently working on and mouse over any button. Then click the button without moving the cursor after clicking. (make sure the cursor in on any letter displayed while clicking). You will see that the button Image restores, but you will have to move the cursor away from the letters for them to hide. Any ideas? Thanks!
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to clickthrough font?

Post by jsmorley »

Code: Select all

[Button1]
Meter=Button
ButtonImage=#@#Images\Button
MouseOverAction=[!HideMeter Icon1][!SetOption Button2 Y "67"][!ShowMeter Text1]#U#
LeftMouseUpAction=[!HideMeter Text1]#U#
MouseLeaveAction=[!ShowMeter Icon1][!SetOption Button2 Y "31r"][!HideMeter Text1]#U#
ImageTint=#Color#
X=0
Y=12
Note the change to LeftMouseUpAction.

There is no way to make any "meter" click-through.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: How to clickthrough font?

Post by kyriakos876 »

jsmorley wrote:

Code: Select all

[Button1]
Meter=Button
ButtonImage=#@#Images\Button
MouseOverAction=[!HideMeter Icon1][!SetOption Button2 Y "67"][!ShowMeter Text1]#U#
LeftMouseUpAction=[!HideMeter Text1]#U#
MouseLeaveAction=[!ShowMeter Icon1][!SetOption Button2 Y "31r"][!HideMeter Text1]#U#
ImageTint=#Color#
X=0
Y=12
Note the change to LeftMouseUpAction.

There is no way to make any "meter" click-through.
This works smoothly. Thanks :)
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: How to clickthrough font?

Post by kyriakos876 »

kyriakos876 wrote:This works smoothly. Thanks :)
Well except for when the mouse is over the button and the text will hide but the button will be in the "hover" mode, so I added [!Refresh] in the end of the MouseUpAction instead of [!Update]
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to clickthrough font?

Post by jsmorley »

kyriakos876 wrote:Well except for when the mouse is over the button and the text will hide but the button will be in the "hover" mode
If you want any click to slide back the button and hide the text, I would specifically do that in in the mouse click action.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: How to clickthrough font?

Post by kyriakos876 »

jsmorley wrote:If you want any click to slide back the button and hide the text, I would specifically do that in in the mouse click action.
I didn't intend on necessarily hiding both the text and the button after the click but this is how the Meter=Button works. If you click it will start by checking if the mouse if Over the button and display the correct bit-frame, in my case the frame of the click action, when clicked, will display the Inactive frame, unless the mouse in the area of the Inactive, then it will display the MouseOver frame. So I have to adapt the text hide/show depending on the frame displayed. This means that I can't "slide in" the button because I can't control it manually, because that would imply I can control what frame of the button image I want to display regardless of the cursor's position which, correct me if I'm wrong, is impossible on rainmeter.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to clickthrough font?

Post by jsmorley »

Yeah, given the nature of this, I would be tempted to not use a Button meter at all, but simply use the three .png images, and use !SetOption to set the image you want on mouse "over", "leave", "down" and "up".

The issue currently is that while if you click on the button image outside of the bounds of what is displayed when it is "off", then it works as expected. If you click on the button image inside the bounds of the "off" image, no "mouse leave" event is registered, and you still have the mouse "over" frame displayed.

I'm not sure Button is a good fit for this.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to clickthrough font?

Post by jsmorley »

Perhaps something like:

Code: Select all

[Button1]
Meter=Image
ImagePath=#@#Images\
ImageName=Leave.png
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "Hover.png"][!ShowMeter Text1][!UpdateMeter *][!Redraw]
LeftMouseDownAction=[!SetOption #CURRENTSECTION# ImageName "Down.png"][!ShowMeter Text1][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!SetOption #CURRENTSECTION# ImageName "Leave.png"][!HideMeter Text1][!UpdateMeter *][!Redraw][!Log "Clicked #CURRENTSECTION#"]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName "Leave.png"][!HideMeter Text1][!UpdateMeter *][!Redraw]
ImageTint=#Color#
X=0
Y=12
It's not "perfect", as if you click on the area that is contained in the bounds of Leave.png, you will have to mouse off and back on to get the hover effect again, but it's pretty close.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: How to clickthrough font?

Post by kyriakos876 »

jsmorley wrote:Perhaps something like:

Code: Select all

[Button1]
Meter=Image
ImagePath=#@#Images\
ImageName=Leave.png
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "Hover.png"][!ShowMeter Text1][!UpdateMeter *][!Redraw]
LeftMouseDownAction=[!SetOption #CURRENTSECTION# ImageName "Down.png"][!ShowMeter Text1][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!SetOption #CURRENTSECTION# ImageName "Leave.png"][!HideMeter Text1][!UpdateMeter *][!Redraw][!Log "Clicked #CURRENTSECTION#"]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName "Leave.png"][!HideMeter Text1][!UpdateMeter *][!Redraw]
ImageTint=#Color#
X=0
Y=12
It's not "perfect", as if you click on the area that is contained in the bounds of Leave.png, you will have to mouse off and back on to get the hover effect again, but it's pretty close.
That's actually almost how my code was earlier, but I encountered some issues with MouseDown and decided to go with Button. I'll work on this one later. You solved my problem by suggesting:

Code: Select all

LeftMouseUpAction=[!HideMeter Text1]#U#


But instead of #U# I now use #R# which I set as
[!Refresh]
In my Variables file and now I don't get blank Hover frame. I don't think it's ideal due to the refresh thing, but this is the best fitting solution at the moment ^_^
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to clickthrough font?

Post by jsmorley »

kyriakos876 wrote:That's actually almost how my code was earlier, but I encountered some issues with MouseDown and decided to go with Button. I'll work on this one later. You solved my problem by suggesting:

Code: Select all

LeftMouseUpAction=[!HideMeter Text1]#U#


But instead of #U# I now use #R# which I set as
[!Refresh]
In my Variables file and now I don't get blank Hover frame. I don't think it's ideal due to the refresh thing, but this is the best fitting solution at the moment ^_^
Yeah, !Refresh is kinda brute force, but that will work.