raiguard / ModernGadgets

Sleek, minimalist, information-dense gadgets for the modern desktop. Inspired by the AddGadgets.com system monitoring gadgets. Built on the Rainmeter platform.
MIT License
301 stars 32 forks source link

Skin Scaling #33

Closed raiguard closed 6 years ago

raiguard commented 7 years ago

Utilize TransformationMatrix to make the gadgets and config skins scalable. This ability would mostly be useful for those with 4K monitors, where the default gadget size is too small. Will be freely changeable using an input box, and right-clicking on the global settings skin (where the input box will be) will offer a context option to revert to default sizing in case a user accidentally makes it too large.

To-do

Current issues

raiguard commented 6 years ago

So this will be possible if I stop using the “border” image and make every border four separate images. I will also need to add invisible button meters to EVERY button. sigh

SerVB commented 6 years ago

Actually, I don't like the idea of hardcoded constants. I think they prevent from implementing scaling easily.

raiguard commented 6 years ago

What hardcoded constants?

SerVB commented 6 years ago

For example that font size: https://github.com/raiguard/ModernGadgets/commit/e4309abbbfce000862431f836691cc5a9427df9c . I'm not certain, but maybe it would be better to make a global constant #CommonIconFontSize# with a value of 10 (FontSize=#CommonIconFontSize#) instead of FontSize=10.

So implementing scaling will look like FontSize=#CommonIconFontSize# * #ScaleFactor#. It would be harder to have scaling bugs because using the same global constants changes sizes of everything similarly.

As I understand, hardcoding is a coding style of the project. Currently, many numbers are equal by value and by sense, but those values are hardcoded. So changing something in one place will cause many identical changes in others.

Maybe I don't know something about Rainmeter (I'm a really newbie) and everything I've written has no use at all :( What do you think?

SerVB commented 6 years ago

Some more examples: image image

raiguard commented 6 years ago

The way scaling will work is using the “TransformationMatrix” option on all meters. Because of the way it works, you only need to define things for the 1.0 scale factor, and TransformationMatrix handles the rest.

Also, the specific ones you pointed out are on measures, and have absolutely no effect on the visuals.

raiguard commented 6 years ago

I actually have a local branch on my PC in which I implemented TransformationMatrix. However, none of the buttons work at any size except 1.0, and there are still visual hiccups to sort out. I’ll publish the branch when I get home so you can check it out.

raiguard commented 6 years ago

So thanks to jsmorley, I now know a way to implement this while retaining the relative positioning equations that I'm currently using! So this feature will possibly come in v1.5.0!

raiguard commented 6 years ago

:D

2018-10-16 22_54_00-

Making progress!

raiguard commented 6 years ago

transform Buttons are clickable! Also figured out from this that there is an issue with the session totals in standard network meter, so that will need to be fixed with another patch. I also forgot to record the mouse cursor in this one, so sorry for the ghost clicking!

Also, please note that the white backgrounds are completely temporary, and only exist so I can easily debug them.

raiguard commented 6 years ago

transform 1x vs. 5x scale. The GIF program completely ruins the colors at 1x scale, so don't worry about the fact that they all look orange - in real life, that isn't the case.

raiguard commented 6 years ago

All of the system monitoring gadgets now have scaling support! I still need to to chronometer, the new v1.5 gadgets, ALL of the configuration skins, and the setup skin. :( 2018-10-20 14_12_31-

raiguard commented 6 years ago

img_20181020_153445 Bigger == better, right?

raiguard commented 6 years ago

So I discovered that it is flat-out impossible to scale input boxes. Thus, all of the settings skins are forced to stay at x1 scale, with the scale setting only affecting the actual Gadgets themselves. However, on the bright side, that means that scaling support is almost completely finished now! It'll be included in the first v1.5 beta.

raiguard commented 6 years ago

Hey, guess what!? GUESS WHAT!?

IT'S DONE!!!!!

SerVB commented 6 years ago

1.5.0-beta1 welcomes me not properly :)

image

As you see, the button is out of bounds.

raiguard commented 6 years ago

This is the kind of thing that should be put into the 'scaling beta test' issue. But in this case, this is a known bug that I am trying to solve, but currently don't know how to. I am working on it though!

Edit: you also made me realize that the welcome prompt will appear for everyone when upgrading from v1.4 to v1.5, even though it's only supposed to appear for new users. That'll be fixed in the next beta as well.

SerVB commented 6 years ago

@raiguard, now there is the same update prompt glitch:

image

It appears on 1.5.0-beta1. I use 1.00 scale factor.

By the way, should I write about it here or there?

raiguard commented 6 years ago

I fixed that issue in beta 2. And yes, this is what that other issue is meant for.