Made the cursor also be a square when square bits is enabled.

This commit is contained in:
The Wobbler 2024-12-15 16:07:47 +01:00
parent 2cb7b80cb8
commit 436cb3018c

View file

@ -55,6 +55,11 @@ class BitEditor:
self.font.setLetterSpacing(QFont.SpacingType.PercentageSpacing, spacing)
self.input.setFont(self.font)
self.cursor_width = self.input.fontMetrics().averageCharWidth()
# set the cursor with to match the letter spacing
self.input.setCursorWidth(self.cursor_width + 1) # + 1 because else it somehow draws a 1px wide vertical line
highlight_ones = self.app.settings.highlight_ones
highlighter_document = self.input.document() if highlight_ones else None