emacs-devel
[Top][All Lists]
Advanced

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

Re: vtable: Add column weights feature


From: Lars Ingebrigtsen
Subject: Re: vtable: Add column weights feature
Date: Sun, 09 Oct 2022 16:26:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Tad Fisher <tadfisher@gmail.com> writes:

> In my mind, "percentage of window width" specs aren't useful to begin
> with, because they interact poorly with fixed-width columns. If your
> goal is to have the vtable occupy a particular width of the window (e.g.
> 100%), this goal becomes difficult/impossible as soon as a fixed-width
> column is added.

That shouldn't be impossible -- the normal way to do this is to let the
percentage columns soak up the available space (but you need a way to
specify the total width of the table, which should be easy enough to
add).

> Ideally, you'd have a constraint on the vtable itself---as in, "I want
> the vtable to occupy 80% of the window width", and that value is used
> instead of (window-width nil t) when calculating column widths.

Yes, we could add that.

> And I do think that defining these concepts as "constraints" is the
> better approach in the long run; as in, the "width", "min-width", and
> "max-width" slots become part of an enumerated "constraint" type,
> so the API limits the possible values to those that make sense. Then
> the vtable--column-widths function solves those constraints to obtain
> the final width values. Does this make sense? My experience is mostly
> from Android UIs where this is a common way to define layouts, and my
> understanding is that the CSS "flexbox" model is similar.

I think percentages are easier to deal with if you don't consider them
to be strict.  That is, if you've specified the width of the entire
table, then having one table saying "10%" and another "20%" means that
any extra space would be distributed 1:2 between those two columns.




reply via email to

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