It is currently March 28th, 2024, 9:33 pm

Is there a way to center things better?

Get help with creating, editing & fixing problems with skins
ExileEd iting
Posts: 7
Joined: March 17th, 2018, 4:53 am

Re: Is there a way to center things better?

Post by ExileEd iting »

balala wrote:Using the settings you've gave us above, the clock aligns perfectly for me in the center of the screen. Just take it into account that the real surface of the skin is a bit different from the effectively visible surface of the clock. Add the following two options to the [Rainmeter] section of the Clock_hori1.ini (this is it, right, not clock_hori, as you said?):

Code: Select all

[Rainmeter]
...
BackgroundMode=2
SolidColor=240,240,240,80
These options will make visible (with grey) the surface of the skin. Check it again if it you see it aligned now.
Adding the above options to the [Rainmeter] section of the Date_white1.ini file, too, will make same way visible the surface of this skin, too. You didn't post the settings from the Rainmeter.ini of this last skin, too, but I think they both are aligned accordingly to the settings.
Also have to take into account that the widths of different digits aren't the same (the narrowest digit is 1). As I see it, the skin doesn't move when the minutes are changing. Also, if you add the above options to the [Rainmeter] section of the skin, you'll see that the width of it really doesn't change.
Hm alright. Is there a way to change the width based on the widths of the characters?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is there a way to center things better?

Post by balala »

ExileEd iting wrote:Is there a way to change the width based on the widths of the characters?
I'd be tempted to align not the skin, but just the clock (talking about the clock skin). Immediately I'll post an example. Just give me a few minutes.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is there a way to center things better?

Post by balala »

Take a look at the following code. It is the rewritten code of the Clock_hori1.ini skin. Replace the old code with this one (however first make a backup of the old file, just in case):

Code: Select all

[Rainmeter]
MouseOverAction=[!ShowMeter colors][!Redraw]
MouseLeaveAction=[!HideMeter colors][!Redraw]
MiddleMouseDownAction=[!ActivateConfig "#CURRENTCONFIG#" "Clock_vert1.ini"]
OnRefreshaction=[!Move "0" "0"]
@include=#SKINSPATH#Elegance2\Config\Fonts.inc

[Metadata]
Author=lilshizzy@gmail.com
Name=Elegance 2 - Clock (horizontal)
Config=
Description=
Instructions=This clock can be set to either 12-hours or 24-hours, | use the Confinguration tool for this and more options.
Version=
Tags=
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=
Preview=

[MeasureTime]
Measure=Time
Format=#Hours# %M

[Variables]
@include=#SKINSPATH#Elegance2\Config\Default.inc

[Styles]
@include=#SKINSPATH#Elegance2\Config\Styles.inc

;-------------------------------

[Background]
Meter=IMAGE
SolidColor=0,0,0,1
X=0
Y=0
W=450
H=180

[MeterTime]
Meter=STRING
MeasureName=MeasureTime
X=(#SCREENAREAWIDTH#/2)
Y=(#SCREENAREAHEIGHT#/2)
StringAlign=CenterCenter
StringStyle=Normal
FontColor=#color1#
FontFace=#LocalFontFace#
FontSize=150
AntiAlias=1
ClipString=0
Text=%1
InlineSetting=Color | #color3#
InlinePattern=^.* (..)$
DynamicVariables=0
SolidColor=0,0,0,1

[colors]
Meter=IMAGE
ImageName=#SKINSPATH#Elegance2\Config\Images\colors.png
X=(-[MeterTime:W]/2)r
Y=(-[MeterTime:H]/2)r
W=92
H=11
LeftMouseUpAction=[!ToggleConfig "Elegance2" "SetColors.ini"]
Hidden=1
DynamicVariables=1
Just a few things about this code:
  • I removed the not needed [MeasureTime2] measure and rewrote the [MeasureTime], to return, beside the hour, the minutes, too.
  • I removed all four existing String meters ([Times1hadow], [Time2shadow], [Time] and [Time2]), and added a new one ([MeterTime]). This shows the hour and the minutes and I aligned it to center, both horizontally and vertically, with its StringAlign (StringAlign=CenterCenter) option. Being aligned so, I placed it to the center of the screen (using the X=(#SCREENAREAWIDTH#/2) and Y=(#SCREENAREAHEIGHT#/2) options).
  • I added an option to the [Rainmeter] section, to move the skin in the upper left corner of the screen when the skin is refreshed (OnRefreshaction=[!Move "0" "0"]). This option, along with the position of the above string meter, ensures that the meter is in the center of the screen.
  • I also added two options to the [MeterTime] meter, to can color the minutes accordingly to the settings. This is done by InlineSettings.
  • I moved the [colors] meter, below [MeterTime], to can position it relatively to the last one.
  • I also made a few minor changes. For example I removed the deprecated !Rainmeter bang prefixes and the also deprecated !Execute bangs (I suppose this is a very old, partially rewritten code, because these options was deprecated long time ago). Also moved the Author option from the [Rainmeter] section (where it also was deprecated) to [Metadata], where it belongs newly. Finally I removed the quotations marks from the options where they were used.
Please check this code and let me know if it is somehow ok.
ExileEd iting
Posts: 7
Joined: March 17th, 2018, 4:53 am

Re: Is there a way to center things better?

Post by ExileEd iting »

balala wrote:Take a look at the following code. It is the rewritten code of the Clock_hori1.ini skin. Replace the old code with this one (however first make a backup of the old file, just in case):

Code: Select all

[Rainmeter]
MouseOverAction=[!ShowMeter colors][!Redraw]
MouseLeaveAction=[!HideMeter colors][!Redraw]
MiddleMouseDownAction=[!ActivateConfig "#CURRENTCONFIG#" "Clock_vert1.ini"]
OnRefreshaction=[!Move "0" "0"]
@include=#SKINSPATH#Elegance2\Config\Fonts.inc

[Metadata]
Author=lilshizzy@gmail.com
Name=Elegance 2 - Clock (horizontal)
Config=
Description=
Instructions=This clock can be set to either 12-hours or 24-hours, | use the Confinguration tool for this and more options.
Version=
Tags=
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=
Preview=

[MeasureTime]
Measure=Time
Format=#Hours# %M

[Variables]
@include=#SKINSPATH#Elegance2\Config\Default.inc

[Styles]
@include=#SKINSPATH#Elegance2\Config\Styles.inc

;-------------------------------

[Background]
Meter=IMAGE
SolidColor=0,0,0,1
X=0
Y=0
W=450
H=180

[MeterTime]
Meter=STRING
MeasureName=MeasureTime
X=(#SCREENAREAWIDTH#/2)
Y=(#SCREENAREAHEIGHT#/2)
StringAlign=CenterCenter
StringStyle=Normal
FontColor=#color1#
FontFace=#LocalFontFace#
FontSize=150
AntiAlias=1
ClipString=0
Text=%1
InlineSetting=Color | #color3#
InlinePattern=^.* (..)$
DynamicVariables=0
SolidColor=0,0,0,1

[colors]
Meter=IMAGE
ImageName=#SKINSPATH#Elegance2\Config\Images\colors.png
X=(-[MeterTime:W]/2)r
Y=(-[MeterTime:H]/2)r
W=92
H=11
LeftMouseUpAction=[!ToggleConfig "Elegance2" "SetColors.ini"]
Hidden=1
DynamicVariables=1
Just a few things about this code:
  • I removed the not needed [MeasureTime2] measure and rewrote the [MeasureTime], to return, beside the hour, the minutes, too.
  • I removed all four existing String meters ([Times1hadow], [Time2shadow], [Time] and [Time2]), and added a new one ([MeterTime]). This shows the hour and the minutes and I aligned it to center, both horizontally and vertically, with its StringAlign (StringAlign=CenterCenter) option. Being aligned so, I placed it to the center of the screen (using the X=(#SCREENAREAWIDTH#/2) and Y=(#SCREENAREAHEIGHT#/2) options).
  • I added an option to the [Rainmeter] section, to move the skin in the upper left corner of the screen when the skin is refreshed (OnRefreshaction=[!Move "0" "0"]). This option, along with the position of the above string meter, ensures that the meter is in the center of the screen.
  • I also added two options to the [MeterTime] meter, to can color the minutes accordingly to the settings. This is done by InlineSettings.
  • I moved the [colors] meter, below [MeterTime], to can position it relatively to the last one.
  • I also made a few minor changes. For example I removed the deprecated !Rainmeter bang prefixes and the also deprecated !Execute bangs (I suppose this is a very old, partially rewritten code, because these options was deprecated long time ago). Also moved the Author option from the [Rainmeter] section (where it also was deprecated) to [Metadata], where it belongs newly. Finally I removed the quotations marks from the options where they were used.
Please check this code and let me know if it is somehow ok.
Wow thanks a lot. Looks great but I was wondering is it possible to remove the space between the hours and minutes? I try but then it removes the colouring.

EDIT: figured it out.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is there a way to center things better?

Post by balala »

ExileEd iting wrote:EDIT: figured it out.
So, everything is ok now?
ExileEd iting
Posts: 7
Joined: March 17th, 2018, 4:53 am

Re: Is there a way to center things better?

Post by ExileEd iting »

balala wrote:So, everything is ok now?
Yeah. I added the same stuff to the date just to make sure everything is aligned properly and it's all working great now. Thanks!
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is there a way to center things better?

Post by balala »

Glad to help.