mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #22628: Increase Treewidge line spacing so lines do not overlap.
Move test lines up with respect to icons.
This commit is contained in:
parent
fa5021699a
commit
9a6f8e1866
1 changed files with 4 additions and 3 deletions
|
@ -173,11 +173,12 @@ class TreeNode:
|
||||||
|
|
||||||
def draw(self, x, y):
|
def draw(self, x, y):
|
||||||
# XXX This hard-codes too many geometry constants!
|
# XXX This hard-codes too many geometry constants!
|
||||||
|
dy = 20
|
||||||
self.x, self.y = x, y
|
self.x, self.y = x, y
|
||||||
self.drawicon()
|
self.drawicon()
|
||||||
self.drawtext()
|
self.drawtext()
|
||||||
if self.state != 'expanded':
|
if self.state != 'expanded':
|
||||||
return y+17
|
return y + dy
|
||||||
# draw children
|
# draw children
|
||||||
if not self.children:
|
if not self.children:
|
||||||
sublist = self.item._GetSubList()
|
sublist = self.item._GetSubList()
|
||||||
|
@ -188,7 +189,7 @@ class TreeNode:
|
||||||
child = self.__class__(self.canvas, self, item)
|
child = self.__class__(self.canvas, self, item)
|
||||||
self.children.append(child)
|
self.children.append(child)
|
||||||
cx = x+20
|
cx = x+20
|
||||||
cy = y+17
|
cy = y + dy
|
||||||
cylast = 0
|
cylast = 0
|
||||||
for child in self.children:
|
for child in self.children:
|
||||||
cylast = cy
|
cylast = cy
|
||||||
|
@ -227,7 +228,7 @@ class TreeNode:
|
||||||
|
|
||||||
def drawtext(self):
|
def drawtext(self):
|
||||||
textx = self.x+20-1
|
textx = self.x+20-1
|
||||||
texty = self.y-1
|
texty = self.y-4
|
||||||
labeltext = self.item.GetLabelText()
|
labeltext = self.item.GetLabelText()
|
||||||
if labeltext:
|
if labeltext:
|
||||||
id = self.canvas.create_text(textx, texty, anchor="nw",
|
id = self.canvas.create_text(textx, texty, anchor="nw",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue