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

1293224 char font

recalculating the height of the lines.
This commit is contained in:
mfrasca
2006-10-06 16:27:03 +00:00
parent 40044a31ce
commit d26e4815fe
2 changed files with 9 additions and 5 deletions

View File

@@ -147,7 +147,7 @@ class PywmHDMon:
x + paintWidth + xOffset, y + yOffset) x + paintWidth + xOffset, y + yOffset)
def getY(self, line): def getY(self, line):
return 2 + (line - 1) * (char_height + 3) return 2 + (line - 1) * (char_height + 1)
def paintLabel(self, line, label): def paintLabel(self, line, label):
self.addString(label, 1, self.getY(line)) self.addString(label, 1, self.getY(line))
@@ -446,8 +446,8 @@ def main():
displayMode = defaultMode displayMode = defaultMode
pathsToMonitor.append((label[:3], path, displayMode, action)) pathsToMonitor.append((label[:3], path, displayMode, action))
wmdocklib.addMouseRegion(i, wmdocklib.addMouseRegion(i,
8, 8 + (i - 1) * (char_height + 3), 8, 8 + (i - 1) * (char_height + 1),
58, 4 + i * (char_height + 3)) 58, 4 + i * (char_height + 1))
procStat = config.get('procstat', defaultProcStat) procStat = config.get('procstat', defaultProcStat)
skipping = int(config.get('skipconf', 0)) skipping = int(config.get('skipconf', 0))
actMonEnabled = int(config.get('monitoring')) actMonEnabled = int(config.get('monitoring'))

View File

@@ -88,7 +88,11 @@ def addChar(ch, x, y, xOffset, yOffset, width, height):
targY = y + yOffset targY = y + yOffset
if targX + char_width > width - xOffset or targY + char_height > height - yOffset\ if targX + char_width > width - xOffset or targY + char_height > height - yOffset\
or targX < 0 or targY < 0: or targX < 0 or targY < 0:
raise ValueError, "Out of bounds." raise ValueError, "Out of bounds. %s %s %s %s" % (
targX + char_width > width - xOffset,
targY + char_height > height - yOffset,
targX < 0,
targY < 0)
pywmgeneral.copyXPMArea(chX, chY, char_width, char_height, targX, targY) pywmgeneral.copyXPMArea(chX, chY, char_width, char_height, targX, targY)
return (char_width, char_height) return (char_width, char_height)
@@ -106,7 +110,7 @@ def getVertSpacing(numLines, margin, height, yOffset):
"""Return the optimal spacing between a number of lines. """Return the optimal spacing between a number of lines.
margin is the space we want between the first line and the top.""" margin is the space we want between the first line and the top."""
h = height - numLines * char_height - yOffset * 2 - margin h = height - (numLines * char_height + 1) - yOffset * 2 - margin
return h / (numLines - 1) return h / (numLines - 1)