emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing UI elements behind text


From: Cecilio Pardo
Subject: Re: Drawing UI elements behind text
Date: Wed, 27 Nov 2024 00:19:43 +0100
User-agent: Mozilla Thunderbird

On 25/11/2024 0:37, JD Smith wrote:
I support this idea.  For indent-bars, I use display :stipple as a "separate 
band" of graphical information that can lie atop text in a buffer, but remain 
independent of it.  Stipples are flexible and very performant, but have a few issues:

- There is inconsistent stipple support across emacs versions.
- Stipple patterns begin at the frame origin, so up-to-date window-specific 
remapping is required to prevent unwanted pattern aliasing.
- Aligning stipples vertically requires fixed space content.

Stipples also disable the scrolling of buffer pixels, affecting performance of redisplay.


More commonly, modes also make use of :box styling, e.g. for producing boxed 
"labels", as in org-modern.

An API for drawing simple styled lines, rounded corners, boxes etc. — either in absolute 
window coordinates, or associated with, but "behind" text in the buffer — would 
represent a real step forward.

I haven't found a way to draw behind the text that is not too complicated or affects redisplay too much. So now the idea is drawing over the text. For the applications I have in mind this works equally well.

The starting drawing elements are going to be vertical and horizontal segments, with color (maybe with alpha), width and different patterns. They can be placed on pixel positions or character positions when using fixed size fonts, using floating point numbers so you can put, for example, indent lines in the middle of characters.

They are associated with a buffer, and have a 'source' marker so the facility can be shared by several programs.

Any ideas for more elements or applications are welcome.

--
Cecilio Pardo.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]