Skip to content

Commit

Permalink
Merge pull request #32 from dougollerenshaw/more_line_number_space
Browse files Browse the repository at this point in the history
Give more space to line numbers in code popup
  • Loading branch information
dougollerenshaw authored Sep 20, 2024
2 parents a80949e + e61986b commit 0406f84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codeaide/ui/code_popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def __init__(self, parent=None):

def line_number_area_width(self):
digits = len(str(max(1, self.blockCount())))
space = 3 + self.fontMetrics().horizontalAdvance("9") * digits
return space
space = 3 + self.fontMetrics().horizontalAdvance("9") * (digits + 1)
return min(space, 50) # Cap the width at 50 pixels

def update_line_number_area_width(self, _):
self.setViewportMargins(
Expand Down

0 comments on commit 0406f84

Please sign in to comment.