It is currently March 28th, 2024, 7:37 pm

Help with the background color : Lua Calendar

Get help with creating, editing & fixing problems with skins
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Help with the background color : Lua Calendar

Post by SilverAzide »

eclectic-tech wrote: August 17th, 2021, 6:14 pm Thanks! Glad you like the scale version!

Note: I updated the previous post with a completely separate "LuaCalendar-Scaleable" rmskin package. It corrected a few glitches my "first draft" created: scroll not working and occasional log error msgs.

I would strongly recommend using the "LuaCalendar-Scaleable" separate package available above, and re-installing Smurfier's original version as "LuaCalendar".

This way, my minor changes are separate from Smurfier's extensive work creating the calendar. :rosegift:

Enjoy! 8-)
A long while back, I (and another user, TGonzo) created a scalable version of LuaCalendar 5.0, but it used TransformationMatrix which broke all the tooltips and clickable areas of the skin, of which there are... a LOT. "Cell spacing" kind of got screwy too, especially when using oddball scale factors like 0.85, or 1.33, so you'd end up with visual weirdness like dates in the lower right quadrant being positioned off by a pixel or two just because of built-up rounding errors. I have not tried your mod with these type scale factors. The biggest benefit to TransformationMatrix is fonts scale very smoothly to any size, whereas without TransformationMatrix they scale in little "jumps", since some fonts don't work at weird point sizes like 12.33 or whatever.

I've been wanting to upgrade to 6.0 for a long time, but since my changes were so extensive (and which included modding the Lua script), I was stuck and unable to move forward without a ton of work. Your mod will finally get me over the hump, I hope! :rosegift:
Gadgets Wiki GitHub More Gadgets...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with the background color : Lua Calendar

Post by eclectic-tech »

SilverAzide wrote: August 17th, 2021, 7:14 pm A long while back, I (and another user, TGonzo) created a scalable version of LuaCalendar 5.0, but it used TransformationMatrix which broke all the tooltips and clickable areas of the skin, of which there are... a LOT. "Cell spacing" kind of got screwy too, especially when using oddball scale factors like 0.85, or 1.33, so you'd end up with visual weirdness like dates in the lower right quadrant being positioned off by a pixel or two just because of built-up rounding errors. I have not tried your mod with these type scale factors. The biggest benefit to TransformationMatrix is fonts scale very smoothly to any size, whereas without TransformationMatrix they scale in little "jumps", since some fonts don't work at weird point sizes like 12.33 or whatever.

I've been wanting to upgrade to 6.0 for a long time, but since my changes were so extensive (and which included modding the Lua script), I was stuck and unable to move forward without a ton of work. Your mod will finally get me over the hump, I hope! :rosegift:
FYI: I just posted an updated package (V6.0.2) in previous post to correct all styles.
I overlooked some of the special labels scaling font size :?
I added a background color setting in the options skin.

Yes, scaling can produce some undesirable results, but keeping the scaling within limits can reduce the chance for it to get too "ugly".
TransformationMatrix has too many issues with mouse interaction for me to even consider for this skin.
I rounded (using 'Trunc') all of the FontSize scaled values in the styles, but I do not see any "weirdness". :uhuh:

Take a look at the latest version and let me know if you notice any strangeness or have any suggestions. :thumbup:
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Help with the background color : Lua Calendar

Post by SilverAzide »

eclectic-tech wrote: August 17th, 2021, 10:19 pm FYI: I just posted an updated package (V6.0.2) in previous post to correct all styles.
I overlooked some of the special labels scaling font size :?
I added a background color setting in the options skin.

Yes, scaling can produce some undesirable results, but keeping the scaling within limits can reduce the chance for it to get too "ugly".
TransformationMatrix has too many issues with mouse interaction for me to even consider for this skin.
I rounded (using 'Trunc') all of the FontSize scaled values in the styles, but I do not see any "weirdness". :uhuh:

Take a look at the latest version and let me know if you notice any strangeness or have any suggestions. :thumbup:
Hi ET,
Check this out... LuaCalendar 5.0 with my TransformationMatrix mod vs. your LuaCalendar 6.0 mod. At a scale of 1.0, it is virtually pixel perfect. If you go larger or smaller, things can drift slightly if you use non-integer values. This pic is at 1.50, where you start to see some drift in the text.

5vs6.png

One item to check, the [LblTxtSty] and [TextStyle] need to both use the same X value, otherwise the day headings will get out of line with the days if you use different font sizes. I used X=(#Space.x#+#C.w#)r. Also, I could not get the date indicator [TodayHL] to look right, sometimes it showed too high, too low, too short (it is fine at a scale of 1.0). Perhaps it is me. Maybe the H/W values might need scaling too?
You do not have the required permissions to view the files attached to this post.
Gadgets Wiki GitHub More Gadgets...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with the background color : Lua Calendar

Post by eclectic-tech »

SilverAzide wrote: August 18th, 2021, 1:47 am ...
One item to check, the [LblTxtSty] and [TextStyle] need to both use the same X value, otherwise the day headings will get out of line with the days if you use different font sizes. I used X=(#Space.x#+#C.w#)r. Also, I could not get the date indicator [TodayHL] to look right, sometimes it showed too high, too low, too short (it is fine at a scale of 1.0). Perhaps it is me. Maybe the H/W values might need scaling too?
Yes, in the version I have, the [TextStyle] already uses X=(#Space.x#+#C.w#)r. You are right, that should be used in the [LblTxtSty] section also.

In regard to the [TodayHL], I see several different styles from lines under, on the side, or filled. The original styles use formulas for the positioning, a preset values for height, and a formula to determine the width. That is fine for a static skin, but when scaling up or down, trying to incorporate the scaling factor into a pre-existing formula is difficult, and produces mixed results.

My preferred method is to use Padding to define the resulting highlight, based on a only the #C.w# and #C.h# (character width and character height) as starting values for the meter. Padding works well for me when scaling if both W and H are defined in the meter.

My [TodayHL] meter for a solid filled highlight looks like this:

Code: Select all

;Date Indicator
[TodayHL]
Meter=image
X=(#Bumper.x#+(#C.w#+#Space.x#)*#Week#-1)
Y=(#Bumper.top#+(#C.h#+#Space.y#)*(#ThisWeek#+1))
H=#C.h#
W=#C.w#
SolidColor=#Clr.Hrl#
Hidden=#NotCurrentMonth#
DynamicVariables=1
Padding=1,0,3,0
This kept the fill area around the character "pretty much the same" as I scale between 0.5X and 4X. I think that is about as close as I can get.

I may post an update to my previous link, or perhaps an alternative in "Share Someboy Else's Creation" forum ;-)
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Help with the background color : Lua Calendar

Post by SilverAzide »

eclectic-tech wrote: August 19th, 2021, 3:01 am Yes, in the version I have, the [TextStyle] already uses X=(#Space.x#+#C.w#)r. You are right, that should be used in the [LblTxtSty] section also.

In regard to the [TodayHL], I see several different styles from lines under, on the side, or filled. The original styles use formulas for the positioning, a preset values for height, and a formula to determine the width. That is fine for a static skin, but when scaling up or down, trying to incorporate the scaling factor into a pre-existing formula is difficult, and produces mixed results.

My preferred method is to use Padding to define the resulting highlight, based on a only the #C.w# and #C.h# (character width and character height) as starting values for the meter. Padding works well for me when scaling if both W and H are defined in the meter.

My [TodayHL] meter for a solid filled highlight looks like this:

Code: Select all

;Date Indicator
[TodayHL]
Meter=image
X=(#Bumper.x#+(#C.w#+#Space.x#)*#Week#-1)
Y=(#Bumper.top#+(#C.h#+#Space.y#)*(#ThisWeek#+1))
H=#C.h#
W=#C.w#
SolidColor=#Clr.Hrl#
Hidden=#NotCurrentMonth#
DynamicVariables=1
Padding=1,0,3,0
This kept the fill area around the character "pretty much the same" as I scale between 0.5X and 4X. I think that is about as close as I can get.

I may post an update to my previous link, or perhaps an alternative in "Share Someboy Else's Creation" forum ;-)
Awesome, great idea! I've finished gutting my LuaCalendar 5.0 skins and replaced them with your tweaked 6.0.x mod. I'll link to your variant in the credits, so where ever you decide to post it would be fine by me. Perhaps a dedicated post like you suggested so other folks can find it more easily.

I found a bug in the Lua script as well. I was able to correct part of the problem, but not all of it. In the event processing code, if you have an event that is marked inactive, it will break the routine and no holidays/events past that date will work. If you have a finish date on an event, it will do the same thing, but in addition even with a fix, the finish dates are not working properly (specifically, ones where you give it a specific date, I did not test other combinations).

The error is here (~line 609):

Code: Select all

			if temp.finish < Time.stats.cmonth or temp.inactive then
				-- Force the function to terminate
				return nil
			end
The partial fix is:

Code: Select all

			if temp.finish < Time.stats.cmonth or temp.inactive then
				-- event finished before the first of this month or is inactive
				return temp
			end
Returning "temp" instead of "nil" fixes the inactive events and stops finish date events from breaking the processing, but finish dates still don't work. I'm not savvy enough with this gnarly-level Lua to fix the bug, but "temp.finish < Time.stats.cmonth" is definitely not correct since it only compares the month (and year?) of the event, not the day.
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with the background color : Lua Calendar

Post by Yincognito »

Smurfier's LuaCalendar and the need to use it have always been a mystery for me... Other than dynamically creating the events /holidays / whatever .INC or .TXT files for use from Rainmeter (where Lua certainly helps), everything else is doable in native code, with the benefit of less work and without some script preventing / reverting skin modifications (this is the thing that always throws me off in similar skins) like scaling and such. I must be missing something here for sure, but that's just me. If people like to use it and it makes them happy, I guess they don't mind the extra-work to tweak it. :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Help with the background color : Lua Calendar

Post by SilverAzide »

Yincognito wrote: August 19th, 2021, 5:52 pm Smurfier's LuaCalendar and the need to use it have always been a mystery for me... Other than dynamically creating the events /holidays / whatever .INC or .TXT files for use from Rainmeter (where Lua certainly helps), everything else is doable in native code, with the benefit of less work and without some script preventing / reverting skin modifications (this is the thing that always throws me off in similar skins) like scaling and such. I must be missing something here for sure, but that's just me. If people like to use it and it makes them happy, I guess they don't mind the extra-work to tweak it. :confused:
I guess the attraction is that LuaCalendar is -- at it's simplest -- just 50 or so near-empty meters and a Lua script. It's like a toolkit, with an appearance that is driven completely by styles. So by adjusting or creating a style sheet, you can transform the appearance into just about anything you want, with the added benefits of a built-in event/holiday system. So it's a handy toolkit for someone to create a fully functioning calendar without having to worry about hardly anything. You just tweak the appearance of a few style meters and -- bam! -- you are done. No other calendar I've seen is this easy to reskin or is as full-featured. Yes, a purely-Rainmeter re-skinnable (or "themeable") calendar is doable in theory, but I've not seen anyone actually do one (one that I can find, anyway).
Gadgets Wiki GitHub More Gadgets...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with the background color : Lua Calendar

Post by eclectic-tech »

Yincognito wrote: August 19th, 2021, 5:52 pm Smurfier's LuaCalendar and the need to use it have always been a mystery for me... Other than dynamically creating the events /holidays / whatever .INC or .TXT files for use from Rainmeter (where Lua certainly helps), everything else is doable in native code, with the benefit of less work and without some script preventing / reverting skin modifications (this is the thing that always throws me off in similar skins) like scaling and such. I must be missing something here for sure, but that's just me. If people like to use it and it makes them happy, I guess they don't mind the extra-work to tweak it. :confused:
LuaCalendar was last modified over 5 years ago, and since it's creation (I think about 10 years ago) many new features have been added to Rainmeter making possible to do many things that used to require scripting or other work arounds.

I agree that it is not the most user friendly skin, but many people have used it for years and have grown accustom to displaying it. My only interest was to update it so it can be useful on todays higher resolution displays.

I would welcome a new calendar skin using just Rainmeter, but I am not all that interested in calendars; I use the one in M$ Windows, but only look at it once a week or so.
User avatar
Yincognito
Rainmeter Sage
Posts: 7025
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with the background color : Lua Calendar

Post by Yincognito »

SilverAzide wrote: August 19th, 2021, 6:37 pm I guess the attraction is that LuaCalendar is -- at it's simplest -- just 50 or so near-empty meters and a Lua script. It's like a toolkit, with an appearance that is driven completely by styles. So by adjusting or creating a style sheet, you can transform the appearance into just about anything you want, with the added benefits of a built-in event/holiday system. So it's a handy toolkit for someone to create a fully functioning calendar without having to worry about hardly anything. You just tweak the appearance of a few style meters and -- bam! -- you are done. No other calendar I've seen is this easy to reskin or is as full-featured. Yes, a purely-Rainmeter re-skinnable (or "themeable") calendar is doable in theory, but I've not seen anyone actually do one (one that I can find, anyway).
eclectic-tech wrote: August 19th, 2021, 6:40 pmLuaCalendar was last modified over 5 years ago, and since it's creation (I think about 10 years ago) many new features have been added to Rainmeter making possible to do many things that used to require scripting or other work arounds.

I agree that it is not the most user friendly skin, but many people have used it for years and have grown accustom to displaying it. My only interest was to update it so it can be useful on todays higher resolution displays.

I would welcome a new calendar skin using just Rainmeter, but I am not all that interested in calendars; I use the one in M$ Windows, but only look at it once a week or so.
Ah, I see. I didn't mean that is not user friendly and it's certainly an excellent "toolkit" to have, I just had this idea that it's harder (than a "normal" skin) to customize / correct / adjust, and your comments here suggested that as well, as far as I could understand. But then, that was my impression from pre-Lua times (similar to poiru's multiple feed script) and I already have my own two meter calendar (without events, though I guess they could be added using $MouseX/Y$ variables on click, or using the Mouse plugin to allow it on hover) which seemed relatively easier to build at that time, so I'm probably biased on this one. :confused:

Many thanks for explaining it to me, I might just try it (again) someday, out of curiosity. Maybe that time it will seem easier to wrap my head around the whole thing. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth