NGnius / PowerTools

Moved to
https://git.ngni.us/NG-SD-Plugins/PowerTools
GNU General Public License v3.0
414 stars 29 forks source link

Better Slider Logic #11

Closed pastaq closed 2 years ago

pastaq commented 2 years ago

I'm developing a similar tool for the Aya Neo in Linux, which I actually forked from your repo. I don't have a steam-deck so I haven't tested the native functionality in the designed environment so this may not apply, but I wanted to pass along what I did to get the slider to function with a more expected behavior. As written, I had to select the tiny notch location to move the slider which was kind of a pain. The slider indicator was not "dragable". I came up with a solution which is in my repo here:

https://github.com/pastaq/Aya-Neo-Power-Tools/blob/ce612cad78c512ca0dda17197d059af0b453c7bd/main_view.html#L74

Basically, you can get the local x position from a mouse event (up/down/move) which is relative to slider. You can then divide that x over the slider size to get a %, which you can send to the slider.style. If you know the # of elements for that slider you can also trigger notching logic, or have it snap to the nearest on mouseup events.

NGnius commented 2 years ago

Thanks for letting me know how to do it! I was really procrastinating doing this in hope that I could wait long enough for the whole React UI update to hit and not have to actually do it. Let's see if I can slip this into v0.6.0

Also, I checked out your fork a couple of days ago and thought it was pretty cool! I didn't even realize what RyzenAdj was -- had to look it up when I saw you were using it.

pastaq commented 2 years ago

RyzenAdj does have a couple of advantages. Firstly, its easy to add a polkit or sudoers as a single exposed utility. It's also specifically designed with APU's in mind since most of the exposed interfaces are different than desktop GPU's and the VanGogh chip in the steam deck. It is still limited though, so I'll probably need to target some of the native character files to replicate things like SMT, CPU frequency limits, etc.

Anyway, keep up the good work.

NGnius commented 2 years ago

Implemented in d023f42ac552ff1a4c918594673b5d3ff2359eb6 and the commit after that (I got carried away with implement per-game profiles and forgot to commit polishing tweaks).