It is currently April 25th, 2024, 12:54 pm

How refresh automatically skin after loaded?

Get help with creating, editing & fixing problems with skins
User avatar
Oleg_M
Posts: 23
Joined: June 19th, 2010, 7:24 am
Location: Leningrad, USSR

Re: How refresh automatically skin after loaded?

Post by Oleg_M »

balala
Friend,combination RSHIFT+RIGHT and RSHIFT+LEFT it is surprising :), work perfectly, restart RAINMETER 20 times today, I continue monitoring work of the favourite program!
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How refresh automatically skin after loaded?

Post by balala »

Oleg_M wrote:balala
Friend,combination RSHIFT+RIGHT and RSHIFT+LEFT it is surprising :), work perfectly, restart RAINMETER 20 times today, I continue monitoring work of the favourite program!
Ok, I'm glad. If the problems returns, please post your code for further help.
WirlyWirly
Posts: 17
Joined: July 15th, 2020, 6:37 am

Re: How refresh automatically skin after loaded?

Post by WirlyWirly »

I've currently run into a situation where I am needing a solution to the initial questions; Refreshing a skin automatically.

I have a skin that displays the date. I leave my pc on 24/7, so the skin is only loaded (therefore refreshed) very rarely (Usually once a week).

The problem is that when the date changes at midnight, the X alignment of the skin makes it appear in various locations because of the varying size of each number. For example...

The '0' in '10' is wider than the second '1' in '11', so it's too far to the left when it changes at midnight (Ignore the skin above the date)...
Image

After manually refreshing the skin...
Image

Tomorrow, when it changes from 11 to 12, it will be off-screen because the 2 is larger in width than 1. I have to manually refresh the skin once a day, which isn't a huge deal, but if there's a fix I'd like to apply it. I've also noticed the same issue happens when the month changes, but of course that only happens once a month.

skin.ini

Code: Select all

[RainMeter]
Update = 58000
AccurateText = 1
BackgroundMode = 2
SolidColor = 0,0,0,1
DynamicWindowSize = 1
LeftMouseDoubleClickAction = [---snip---]


[Variables]
@Include = #@#Variables.inc

;=============================
;	MEASURES
;=============================
[MeasureMonth]
Measure = Time
Format = %B

[MeasureDay]
Measure = Time
Format = %A

[MeasureDateNumber]
Measure = Time
Format = %d

[MeasureMinutes]
Measure = Time
Format = %M
IfCondition1 = (MeasureMinutes = 00)
IfTrueAction = [!Refresh]

;=============================
;	METERS
;=============================

[MeterMonth]
Measurename = MeasureMonth
Meter = String
X = 65
FontFace = #mediumFont#
FontColor = #Grey#
FontSize = 30
Antialias = 1

[MeterDay]
Meter = String
Group = SlashFont
Measurename = MeasureDay
X = R
Y = 40
FontFace = #mediumFont#
FontColor = #SlashUnfocused#
FontSize = 18
StringAlign = Right
Antialias = 1

[MeterDateNumber]
Meter = String
Group = SlashFont
MeasureName = MeasureDateNumber
X = 12r
Y = -15
FontFace = #boldFont#
FontColor = #SlashUnfocused#
FontSize = 62
Antialias = 1
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: How refresh automatically skin after loaded?

Post by ikarus1969 »

WirlyWirly wrote: October 12th, 2020, 3:14 am

Code: Select all

[RainMeter]
Update = 58000
AccurateText = 1
BackgroundMode = 2
SolidColor = 0,0,0,1
DynamicWindowSize = 1
LeftMouseDoubleClickAction = [---snip---]


[Variables]
@Include = #@#Variables.inc

;=============================
;	MEASURES
;=============================
[MeasureMonth]
Measure = Time
Format = %B

[MeasureDay]
Measure = Time
Format = %A

[MeasureDateNumber]
Measure = Time
Format = %d

[MeasureMinutes]
Measure = Time
Format = %M
IfCondition1 = (MeasureMinutes = 00)
IfTrueAction = [!Refresh]

;=============================
;	METERS
;=============================

[MeterMonth]
Measurename = MeasureMonth
Meter = String
X = 65
FontFace = #mediumFont#
FontColor = #Grey#
FontSize = 30
Antialias = 1

[MeterDay]
Meter = String
Group = SlashFont
Measurename = MeasureDay
X = R
Y = 40
FontFace = #mediumFont#
FontColor = #SlashUnfocused#
FontSize = 18
StringAlign = Right
Antialias = 1

[MeterDateNumber]
Meter = String
Group = SlashFont
MeasureName = MeasureDateNumber
X = 12r
Y = -15
FontFace = #boldFont#
FontColor = #SlashUnfocused#
FontSize = 62
Antialias = 1
I would change the alignment of the all the 3 meters to "StringAlign=RIGHT" together with changing the order of the 3 meters in the code.
Assuming you want them right-aligned to the right side of your screen you could try the following code. The exact positioning is up to you, but alignment shouldn't be a problem.
And before other's ask for: with the whole config we would be able to give more precise help. So please upload it including all graphics etc. The best would be to make a rmskin and upload it here.

Code: Select all

[RainMeter]
Update = 58000
AccurateText = 1
BackgroundMode = 2
SolidColor = 0,0,0,1
DynamicWindowSize = 1
LeftMouseDoubleClickAction = [---snip---]


[Variables]
@Include = #@#Variables.inc

;=============================
;	MEASURES
;=============================
[MeasureMonth]
Measure = Time
Format = %B

[MeasureDay]
Measure = Time
Format = %A

[MeasureDateNumber]
Measure = Time
Format = %d

[MeasureMinutes]
Measure = Time
Format = %M
IfCondition1 = (MeasureMinutes = 00)
IfTrueAction = [!Refresh]

;=============================
;	METERS
;=============================

[MeterDateNumber]
Meter = String
Group = SlashFont
MeasureName = MeasureDateNumber
X = (#WORKAREAX# + #WORKAREAWIDTH#)
Y = 50
FontFace = #boldFont#
FontColor = #SlashUnfocused#
FontSize = 62
StringAlign=RIGHT
Antialias = 1

[MeterMonth]
Measurename = MeasureMonth
Meter = String
X = ([MeterDateNumber:X] - 10)
Y= [MeterDateNumber:Y]
FontFace = #mediumFont#
FontColor = #Grey#
FontSize = 30
StringAlign=RIGHT
Antialias = 1

[MeterDay]
Meter = String
Group = SlashFont
Measurename = MeasureDay
X = ([MeterDateNumber:X] - 10)
Y= [MeterMonth:YH]
FontFace = #mediumFont#
FontColor = #SlashUnfocused#
FontSize = 18
StringAlign = RIGHT
Antialias = 1
User avatar
Yincognito
Rainmeter Sage
Posts: 7160
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How refresh automatically skin after loaded?

Post by Yincognito »

No refresh is needed in this case. As ikarus1969 pointed out, right alignment is one solution. The other is center alignment. In both cases though, this should be accompanied by setting the W (i.e. width) of the meters to fixed or hardcoded values, so that the size of the skin itself stays constant , in cases you have other adjacent skins nearby or you simply don't want the width of your skin to vary, like say, in the case of July vs. December or viceversa.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How refresh automatically skin after loaded?

Post by balala »

ikarus1969 wrote: October 12th, 2020, 6:01 am And before other's ask for: with the whole config we would be able to give more precise help. So please upload it including all graphics etc. The best would be to make a rmskin and upload it here.
ikarus1969 is perfectly right: we would need at least the used font (and additionally note that we don't even know its name, because it is kept as variables into probably the Variables.inc included file). So it is hard to say anything valuable, so please follow his advice, pack the config and upload the package.
And one more detail I have to say: for clock / date skins the best possibility for the Update is the default Update=1000. Using Update=58000 as you did makes the skin to react very slowly when the date changes: up to almost 1 minute. Recommend to modify the Update to Update=1000.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: How refresh automatically skin after loaded?

Post by CodeCode »

Well the idea of setting a fixed width, or aligning to the left make the basic sense. However there is always the [MeterName:W] option as well setting this along with one of the former ideas.

Incedentally "Septmeber" is generally longest series of character, but the fontface as previously noted may indeed make that moot since there is always the mono width fonts classes.

Then another idea is to substitute the whole month name with the abbreviated version, e.g. Substitute="September":"Sept" but that is off topic.

Anyways, I always prefer to fix the width of a skin in the case of a list of strings that is limited to 1 to 10 or January to December.

Finally my opinion is that the alignment in the second image is more aesthetically easy on the eye, imo.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How refresh automatically skin after loaded?

Post by balala »

CodeCode wrote: October 12th, 2020, 4:52 pm Then another idea is to substitute the whole month name with the abbreviated version, e.g. Substitute="September":"Sept"
No need to use a substitution. The Time measures have formats for abreviated month names as well, so why susbtitute? For instance the Format = %B option of the [MeasureMonth] measure should be replaced the Format = %b to get the names abreviated from the beginning, without a substitution.
WirlyWirly
Posts: 17
Joined: July 15th, 2020, 6:37 am

Re: How refresh automatically skin after loaded?

Post by WirlyWirly »

Thanks for the help everyone, I'm going to try your suggestions, but in the meantime I've attached the packaged skin. Keep in mind that I didn't make it with the intent for distribution, so there's a lot going on and most of its functionality won't work outside of my computer. Again, the only issue I have is fixing the date skin.

Warning: When you load the 'miniBar' skin, Hotkeys are active and you will see them on the bar (though I didn't package the plugin with the .rmskin, so I don't know if that matters). Click any empty space on the bar to disable them. You'll be launching all-kinds of stuff if you don't, which you probably don't want to do. ctrl+alt+space to bring the skins to the front and re-enable the hotkeys for whatever reason.

Windows 10
1920x1080 monitor
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How refresh automatically skin after loaded?

Post by balala »

WirlyWirly wrote: October 12th, 2020, 5:48 pm but in the meantime I've attached the packaged skin.
In this case the relative positioning of meters is the best idea. Here is an example: see that I changed the order of the meters (this time first is [MeterDateNumber], followed by [MeterMonth] and the last is [MeterDay]). The first meter is positioned absolutely (it has specific X and Y values), while the following ones are positioned relatively to previous ones. Also all meters have been aligned to right (as ikarus1969 suggested):

Code: Select all

[MeterDateNumber]
Meter=String
Group=SlashFont
MeasureName=MeasureDateNumber
X=330
Y=-15
StringAlign=Right
FontFace=#boldFont#
FontColor=#SlashUnfocused#
FontSize=62
Antialias=1

[MeterMonth]
Measurename=MeasureMonth
Meter=String
X=-96r
Y=12r
StringAlign=Right
FontFace=#mediumFont#
FontColor=#Grey#
FontSize=30
Antialias=1

[MeterDay]
Meter=String
Group=SlashFont
Measurename=MeasureDay
X=0r
Y=-10R
StringAlign=Right
FontFace=#mediumFont#
FontColor=#SlashUnfocused#
FontSize=18
StringAlign=Right
Antialias=1
Depending on your needs (and desires) you may play a little bit the X and Y values of all meters, to get them positiond exactly as you want.