It is currently October 4th, 2024, 12:44 am

ColorSelector

Skins that control functions in Windows or Rainmeter
User avatar
Kurou
Posts: 42
Joined: January 24th, 2022, 2:54 pm
Location: World Wide Web

Re: ColorSelector

Post by Kurou »

I've found something you might want to see.

If you slider the slider a litte bit above background of the slider it will go beyond its maximum value and start producing errors, i think at least.
Animation3.gif
You do not have the required permissions to view the files attached to this post.
Brought to you by: https://kurou.dev/
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: ColorSelector

Post by Nookz »

Thks for the heads up!
I def broke something now.. will need to investigate.

Edit:Uploaded hotfix :D
Should also have fixed other issues related to the bars.
RicardoTM
Posts: 315
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: ColorSelector

Post by RicardoTM »

Nookz wrote: December 11th, 2023, 5:55 am And it was not doing that before, right?
I'm a bit confused since the overlay by default should let you pick anywhere on the screen.. and also I haven't touched that part at all. :?
In the meantime, I guess a temporary solution would be to set either or both of those things manually inside the overlay.ini:
[!Move #VSCREENAREAX# #VSCREENAREAY#] to [!Move "0" "0"]
W=#VSCREENAREAWIDTH# to W=the combined width of all your monitors

That one might be hard for me to troubleshoot since I'm not getting that behaviour on my end and I see nothing that can cause it either..

Maybe, if it's not too much to ask, you could run this simple skin and tell me if the log that it gives makes sense?:

Code: Select all

[Rainmeter]
Update=-1
OnRefreshAction=[!Log "Virtual Screen Area Height: #VSCREENAREAWIDTH#"][!DeactivateConfig #CURRENTCONFIG#]

[Meter]
Meter=String
It should give you a value equals to both of your monitor width combined.

Either way.. I think I'll look at it more after I get some rest. ^^'
I'll post here if I find a solution, or at least what might be causing it.
Sorry, I was scratching my head to my own skin lol.

I didn't test on my second screen the first time tbh.

It gives this: Virtual Screen Area Height: 3840 (test\Test.ini)
By the way, that's actually width not height.
So, if I correct the code:
Height: Virtual Screen Area Height: 1080 (test\Test.ini)
Width: Virtual Screen Area Width: 3840 (test\Test.ini)

If this helps:
My screen resolutions are:
Screen 1: 2560 x 1080
Screen 2: 3840 x 2160
The second one is 4k, but I have it scaled 300% since it's 13" so it's really 1920 x 1080. The screen 1 is physically bigger than the screen 2.

So.. Rainmeter thinks my total Width it's 3840 but it is actually 6400. Changing W=6400 makes it work.

Without changing anything on your code, but changing my second screen from 300% to 100% also fixes it. So there's no problem with your code, the problem is my windows configuration. Can't do anything about it tho, having it at 100% makes everything too small.
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: ColorSelector

Post by Nookz »

That's good to know.
I'll add this information on the main post when I get a chance in case anyone runs into a similar problem. :thumbup:
RicardoTM
Posts: 315
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: ColorSelector

Post by RicardoTM »

Yep. Maybe someone else has an idea on how to reliably interpret the correct total width of the screen. But for now, setting the correct size does the job.
User avatar
Yincognito
Rainmeter Sage
Posts: 8324
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ColorSelector

Post by Yincognito »

RicardoTM wrote: December 12th, 2023, 6:19 am Yep. Maybe someone else has an idea on how to reliably interpret the correct total width of the screen. But for now, setting the correct size does the job.
Generally in these cases, using the registry or PowerShell can help - I have some posts on the forum regarding identifying Windows scaling and similar (too lazy to use the Search button right now). Unfortunately, since I don't have a multi monitor setup I can't speak when it comes to how that mixes with monitor horizontal / vertical arrangements. Either some googling or the advice of someone using it and persistent enough to look for an efficient and comprehensive solution that works for all cases (can be any of you as well) would be needed.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 315
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: ColorSelector

Post by RicardoTM »

Yincognito wrote: December 12th, 2023, 7:12 pm Generally in these cases, using the registry or PowerShell can help - I have some posts on the forum regarding identifying Windows scaling and similar (too lazy to use the Search button right now). Unfortunately, since I don't have a multi monitor setup I can't speak when it comes to how that mixes with monitor horizontal / vertical arrangements. Either some googling or the advice of someone using it and persistent enough to look for an efficient and comprehensive solution that works for all cases (can be any of you as well) would be needed.
Maybe just making a formula that adds the total height and width of a maximum of 3 monitors would be fine enough.

#SCREENAREAX@N#, #SCREENAREAY@N#, #SCREENAREAWIDTH@N#, #SCREENAREAHEIGHT@N#

Maybe using any of those like
W=(#SCREENAREAWIDTH#+#SCREENAREAWIDTH@2#+#SCREENAREAWIDTH@3#)

Maybe that gets the total real width. Have to test tho.

Edit.

Running a quick test... If I use (#SCREENAREAWIDTH#+#SCREENAREAWIDTH@2#) it gives me 2560 + 1920 which is incorrect.
If I use (#SCREENAREAWIDTH#+#SCREENAREAWIDTH@2#+#SCREENAREAWIDTH@3#) it gives me 2560 + 1920 + 2560 which is correct but incorrect lol. If I add another monitor (to the ecuation), even if I don't have another, it will just give the weight of the main monitor which alters the result. So, nope.
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: ColorSelector

Post by Nookz »

Yincognito wrote: December 12th, 2023, 7:12 pm Generally in these cases, using the registry or PowerShell can help - I have some posts on the forum regarding identifying Windows scaling and similar (too lazy to use the Search button right now). Unfortunately, since I don't have a multi monitor setup I can't speak when it comes to how that mixes with monitor horizontal / vertical arrangements. Either some googling or the advice of someone using it and persistent enough to look for an efficient and comprehensive solution that works for all cases (can be any of you as well) would be needed.
I'm extremely unfamiliar with powershell, but i'll take a deeper look this weekend.
from a quick google search just for fun I found this and this that might be useful.

Now I'm already thinking of how I could run such a command without it being intrusive for the user.. Maybe I just add a separate skin that people can run once IF they encounter this problem.. oh well. that's an issue for weekend-me. :D

Thks for the suggestions tho. I can probably manage to make it work from here.

Edit: couldn't stay away from it after all.. :rolmfao:
I think I found a way to make it work.. will test later
Or if RicardoTM or someone else with scaled monitor can test it before I do, even better ^^

Code: Select all

[Rainmeter]
Update=-1

[Variables]
TotalWidth=0

[PowerShell]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell.exe
Parameter=-Command "Add-Type -AssemblyName System.Windows.Forms; $sum = ([System.Windows.Forms.Screen]::AllScreens | ForEach-Object { $_.Bounds.Width }) | Measure-Object -Sum | Select-Object -ExpandProperty Sum; $sum"
OutputType=ANSI
DynamicVariables=1
FinishAction=[!SetVariable TotalWidth [PowerShell]][!UpdateMeter Result][!ReDraw]

[Result]
Meter=String
Text="#TotalWidth#"
Fontsize=20
leftMouseUpAction=[!CommandMeasure PowerShell "Run"]
FontColor=255,255,255
DynamicVariables=1
SolidColor=0,0,0
User avatar
Yincognito
Rainmeter Sage
Posts: 8324
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: ColorSelector

Post by Yincognito »

I believe you're both on the right track, nice to see some progress in that area. The thing is, the W and H of a monitor will stay the SAME when scaled AFAIK, so just iterating through all monitors and get the sum by addition isn't going to be enough, as you should probably add the monitor dimension divided by its own scaling to get the correct sum.

To further complicate things, Windows doesn't really expose the actual scaling in the registry, but the current scaling's POSITION in the list of available scalings the system allows from Windows Settings (so it will be different for every user, depending on what the monitors support). I brushed off my earlier laziness and found my post talking about these things:
https://forum.rainmeter.net/viewtopic.php?t=18849&start=160#p214875

There might be other more "internal" ways to get a monitor's scaling in PowerShell (if it's specific to the monitor and not global, that is), but that still leaves the issue of monitor arrangement: how to find if it's horizontal, vertical or otherwise. Rainmeter does provide the X, Y, W, H of each monitor (assuming you get the monitor count to iterate through them more easily) so one can probably deduce the arrangement (and the non scaled sum) based on the X and Y values (and the W and H values, respectively), but one should still divide such dimensions by the corresponding monitor's scaling, via getting the latter from the registry (PowerShell or Registry measure methods) or otherwise. Unless Windows does already provide the total width and height of the entire screen area taking scaling into account somewhere, of course...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 315
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: ColorSelector

Post by RicardoTM »

Nookz wrote: December 13th, 2023, 3:22 am Edit: couldn't stay away from it after all.. :rolmfao:
I think I found a way to make it work.. will test later
Or if RicardoTM or someone else with scaled monitor can test it before I do, even better ^^

Code: Select all

[Rainmeter]
Update=-1

[Variables]
TotalWidth=0

[PowerShell]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell.exe
Parameter=-Command "Add-Type -AssemblyName System.Windows.Forms; $sum = ([System.Windows.Forms.Screen]::AllScreens | ForEach-Object { $_.Bounds.Width }) | Measure-Object -Sum | Select-Object -ExpandProperty Sum; $sum"
OutputType=ANSI
DynamicVariables=1
FinishAction=[!SetVariable TotalWidth [PowerShell]][!UpdateMeter Result][!ReDraw]

[Result]
Meter=String
Text="#TotalWidth#"
Fontsize=20
leftMouseUpAction=[!CommandMeasure PowerShell "Run"]
FontColor=255,255,255
DynamicVariables=1
SolidColor=0,0,0
Not there yet, it gives me 3840.

I mean, technically it is correct, but it isn't. lol