It is currently March 29th, 2024, 3:06 pm

Weather Desk

Weather skins
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: MINIWeatherPRO

Post by xenium »

jsmorley wrote: October 15th, 2019, 2:59 pm I like it. I would make one suggestion.

I would be tempted to use a Container for the marquee effect on the conditions text, so it doesn't appear to slide all the way in and out of the entire skin, but appears and disappears say about 10 pixels from each edge. I personally would find that effect more pleasing.
It's an interesting idea, but ...i don't know how to use Container :confused:
Would it work for the semi-transparent version as well ?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MINIWeatherPRO

Post by jsmorley »

xenium wrote: October 15th, 2019, 3:42 pm It's an interesting idea, but ...i don't know how to use Container :confused:
Would it work for the semi-transparent version as well ?
Don't see why not.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MINIWeatherPRO

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeasureLoop]
Measure=Loop
StartValue=261
EndValue=(-[MeterMarqueeString:W])
Increment=-5
DynamicVariables=1

[MeterBack]
Meter=Shape
Shape=Rectangle 1,1,300,30 | StrokeWidth 1 | Stroke Color 255,255,255,255 | Fill Color 47,47,47,100

[MeterContainer]
Meter=Shape
X=20
Y=0r
Shape=Rectangle 1,1,260,30 | StrokeWidth 1

[MeterMarqueeString]
Meter=String
X=[MeasureLoop]
Y=5
FontSize=13
FontWeight=400
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Container=MeterContainer
Text=Now is the time for all good men to come to the aid of their country

GIF.gif


https://docs.rainmeter.net/manual/meters/general-options/container/
You do not have the required permissions to view the files attached to this post.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: MINIWeatherPRO

Post by xenium »

jsmorley wrote: October 15th, 2019, 4:39 pm

Code: Select all

[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeasureLoop]
Measure=Loop
StartValue=261
EndValue=(-[MeterMarqueeString:W])
Increment=-5
DynamicVariables=1

[MeterBack]
Meter=Shape
Shape=Rectangle 1,1,300,30 | StrokeWidth 1 | Stroke Color 255,255,255,255 | Fill Color 47,47,47,100

[MeterContainer]
Meter=Shape
X=20
Y=0r
Shape=Rectangle 1,1,260,30 | StrokeWidth 1

[MeterMarqueeString]
Meter=String
X=[MeasureLoop]
Y=5
FontSize=13
FontWeight=400
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Container=MeterContainer
Text=Now is the time for all good men to come to the aid of their country


GIF.gif



https://docs.rainmeter.net/manual/meters/general-options/container/
It's done !
Thank you very much for your help :bow:
GIF.gif
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MINIWeatherPRO

Post by jsmorley »

Great! Looks good...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: MINIWeatherPRO

Post by SilverAzide »

jsmorley wrote: October 15th, 2019, 7:14 pm Great! Looks good...
I don't mean to hijack this thread, but this is a great example of a feature request I made quite a long time ago here: https://forum.rainmeter.net/viewtopic.php?f=14&t=26338. In short, it is annoying (to me) to have the string "Cloudy" scrolling when it isn't needed (as in the above GIF) since there is plenty of room to display the full text. If we had a convenient way to measure text length (via Win32 GetTextExtentPoint32, IDWriteTextLayout::GetMetrics, et al.), then if the weather was "Cloudy" we would know there is plenty of room to display the text without scrolling, but if it was "Thunder in the Vicinity", then we could activate the measures needed to scroll.

Please accept my apologies, xenium! Keep up the good work!
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: MINIWeatherPRO

Post by jsmorley »

SilverAzide wrote: October 15th, 2019, 10:36 pm I don't mean to hijack this thread, but this is a great example of a feature request I made quite a long time ago here: https://forum.rainmeter.net/viewtopic.php?f=14&t=26338. In short, it is annoying (to me) to have the string "Cloudy" scrolling when it isn't needed (as in the above GIF) since there is plenty of room to display the full text. If we had a convenient way to measure text length (via Win32 GetTextExtentPoint32, IDWriteTextLayout::GetMetrics, et al.), then if the weather was "Cloudy" we would know there is plenty of room to display the text without scrolling, but if it was "Thunder in the Vicinity", then we could activate the measures needed to scroll.

Please accept my apologies, xenium! Keep up the good work!
What's wrong with [MeterName:W] ? Now granted, this is the size of the "meter", not the "text", but unless you are using Padding, that should be the same thing, and you can always "know" what amount of Padding you are using and factor that in.

Code: Select all

[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeasureLoop]
Measure=Loop
StartValue=261
EndValue=(-[MeterMarqueeString:W])
Increment=-5
DynamicVariables=1

[MeasureStringLen]
Measure=Calc
Formula=[MeterMarqueeString:W]
DynamicVariables=1
IfCondition=MeasureStringLen > 260
IfTrueAction=[!SetOption MeterMarqueeString X "[*MeasureLoop*]"]
IfFalseAction=[!SetOption MeterMarqueeString X "0"]

[MeterBack]
Meter=Shape
Shape=Rectangle 1,1,300,30 | StrokeWidth 1 | Stroke Color 255,255,255,255 | Fill Color 47,47,47,100

[MeterContainer]
Meter=Shape
X=20
Y=0r
Shape=Rectangle 1,1,260,30 | StrokeWidth 1

[MeterMarqueeString]
Meter=String
Y=5
FontSize=13
FontWeight=400
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Container=MeterContainer
;Text=Now is the time for all good men to come to the aid of their country
Text=Cloudy
There are lots of approaches for how you can do "marquee" text, which I'm not going to dig into, as to be honest I hate it.

Still, I see no reason why more than the [SectionVariable:W] is really needed...
User avatar
Brian
Developer
Posts: 2674
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: MINIWeatherPRO

Post by Brian »

SilverAzide wrote: October 15th, 2019, 10:36 pm I don't mean to hijack this thread, but this is a great example of a feature request I made quite a long time ago here: https://forum.rainmeter.net/viewtopic.php?f=14&t=26338. In short, it is annoying (to me) to have the string "Cloudy" scrolling when it isn't needed (as in the above GIF) since there is plenty of room to display the full text. If we had a convenient way to measure text length (via Win32 GetTextExtentPoint32, IDWriteTextLayout::GetMetrics, et al.), then if the weather was "Cloudy" we would know there is plenty of room to display the text without scrolling, but if it was "Thunder in the Vicinity", then we could activate the measures needed to scroll.

Please accept my apologies, xenium! Keep up the good work!
*I just wanted to directly respond to this message (sorry to keep hi-jacking)*

I have actually wanted to do this as well for several years now, but haven't found the time yet. In fact it was one of the reasons I added the String Measure, and I hoped to find a way to add some basic functions to that measure (like the ability to select a substring, string length in characters, pixel length of string from its displayed text metrics, and others). Some of that can be done with Lua or Regex, so I think we moved onto other more high profile features.

It might be good to revisit this.

One of the major issues I will have to think about is dealing with how directwrite creates the underlying text layout so it can get the text metrics. It is an expensive operation, so creating a layout, getting its metrics, then destroying it, is fairly large waste of resources. If we bind it to the String meter somehow, it might be easier on resources and allow the use of the inline string metrics to be calculated correctly. Maybe we could do section variable(s) such as: [StringMeter:TextMetricsWidth], [StringMeter:TextMetricsHeight]. Or maybe some hybrid function call like this: [StringMeter:TextMetrics(Width)] or something similar.

We would also have to think about multi-line text, whitespace, whether to measure clipped text or not (or both), etc.

I think I just turned this into a large project.


Anyway, I just wanted to let you know we thought about this, but have struggled to "place" it somewhere and deal with all the complexities and performance issued involved. Nothing is in the works yet, and we would need to carefully think through all the details beforehand. Thanks for the reminder!

-Brian
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: MINIWeatherPRO

Post by SilverAzide »

Thank you jsmorley and thanks Brian! Your comments are very helpful and left me with a little more hope for a future enhancement.
jsmorley wrote: October 15th, 2019, 10:45 pm What's wrong with [MeterName:W] ? Now granted, this is the size of the "meter", not the "text", but unless you are using Padding, that should be the same thing, and you can always "know" what amount of Padding you are using and factor that in.
[...snip...]
There are lots of approaches for how you can do "marquee" text, which I'm not going to dig into, as to be honest I hate it.

Still, I see no reason why more than the [SectionVariable:W] is really needed...
Jsmorley,
OK, so I guess this particular marquee thing is a bad/wrong example (I dislike marquee text too). My original feature request actually has a proper example (https://forum.rainmeter.net/viewtopic.php?f=14&t=26338). What I was looking for is a way to get the length of an unclipped string, so could compare it against the width of the bounding rectangle, and then I could know whether to show a tooltip or not. (And without any workarounds of hidden meters, etc.)

Anyway, I'll stop hijacking this thread. Thanks guys (and xenium too). Now back to our regularly scheduled programming...
Gadgets Wiki GitHub More Gadgets...
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: MINIWeatherPRO

Post by xenium »

Update:

16.10.2019 - Added 36-hour forecast.(see preview image)