Skip to content

Commit

Permalink
Fix title for void toc panel
Browse files Browse the repository at this point in the history
  • Loading branch information
hugolabe committed Feb 1, 2024
1 parent b0a4517 commit 526a75e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ def __init__(self, window):
# Populate toc list

def populate(self, title, sections):
self.title_label.set_label(title)

while True:
row = self.toc_list.get_row_at_index(0)
if row:
Expand All @@ -40,12 +38,12 @@ def populate(self, title, sections):
break

if sections:
self.title_label.set_visible(True)
self.title_label.set_label(title)
for section in sections:
row = TocBoxRow(section['anchor'].replace('_', ' '), section['anchor'], section['toclevel'])
self.toc_list.append(row)
else:
self.title_label.set_visible(False)
self.title_label.set_label('')

# On list activated load section

Expand Down

0 comments on commit 526a75e

Please sign in to comment.