A curious observation, #2

44 views
Skip to first unread message

jkn

unread,
Jan 4, 2023, 3:18:12 PM1/4/23
to leo-editor
This is a pretty tiny scratch, but: does anyone else notice that the line numbers
in the body pane border are slightly misaligned with the actual lines in the body?

For me, numbers in the border are a little lower than the lines in the body.

I am sure this depends on the fonts set and their metrics; just curious if anyone else has this.

Regards, J^n

Thomas Passin

unread,
Jan 4, 2023, 6:08:17 PM1/4/23
to leo-editor
Yes indeed, and there is a setting to adjust for the misalignment. @int gutter-y-adjust = 7 works for my current theme.  I've been known to have to go up to 12.  I forget how I learned about this setting, it's been too long.

jkn

unread,
Jan 5, 2023, 2:52:03 AM1/5/23
to leo-editor
Ah brilliant, thanks. I didn't know about the gutter-y-adjust setting. I do appreciate that getting it right programatically, for all fonts etc, would be tricky/impractical...

jkn

unread,
Jan 5, 2023, 3:42:56 AM1/5/23
to leo-editor
A gutter-y-adjust value of 2 or 3 seems to work well for my current theme/font settings, thanks!

Thomas Passin

unread,
Jan 5, 2023, 9:54:48 AM1/5/23
to leo-editor
I see in LeoPyRef that there is also a setting gutter-w-adjust.  A comment says its function is to provide extra room for bolding the line number of the current line.  Its default value seems to work for me (a good thing because I didn't know about it before now).

The line numbers are not applied using CSS styles.  They are directly painted into the gutter area.

jkn

unread,
Jan 5, 2023, 12:38:58 PM1/5/23
to leo-editor
Heh, I was thinking of looking for a setting named that, for curiosity's sake if nothing else. Thanks for beating me to it...

Thomas Passin

unread,
Jan 5, 2023, 1:24:30 PM1/5/23
to leo-editor
There is actually some CSS styling possible for the gutter:
A logical setting: @string font-size-gutter = 9pt

and in the theme's stylesheet:

QFrame#gutter {
  font-size: @font-size-gutter;
  background: @dark-base02;
}


Reply all
Reply to author
Forward
0 new messages