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

1579522: antialiased fonts for digits

just a nice border around the top time string
This commit is contained in:
mfrasca
2006-10-18 12:46:06 +00:00
parent 0065f12b75
commit 92f172da49

View File

@@ -96,7 +96,7 @@ def getCenterStartPos(s):
return wmdocklib.getCenterStartPos(s, width, xOffset) return wmdocklib.getCenterStartPos(s, width, xOffset)
def getVertSpacing(numLines, margin): def getVertSpacing(numLines, margin):
return wmdocklib.getVertSpacing(numLines, margin, height, yOffset) + 1 return wmdocklib.getVertSpacing(numLines, margin-1, height, yOffset) + 1
def calculateWeek(localTime): def calculateWeek(localTime):
"""Calculate the week number as we do, for example in Sweden. """Calculate the week number as we do, for example in Sweden.
@@ -168,7 +168,6 @@ def mainLoop(timeFmt, dateFmt, dayFmt, weekFmt):
spacing = getVertSpacing(4, margin) spacing = getVertSpacing(4, margin)
timeX = getCenterStartPos(timeStr) timeX = getCenterStartPos(timeStr)
if lastStrs[0] != timeStr: if lastStrs[0] != timeStr:
clearLine(margin)
addTimeString(timeStr, timeX, margin-4) addTimeString(timeStr, timeX, margin-4)
lastStrs[0] = timeStr lastStrs[0] = timeStr
if counter % 100 == 0: if counter % 100 == 0:
@@ -230,21 +229,21 @@ background = [
" ", " ",
" ", " ",
" ", " ",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", " 7",
" ", "7777777777777777777777777777777777777777777777777777777777777777",
" ", " ",
" ", " ",
".+@@+.....#@...#@@#...#@@#....$@%.. ", ".+@@+.....#@...#@@#...#@@#....$@%.. ",
@@ -315,6 +314,7 @@ def main():
font_name=font, font_name=font,
bg=0, fg=2, palette=palette) bg=0, fg=2, palette=palette)
wmdocklib.openXwindow(sys.argv, width, height) wmdocklib.openXwindow(sys.argv, width, height)
wmdocklib.copyXPMArea(64+2*xOffset+1, 27, width - 2*xOffset, 17, xOffset, yOffset)
mainLoop(timeFmt, dateFmt, dayFmt, weekFmt) mainLoop(timeFmt, dateFmt, dayFmt, weekFmt)
if __name__ == '__main__': if __name__ == '__main__':