Kotofanchik wrote: ↑March 18th, 2024, 11:45 pm
I want each new icon image to appear to the right of the previous one. But again the problem is that there is still space behind the missing and hidden icon.
There are a lot of icons and I can’t know which one will be on the site. I would like the first one found to be on the left side, the next one after it, and so on.
About the same as here
Pic.JPG
Generally speaking, if I correctly understood what you want and assuming a standard code in your skin, this is a matter of positioning. Absolute / hardcoded positioning (e.g. X=10 for the 1st icon, X=40 for the 2nd and so on, assuming an icon size of 20 pixels with 10 pixels gap between them) will indeed leave an empty space when you hide an icon. What you want is relative positioning, see:
https://docs.rainmeter.net/manual/meters/general-options/#XY
However, that alone is not enough in such a case, because of the Note from the Hidden option on the above page (which basically means that hidden meters like your icons don't occupy space, but the gaps between them, being independent of the actual meters' "contents", still do and they accumulate even if the meters themselves are hidden, something quite obvious for meters that are not on the sides of the "list").
Therefore, one easy solution is to not use any gap in the relative positioning and instead replicate the gap using the Padding option, also described on the above page (in effect, making the gaps part of the meters themselves, so that they are hidden along with the actual icons).
In code, taking the example above, this would translate to something like:
Code: Select all
[Icon1]
Meter=Image
X=10
Y=10
W=20
Padding=0,0,10,0
...
[Icon2]
Meter=Image
X=0R
Y=0r
W=20
Padding=0,0,10,0
...
...
Notice the X, Y and Padding of the 2nd icon above, which would be replicated for the 3rd, the 4th, and so on. Obviously,
the non zero values above can be adjusted to your preference.
Also, take into account that the above will NOT work for missing icons, since the defined W or Padding are independent of whether the image file exists or not - unless, of course, the missing icons are automatically hidden using the IfMatch approach suited for your case and described by balala above.