It is currently April 28th, 2024, 3:28 pm

[Suggestion] CSS-like Addition to Meter

Report bugs with the Rainmeter application and suggest features.
User avatar
thatsIch
Posts: 446
Joined: August 7th, 2012, 9:18 pm

[Suggestion] CSS-like Addition to Meter

Post by thatsIch »

Hey Devs,

I used the search, but haven't found any related topic to CSS in Rainmeter.
I think HTML + CSS is a lot like Rainmeter, though RM is kinda missing some basic CSS-functions.

Border: though Bar for example has a border option, you cannot choose which sides should be bordered. I know it would be possible with nativ RM by adding just multiple Meters and let them stick to each other, but I think its pretty basic, where you dont need to add 3 lines to a string meter to remove a border on one side.

Padding: though you can choose where a string is aligned to within its area, you cannot pad it to either side. Like I have to always add

prefix = " "
to push the string a bit to the right

These are just some suggestion. What do you think about it? If you like it, I could research a list of CSS elements which could fit to RM in my opinion.


greetz Ich
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] CSS-like Addition to Meter

Post by jsmorley »

Thanks for the suggestion.

Neither of those is really needed with Rainmeter. Meters can be fully positioned exactly as you want them with X and Y, and can be made relative to each other with the "r" and "R" posfix options on those values.

So padding between two meters next to each other is as simple as:

[MeterOne]
Meter=String
X=0
Text=I'm a lumberjack

[MeterTwo]
Meter=String
X=10R
Text=and I'm ok

Now you have 10 px "padding" between MeterOne and MeterTwo.

Rainmeter by its nature does not support "layouts". It's really nothing at all like HTML + CSS.
User avatar
thatsIch
Posts: 446
Joined: August 7th, 2012, 9:18 pm

Re: [Suggestion] CSS-like Addition to Meter

Post by thatsIch »

I meant inline Padding

for example you have a String-Meter

Code: Select all

[StringMeter]
Meter = String
X = 0
Y = 0
W = 100
H = 100
Text = Test
now if you want to pad the text you need to add

Code: Select all

Prefix  = " "
to it. Else you just have to add 2 Meters 1 for background and 1 for String itself

And what about the border?

And what do you mean with "layouts"? Do you mean the structure of the DOM-Tree? Yes this might be true. You cannot do nested stuff, but you have the ability to style every certain node to your liking with CSS. Imho this is one of the greatest benefits of RM to be able to seperate the logics of each layer.
But most people must resolve to "hacks" to get the desired result of "in their eyes" simple things.
Alex Becherer

Re: [Suggestion] CSS-like Addition to Meter

Post by Alex Becherer »

what's wrong with:

Code: Select all

[StringMeter]
Meter = String
X = 2
Y = 0
W = 100
H = 100
Text = Test
or

Code: Select all

[StringMeter]
Meter = String
MeasureName = TestMeasure
X = 0
Y = 0
W = 100
H = 100
Text = " %1"
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] CSS-like Addition to Meter

Post by jsmorley »

The nature of Rainmeter, and the GDI+ API used to draw meters, just does not support any kind of "inline" formatting. It is VERY dangerous to one's frustration level to think of Rainmeter in terms of HTML / CSS. It is nothing at all like it.