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:
@@ -147,7 +147,7 @@ class PywmHDMon:
|
||||
x + paintWidth + xOffset, y + yOffset)
|
||||
|
||||
def getY(self, line):
|
||||
return 2 + (line - 1) * (char_height + 3)
|
||||
return 2 + (line - 1) * (char_height + 1)
|
||||
|
||||
def paintLabel(self, line, label):
|
||||
self.addString(label, 1, self.getY(line))
|
||||
@@ -446,8 +446,8 @@ def main():
|
||||
displayMode = defaultMode
|
||||
pathsToMonitor.append((label[:3], path, displayMode, action))
|
||||
wmdocklib.addMouseRegion(i,
|
||||
8, 8 + (i - 1) * (char_height + 3),
|
||||
58, 4 + i * (char_height + 3))
|
||||
8, 8 + (i - 1) * (char_height + 1),
|
||||
58, 4 + i * (char_height + 1))
|
||||
procStat = config.get('procstat', defaultProcStat)
|
||||
skipping = int(config.get('skipconf', 0))
|
||||
actMonEnabled = int(config.get('monitoring'))
|
||||
|
||||
@@ -88,7 +88,11 @@ def addChar(ch, x, y, xOffset, yOffset, width, height):
|
||||
targY = y + yOffset
|
||||
if targX + char_width > width - xOffset or targY + char_height > height - yOffset\
|
||||
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)
|
||||
return (char_width, char_height)
|
||||
|
||||
@@ -106,7 +110,7 @@ def getVertSpacing(numLines, margin, height, yOffset):
|
||||
"""Return the optimal spacing between a number of lines.
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user