From 651b44127decd17de14581a6ecd52af23af49e4f Mon Sep 17 00:00:00 2001 From: mfrasca <> Date: Thu, 12 Oct 2006 19:14:50 +0000 Subject: [PATCH] 1575762: of pixmask hard coded 3 pixels margin. it should actually be configurable, but better this than nothing. --- examples/pywmdatetime.py | 2 +- examples/pywmhdmon.py | 4 ++-- wmdocklib/pywmhelpers.py | 11 ++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/examples/pywmdatetime.py b/examples/pywmdatetime.py index 0eb8156..39126ee 100755 --- a/examples/pywmdatetime.py +++ b/examples/pywmdatetime.py @@ -214,7 +214,7 @@ def main(): mainLoop(timeFmt, dateFmt, dayFmt, weekFmt) char_width, char_height = wmdocklib.initPixmap(font_name='6x8', - bg='f', fg='9') + bg='8', fg='a') if __name__ == '__main__': main() diff --git a/examples/pywmhdmon.py b/examples/pywmhdmon.py index 78485c8..1435535 100755 --- a/examples/pywmhdmon.py +++ b/examples/pywmhdmon.py @@ -471,6 +471,7 @@ def main(): background = \ ['0000000000000000000000000000000000000000000000000000000000000000', + '0000000000000000000000000000000000000000000000000000000000000000', '0044400555002220055500555000000000000000000000000000000000000000', '0044400555002220055500555000000000000000000000000000000000000000', '0044400555002220055500555000000000000000000000000000000000000000', @@ -522,7 +523,6 @@ background = \ '0044400000000000000000000000000000000000000000000000000000000000', '0044400000000000000000000000000000000000000000000000000000000000', '0044400000000000000000000000000000000000000000000000000000000000', - '0044400000000000000000000000000000000000000000000000000000000000', '0044400077777777777777777777777777777777777777777777777777777777', '0044400077777777777777777777777777777777777777777777777777777777', '0044400077777777777777777777777777777777777777777777777777777777', @@ -537,7 +537,7 @@ background = \ ] char_width, char_height = wmdocklib.initPixmap(background, - font_name='5x7', + font_name='6x8', bg='8', fg='a') if __name__ == '__main__': diff --git a/wmdocklib/pywmhelpers.py b/wmdocklib/pywmhelpers.py index c52dfe1..92fa744 100644 --- a/wmdocklib/pywmhelpers.py +++ b/wmdocklib/pywmhelpers.py @@ -180,7 +180,8 @@ def initPixmap(xpm_background=None, """ if xpm_background is None: - xpm_background = ['0'*width]*2 + ['00'+bg*(width-4)+'00']*(height-4) + ['0'*width]*2 + #xpm_background = ['0'*width]*4 + ['0000'+bg*(width-8)+'0000']*(height-8) + ['0'*width]*4 + xpm_background = [bg*width]*height if palette is None: palette = { 0: ('#000000','transparent'), @@ -191,7 +192,7 @@ def initPixmap(xpm_background=None, 5: ('#800000','red'), 6: ('#800080','purple'), 7: ('#c0c0c0','light_gray'), - 8: ('#010101','black'), + 8: ('#000000','black'), 9: ('#0000ff','light_blue'), 10: ('#00ffff','light_cyan'), 11: ('#00ff00','light_green'), @@ -217,7 +218,11 @@ def initPixmap(xpm_background=None, '%x\tc %s s %s' % (k, v[0], v[-1]) for k,v in palette.items() ] + [ - bg*64 + item for item in xpm_background + '0'*64 + item for item in xpm_background[:3] + ] + [ + '000'+bg*(64-6)+'000' + item for item in xpm_background[3:-3] + ] + [ + '0'*64 + item for item in xpm_background[-3:] ] + [ line.replace('%', fg).replace(' ', bg) for line in char_map