AvaloniaEdit icon indicating copy to clipboard operation
AvaloniaEdit copied to clipboard

Remove margin around TextEditor

Open mgarstenauer opened this issue 1 year ago • 3 comments

This is a cosmetic PR that removes the 30px margin around the TextEditor in the demo.

Before: image

After: image

(Looking at the git history, the Margin has been there for the last 7+ years. I don't think that the margin serves any purpose. Let's remove it to avoid any confusion!)

mgarstenauer avatar Apr 27 '24 13:04 mgarstenauer

Most code editors have a margin on the line number panel to make it more readable and prettier. Removing the margin feels much worse to me.

Rekkonnect avatar May 30 '24 14:05 Rekkonnect

@Rekkonnect Thanks for the feedback. I was mainly worried about the margins on the other sides. Having space between the scrollbars and the window, felt like a bug.

I pushed a small change. Keep some margin on the left for readability, remove the top/right/bottom margins. Here is what it looks like:

image

mgarstenauer avatar May 31 '24 11:05 mgarstenauer

I increased the minimum size of the LineNumberMargin. This ensures that there is enough space between the line numbers and any other text editor margins.

Together with the breakpoint margin it looks like this: image

mgarstenauer avatar May 31 '24 14:05 mgarstenauer