rdbende / tkcode

Use Chlorophyll instead
https://github.com/rdbende/chlorophyll
MIT License
19 stars 3 forks source link

Insert becomes small for no reason until something is typed #13

Closed Moosems closed 2 years ago

Moosems commented 2 years ago

Insert becomes small for no reason until something is typed

Video:

https://user-images.githubusercontent.com/95927277/178116022-23f9b86e-266b-4165-b37e-0d420d521f2d.mov

Json:

        "general":
        {
            "background":{"$ref": "#/ColoringLight/bg"},
            "foreground": {"$ref": "#/ColoringLight/fg"},
            "insertbackground": "#c8894a",
            "insertwidth": 2,
            "highlightthickness": 0,
            "borderwidth": 0
        },
rdbende commented 2 years ago

It's a Tk bug, and it's somewhat intentional.

Since the insert cursor would cover the first letter at the edge of the widget, half of it is cut off to hide as little of the text as possible. This is clearly visible if you make the cursor a bit wider. image

image

However, the bug here is that if you set padding or a wider border, the cursor is still cut off instead of drawing it on top of the padding, which is a bit odd. image

This bug has been fixed in the revised text widget implementation (which will be used in Tukaan): http://scidb.sourceforge.net/tk/insert-cursor.html

Moosems commented 2 years ago

So for now should I make it have an insertwidth of 1 to eliminate the issue?

rdbende commented 2 years ago

Yes, it's a solution.