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

modified computation of right hand side area size.

it is now 60% of available width.
right hand side text is now right aligned.
This commit is contained in:
mfrasca
2006-10-16 11:45:45 +00:00
parent dd13e8ad21
commit 111d3f4ed9

View File

@@ -161,7 +161,7 @@ class PywmHDMon:
def paintHdData(self, line, data, mode):
total, free = data
xStart = width - xOffset - 6 * char_width - 1
xStart = (width*2)/5
if total==0:
self.addString(' ', xStart, self.getY(line))
self.paintGraph(0, xStart, self.getY(line) + 4,
@@ -174,10 +174,10 @@ class PywmHDMon:
self.addString(percentStr, xStart, self.getY(line))
elif mode == 'used':
totalStr = bytesToStr(total).rjust(5)
self.addString(totalStr, xStart, self.getY(line))
self.addString(totalStr, width-yOffset*2-5*char_width-1, self.getY(line))
elif mode == 'free':
freeStr = bytesToStr(free).rjust(5)
self.addString(freeStr, xStart, self.getY(line))
self.addString(freeStr, width-yOffset-5*char_width, self.getY(line))
elif mode == 'bar':
percentUsed = (float(total - free) / float(total)) * 100.0
self.paintGraph(percentUsed, xStart, self.getY(line) + 2,