From 436cb3018cadeef633ff29ecd9962b443fa698fd Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Sun, 15 Dec 2024 16:07:47 +0100 Subject: [PATCH] Made the cursor also be a square when square bits is enabled. --- bread_editor/editor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bread_editor/editor.py b/bread_editor/editor.py index f5e5c87..64d99f9 100644 --- a/bread_editor/editor.py +++ b/bread_editor/editor.py @@ -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