Although you can use a script to grab the time-format length, but unable to change the window width and height from the script, so according to time-format length automatically adjusts the window is not possible (at least for now)
If you do not take into account the time-format length, consider only the font-size, can try this way:
(you need to modify 3 files: skin.xml, DigiClock.xml, elements.xml)
| Code: |
Add following into skin.xml
<variable name="DigiClock_fontsize" default="13" />
Add following into elements.xml
<font id="font.clock" facename="Tahoma" weight="Bold" size="%DigiClock_fontsize%" />
Add following into DigiClock.xml
<window id="DigiClock" w="(%DigiClock_fontsize% * 7)" h="(%DigiClock_fontsize% * 2)" threshold="48" default="0" >
<time id="DigiClock.time" align="CENTER" x1="(%DigiClock_fontsize% * 7)/2" y1="%DigiClock_fontsize%" element="font.clock" format="%Format%" timezone="%Timezone%" DST="1"/>
</window>
|
how to take the time format value, and create a useable variable that will give me the string length| Code: |
Time_Format = Rainlendar_GetVariable(skin, window, "Format")
ShowFormat = os.date(Time_Format)
ShowFormat_len = string.len(ShowFormat)
|