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: JD Smith
Subject: Re: Drawing UI elements behind text
Date: Tue, 26 Nov 2024 21:31:22 -0500

--

> On Nov 26, 2024, at 6:19 PM, Cecilio Pardo <cpardo@imayhem.com> wrote:
> 
> 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.

On all ports?  I didn’t know this, though haven’t had any related issues. 

>> 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.

For mine as well that would work, but features like this are added so rarely it 
makes sense to make it robust for various uses, if possible.  

> The starting drawing elements are going to be vertical and horizontal 
> segments, with color (maybe with alpha), width and different patterns.

Nice.  Is there a patch to try?  Bit patterns or similar are the most flexible. 
 

> 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.

Would they be associated with buffer text and move with it (aka :box), or fixed 
to the buffer window?  What API did you have in mind?


reply via email to

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