Skip to content

Commit 9a6f8e1

Browse files
committed
Issue #22628: Increase Treewidge line spacing so lines do not overlap.
Move test lines up with respect to icons.
1 parent fa50216 commit 9a6f8e1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/idlelib/TreeWidget.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,12 @@ def update(self):
173173

174174
def draw(self, x, y):
175175
# XXX This hard-codes too many geometry constants!
176+
dy = 20
176177
self.x, self.y = x, y
177178
self.drawicon()
178179
self.drawtext()
179180
if self.state != 'expanded':
180-
return y+17
181+
return y + dy
181182
# draw children
182183
if not self.children:
183184
sublist = self.item._GetSubList()
@@ -188,7 +189,7 @@ def draw(self, x, y):
188189
child = self.__class__(self.canvas, self, item)
189190
self.children.append(child)
190191
cx = x+20
191-
cy = y+17
192+
cy = y + dy
192193
cylast = 0
193194
for child in self.children:
194195
cylast = cy
@@ -227,7 +228,7 @@ def drawicon(self):
227228

228229
def drawtext(self):
229230
textx = self.x+20-1
230-
texty = self.y-1
231+
texty = self.y-4
231232
labeltext = self.item.GetLabelText()
232233
if labeltext:
233234
id = self.canvas.create_text(textx, texty, anchor="nw",

0 commit comments

Comments
 (0)