1
0
mirror of https://github.com/gryf/wmdocklib.git synced 2025-12-19 12:28:10 +01:00

added "condensed" 5x8 font to the suite,

cleaned up the code of pywmdatetime.
This commit is contained in:
mfrasca
2006-10-18 14:46:21 +00:00
parent 92f172da49
commit ad25a18c51
3 changed files with 46 additions and 3 deletions

View File

@@ -62,7 +62,7 @@ dayDefaultFormat = '%A'
weekDefaultFormat = 'wk %q' # %q added by Kristoffer for different week calculation.
defaultConfigFile = '~/.pywmdatetimerc'
maxCharsPerLine = 9
maxCharsPerLine = None
def addString(s, x, y):
try:
@@ -166,9 +166,10 @@ def mainLoop(timeFmt, dateFmt, dayFmt, weekFmt):
timeStr = time.strftime(timeFmt, lt)[:maxCharsPerLine]
margin = 6
spacing = getVertSpacing(4, margin)
timeX = getCenterStartPos(timeStr)
timeX = 3
if lastStrs[0] != timeStr:
addTimeString(timeStr, timeX, margin-4)
margin = 8
lastStrs[0] = timeStr
if counter % 100 == 0:
# We only perform the date/week checks/updates once every 100th
@@ -309,10 +310,11 @@ def main():
font = clConfig.get('font', '6x8orig')
global char_width, char_height
global char_width, char_height, maxCharsPerLine
char_width, char_height = wmdocklib.initPixmap(background,
font_name=font,
bg=0, fg=2, palette=palette)
maxCharsPerLine = (width-2*xOffset) / char_width
wmdocklib.openXwindow(sys.argv, width, height)
wmdocklib.copyXPMArea(64+2*xOffset+1, 27, width - 2*xOffset, 17, xOffset, yOffset)
mainLoop(timeFmt, dateFmt, dayFmt, weekFmt)