It is currently December 10th, 2018, 8:52 pm

Sometimes correct is not what you want

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

Sometimes correct is not what you want

kyriakos876 » October 18th, 2018, 5:58 pm

Hello,
I have this meter:

Code: Select all

[Meter]
Meter=Image
Solidcolor=255,0,0,2
W=100
H=100
MouseOverAction=[!Something]
Now this is almost transparent but it's still there waiting for the MouseOverAction to be triggered.
If I right click the skin and go to Settings>Transparency>90% the meter becomes completely opaque so the MouseOverAction cannot be triggered.
I suppose this is normal? Because the opacity of the meter is normally 2 and then I set it to 90% which is 0.2 which is less than 1 so it gets rounded down to 0?
I didn't post it on the bug section because it's not a bug in my opinion... just not what I would think would happen.
Anywayyyyyyy
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Sometimes correct is not what you want

eclectic-tech » October 18th, 2018, 7:22 pm

If you look closely at the skin context menu "Transparency" setting you will see that 100% is ~100%.
By selecting that value, the skin will be almost invisible but still respond to Mouse events.

This prevents new users from accidentally making the skin completely disappear for them.
Experienced users know that holding the 'Ctrl' key down will override skin settings.

In your example, a percentage of the initial meter transparency is what I would expect.
Not sure what you want, but with more information I am sure there is a solution. :???:
User avatar
balala
Rainmeter Sage
Posts: 7152
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Sometimes correct is not what you want

balala » October 18th, 2018, 8:26 pm

kyriakos876 wrote:
October 18th, 2018, 5:58 pm
Now this is almost transparent but it's still there waiting for the MouseOverAction to be triggered.
In addition to what eclectic-tech said, I'd add that the meter is indeed there, but it's not visible. No way to be visible.
kyriakos876 wrote:
October 18th, 2018, 5:58 pm
If I right click the skin and go to Settings>Transparency>90% the meter becomes completely opaque so the MouseOverAction cannot be triggered.
Miswritten probably. If you click to 90% transparency, the skin (not the meter) becomes not completely opaque, but almost transparent. Finally its transparency is set to 90%.
User avatar
kyriakos876
Posts: 849
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Sometimes correct is not what you want

kyriakos876 » October 18th, 2018, 8:54 pm

eclectic-tech wrote:
October 18th, 2018, 7:22 pm
If you look closely at the skin context menu "Transparency" setting you will see that 100% is ~100%.
By selecting that value, the skin will be almost invisible but still respond to Mouse events.

This prevents new users from accidentally making the skin completely disappear for them.
Experienced users know that holding the 'Ctrl' key down will override skin settings.

In your example, a percentage of the initial meter transparency is what I would expect.
Not sure what you want, but with more information I am sure there is a solution. :???:
What I'm trying to describe happens with ~100% as well.
Please do the following:
Create a skin and put this only in the code without BackgroundMode or anything...

Code: Select all

[Meter]
Meter=Image
Solidcolor=255,0,0,2
W=100
H=100
Right click on the skin. You can see that the normal menu shows up. Go ahead and select > Settings > Transparency > and select ~100% or 90% (both should do it)
Now right click on the location where the skin is.
You can't right click can you? It's like right clicking on the desktop.

The same goes for balala's answer. (but yea I meant the skin, not the meter)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Sometimes correct is not what you want

eclectic-tech » October 19th, 2018, 4:35 am

Yeah you are right, I tested with a skin having several meters and it appeared to be working.

In testing, it appears that with the alpha value 128 or greater, the skin is detected by the mouse when the context setting ~100 is selected.
But with alpha values 1~127 the skin is invisible to mouse clicks when the context setting ~100 is selected.

Hmm... this is something for the Devs to investigate. :ThinkingBig

Edit: Explained that ~100 was also selected with lower alpha values.
User avatar
kyriakos876
Posts: 849
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Sometimes correct is not what you want

kyriakos876 » October 19th, 2018, 5:13 am

eclectic-tech wrote:
October 19th, 2018, 4:35 am
Yeah you are right, I tested with a skin having several meters and it appeared to be working.

In testing, it appears that with the alpha value 128 or greater, the skin is detected by the mouse when the context setting ~100 is selected.
But with alpha values 1~127 the skin is invisible to mouse clicks when the context setting ~100 is selected.

Hmm... this is something for the Devs to investigate. :ThinkingBig

Edit: Explained that ~100 was also selected with lower alpha values.
Okay, I get it for 90% to behave like that for values 1-9 because 90% of anything less than 10 is goin to be below 1.
For example you have a meter with 9 opacity and then set the skin to 90% so it becomes 0.9 opaque which is note a valid value so it gets rounded down to zero.
But if you say that for ~100 you need values above 127, I can't explain that because I don't know what ~100% means.... How close is it to 100 etc....
User avatar
jsmorley
Developer
Posts: 18445
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Sometimes correct is not what you want

jsmorley » October 19th, 2018, 12:01 pm

kyriakos876 wrote:
October 19th, 2018, 5:13 am
Okay, I get it for 90% to behave like that for values 1-9 because 90% of anything less than 10 is goin to be below 1.
For example you have a meter with 9 opacity and then set the skin to 90% so it becomes 0.9 opaque which is note a valid value so it gets rounded down to zero.
But if you say that for ~100 you need values above 127, I can't explain that because I don't know what ~100% means.... How close is it to 100 etc....
When you select ~100% transparency in Manage, that will be set to an opacity of 1 in Rainmeter.ini, which is not a percentage, but a value from 0-255. Percentage isn't really an actual factor here. It is just a human-friendly way of allowing a user to set the transparency of the skin to something desirable. The actual percentage of ~100 would be 100-(1/255) or 99.9960784314%, but that doesn't matter. It's set to 1.
User avatar
kyriakos876
Posts: 849
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Sometimes correct is not what you want

kyriakos876 » October 19th, 2018, 1:10 pm

jsmorley wrote:
October 19th, 2018, 12:01 pm
When you select ~100% transparency in Manage, that will be set to an opacity of 1 in Rainmeter.ini, which is not a percentage, but a value from 0-255. Percentage isn't really an actual factor here. It is just a human-friendly way of allowing a user to set the transparency of the skin to something desirable. The actual percentage of ~100 would be 100-(1/255) or 99.9960784314%, but that doesn't matter. It's set to 1.
So no matter how low I have a meter in the skin, it will set a low limit of 1 and it won't go to 0? If so, why DOES it go to 0?
I'm not sure if you agree that this happens or not... did you try the example I gave to electric-tech above?
User avatar
jsmorley
Developer
Posts: 18445
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Sometimes correct is not what you want

jsmorley » October 19th, 2018, 1:19 pm

We purposely set the Transparency value in Manage to a lower limit of 1, so a casual user won't set that to 0 and then be confused that they can no longer click on the skin. A setting of 1 in the range of 0-255 is effectively "invisible", while still reacting to the mouse. That is the point of ~100%, which in effect means "approximately invisible".

While an author can make any meters, or the skin background, have an opacity of zero, and that's fine, we don't want to make it too easy for the end-user to do so, as that can only cause confusion.

It is true however, that the transparency of the SKIN WINDOW in Rainmeter is cumulative with the opacity of the meters in the skin. Logically, if you have a mostly transparent meter in the skin, and you make the skin window it is drawn on even more transparent, the effect is to make that meter even more transparent yet. If the only meter(s) you have in the skin end up with an opacity of less than 1, you can't click on them. Rainmeter always rounds opacity values of less than 1 to zero.
User avatar
jsmorley
Developer
Posts: 18445
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Sometimes correct is not what you want

jsmorley » October 19th, 2018, 1:30 pm

Look at it this way:

If you have a meter or skin background with an opacity of 127, and you set the opacity of the skin window to 1%, then the opacity of the meter becomes 1/127 or 0.00787401574, which when applied becomes 127 * 0.00787401574, or 0.99999999898. That is just less than 1, and so becomes 0 in Rainmeter. With an opacity of 128, it becomes 128 * 0.0078125, which is 1.