All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bean <bean123ch@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [GITGRUB] New menu interface (implementation)
Date: Mon, 28 Sep 2009 11:48:04 +0800	[thread overview]
Message-ID: <ca0f59980909272048m75ac1deen9d000fad5604c27d@mail.gmail.com> (raw)
In-Reply-To: <a5d587fb0909271346r776d59a3xcbb2ecabf4069b7f@mail.gmail.com>

On Mon, Sep 28, 2009 at 4:46 AM, Michal Suchanek <hramrach@centrum.cz> wrote:
> Does that mean that now the units are characters in text mode and
> pixels in graphics when specified separately?

Hi,

No, the default unit is still character. In fact, I've removed to "p"
unit that's specific to graphic
mode, now if you want to set pixel size, you need to use the '/'
method like 100/1 (100 pixels in graphic mode, 1 in text mode).

> Also when the vspace is set to 1 instead of 5/0 the text does not fit
> into the panel but is still drawn. The widgets should really use
> viewport for drawing to avoid these overflows. Unfortunately, this is
> probably not available in text mode but it should not be hard to add.

There are viewport function in region, available in graphic and text
mode. I can use it to limit the widget.

>>> For sizing two modes are useful: the minimum sizing that assigns the
>>> size required to display all content and the maximum sizing that
>>> expands the widget as much as possible. If width = 100% means that any
>>> siblings are not displayed because the widget occupies exactly the
>>> available space then a different notation would be useful for taking a
>>> share of the available width.
>>>
>>
>> Yep, I have plans for the min_width/min_height/max_width/max_height property.
>
> That's probably not the thing I had in mind. Well, perhaps setting
> max_width to 100% would do what width=* in HTML.

Currently, if you don't set width/height property, it would assign
minimum size automatically,  width = 100% means it has the same width
as its parent, the child widget would reposition according to that.

> I don't want to set the size of anything, ever. There still should be
> a way to get borders into the layout.

But layout ready has borders, just set the top_left/top/../bottom property.

> By stick to the border I mean the ugly situation when the element
> content touches the border visually blending with it.

My meaning of sticky is that the widget has a constant distance from
one of the border, for example, -1, -1 means it's -1c -1c from the
bottom right corner.

>
>> is impossible for x,y without setting the size.
>
> AFAIK it's still impossible to make a panel with the same distance
> from each border of the screen without setting its size manually.
>
> All my attempts failed miserably.

Doesn't the demo work ? The last panel only sets vmargin and hmargin,
width and height is calculated automatically and it's in the bottom
right corner.

>
> The other problem is that the text is not shown for some reason in the
> demo with Debian/Ubuntu/Gentoo and the blue squares are still shown in
> text mode.

The "title" property has renamed "text", and to remove the blue
square, just change

image = "/menu/ubunti.png,,blue"

to

image = "/menu/ubunti.png"

as the previous one would create a rect if image can't be loaded.

>> For single row, set
>> columns = 0
>>
>> For single column, set:
>> columns = 1
>>
>
> These look sensible except 0 meaning infinite is somewhat needlessly confusing.
>
> What's "columns = 3" for other than showing a demo? Which could be
> done in other ways, anyway.
>
> There are numerous bugs in the table layout already, and if you go
> with tables there's going to be no end of them.
>
> The table has no colspan/rowspan which people will likely expect of tables.
>
> The last cell that has hmargin/vmargin is ignored by the table layout
> to the point that it can overlap other cells.
>
> The cells in the last row are aligned differently than the above cells
> because the number of cells considered for the table layout is not
> divisible by the number of columns.
>
> hspace/vspace is ignored when the valign/halign is center.
>
> Last but not least tables which are a packing of elements modulo
> number of columns are fundamentally broken way of rendering a set of
> elements. A table is called for when you have elements that are sorted
> into a two dimensional space of indices. Then you can find a
> particular element by finding its row and column index. We don't have
> that kind of data in Grub.
>
> It is completely feasible to have multiple one-dimensional lists side
> by side or one below another.
>
> For example a row of bootloader icons and a row of tool icons. There
> is no relationship between the elements in the two lists so there is
> no problem with the lists scrolling independently. When a new
> bootloader is added the tools are not affected.
>
> Similarly you can have a list of Debian kernels in one column and a
> list of Gentoo kernels in another. Again they are independent of each
> other. Adding a Debian kernel should not affect Gentoo kernels nor the
> other way around so this is not a table.
>
> Even HTML does not have a mod N table. It has TR and TD. Managing a
> mod N table in a sensible way is a nightmare. When you actually have a
> table then you have to make sure you add a row at a time and pad with
> empty cells to preserve the columns. When you have a one-dimensional
> list adding to the middle of the list reflows all the later elements
> so it is not obvious what was changed and where. Adding kernels to the
> top as is customary reflows all elements in a mod N list so finding
> any earlier kernel is difficult, it changes position all the time.

In fact, if we combine the code for row and column handling, we have a
generic solution for any columns = N, I don't see why a generic
solution would be worse than a specific one, you can always falls back
to single row or column with N = 0 or 1. If you want to make it more
clear for users, I can add alias direction=horizontal for columns=0,
and direction=vertical for columns = 1.

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/



  reply	other threads:[~2009-09-28  3:48 UTC|newest]

Thread overview: 175+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16 20:55 [GITGRUB] New menu interface (implementation) Bean
2009-09-17 10:06 ` Bean
2009-09-19 14:38 ` Michal Suchanek
2009-09-19 20:48   ` Bean
2009-09-20  8:21     ` Michal Suchanek
2009-09-20  8:30     ` Michal Suchanek
2009-09-20 18:17       ` Bean
2009-09-21  9:16         ` Michal Suchanek
2009-09-21 14:56           ` Bean
2009-09-23 11:29             ` Michal Suchanek
2009-09-23 12:11               ` Bean
2009-09-23 17:10                 ` Bean
2009-09-23 19:26                   ` Bean
2009-09-24  7:20                     ` Michal Suchanek
2009-09-24  8:51                       ` Bean
2009-09-24  9:40                         ` Michal Suchanek
2009-09-24 10:31                           ` Bean
2009-09-24 22:00                             ` Michal Suchanek
2009-09-25  8:00                               ` Bean
2009-09-25  9:00                                 ` Michal Suchanek
2009-09-25  9:12                                   ` Bean
2009-09-25  9:46                                     ` Michal Suchanek
2009-09-25 10:02                                       ` Bean
2009-09-25 10:13                                         ` Michal Suchanek
2009-09-25 10:19                                           ` Bean
2009-09-25 10:37                                             ` Michal Suchanek
2009-09-25 15:45                                               ` Bean
2009-09-27 16:12                                                 ` Michal Suchanek
2009-09-27 18:33                                                   ` Bean
2009-09-27 20:46                                                     ` Michal Suchanek
2009-09-28  3:48                                                       ` Bean [this message]
2009-09-28  9:47                                                         ` Michal Suchanek
2009-09-28 10:48                                                           ` Bean
2009-09-28 11:44                                                             ` Michal Suchanek
2009-09-30 19:52                                                               ` Bean
2009-09-30 23:21                                                                 ` Michal Suchanek
2009-10-01  5:06                                                                   ` Bean
2009-10-01  8:41                                                                     ` Michal Suchanek
2009-10-01  9:17                                                                       ` Bean
2009-10-01 10:02                                                                         ` Bean
2009-10-01 12:19                                                                           ` Bean
2009-10-01 12:44                                                                         ` Michal Suchanek
2009-10-01 13:33                                                                           ` Bean
2009-10-01 14:53                                                                             ` Michal Suchanek
2009-10-01 16:22                                                                               ` Bean
2009-10-02  9:16                                                                                 ` Bean
2009-10-02 10:42                                                                                 ` Michal Suchanek
2009-10-03 15:25                                                                                   ` Bean
2009-10-03 22:34                                                                                     ` Michal Suchanek
2009-10-04  4:27                                                                                       ` Bean
2009-10-04 11:22                                                                                         ` Michal Suchanek
2009-10-04 13:54                                                                                           ` Bean
2009-10-04 16:06                                                                                             ` richardvoigt
2009-10-04 16:16                                                                                               ` Bean
2009-10-04 20:05                                                                                                 ` Bean
2009-10-04 20:16                                                                                                   ` Bean
2009-10-04 22:20                                                                                                     ` Michal Suchanek
2009-10-04 22:21                                                                                                       ` Michal Suchanek
2009-10-05  4:45                                                                                                       ` Bean
2009-10-05  9:07                                                                                                         ` Michal Suchanek
2009-10-05 10:35                                                                                                           ` Bean
2009-10-05 13:40                                                                                                             ` Michal Suchanek
2009-10-06  6:10                                                                                                               ` Bean
2009-10-06  6:25                                                                                                                 ` richardvoigt
2009-10-05 17:52                                                                                                             ` richardvoigt
2009-10-06  5:35                                                                                                               ` Bean
2009-10-05 12:24                                                                                                           ` Bean
2009-10-05 13:33                                                                                                             ` Michal Suchanek
2009-10-06  5:33                                                                                                               ` Bean
2009-10-06  9:50                                                                                                                 ` Michal Suchanek
2009-10-06 11:08                                                                                                                   ` Bean
2009-10-06 11:46                                                                                                                     ` Michal Suchanek
2009-10-06 13:14                                                                                                                       ` Bean
2009-10-06 15:18                                                                                                                         ` Michal Suchanek
2009-10-06 16:14                                                                                                                           ` Bean
2009-10-06 16:35                                                                                                                           ` Bean
2009-10-06 18:41                                                                                                                             ` Michal Suchanek
2009-10-06 22:16                                                                                                                             ` Michal Suchanek
2009-10-07  6:05                                                                                                                               ` Bean
2009-10-07  8:54                                                                                                                                 ` Michal Suchanek
2009-10-07 10:54                                                                                                                                   ` Bean
2009-10-07 10:57                                                                                                                                   ` Bean
2009-10-07 13:05                                                                                                                                     ` Michal Suchanek
2009-10-07 21:13                                                                                                                                       ` Michal Suchanek
2009-10-08  4:20                                                                                                                                         ` Bean
2009-10-08  5:21                                                                                                                                           ` Bean
2009-10-08 11:26                                                                                                                                             ` Michal Suchanek
2009-10-08 13:26                                                                                                                                               ` Bean
2009-10-08 21:34                                                                                                                                                 ` Michal Suchanek
2009-10-09  3:45                                                                                                                                                   ` Bean
2009-10-09 11:52                                                                                                                                                     ` Michal Suchanek
2009-10-09 12:48                                                                                                                                                       ` Bean
2009-10-09 14:20                                                                                                                                                         ` Michal Suchanek
2009-10-09 14:54                                                                                                                                                           ` Bean
2009-10-09 15:57                                                                                                                                                             ` Michal Suchanek
2009-10-09 16:17                                                                                                                                                               ` Bean
2009-10-09 16:29                                                                                                                                                                 ` Michal Suchanek
2009-10-09 16:48                                                                                                                                                                   ` Bean
2009-10-09 17:27                                                                                                                                                                     ` Michal Suchanek
2009-10-09 18:32                                                                                                                                                                       ` Bean
2009-10-09 20:41                                                                                                                                                                         ` Michal Suchanek
2009-10-10  3:43                                                                                                                                                                           ` Bean
2009-10-10 11:22                                                                                                                                                                             ` Michal Suchanek
2009-10-10 19:21                                                                                                                                                                               ` Bean
2009-10-10 22:54                                                                                                                                                                                 ` Michal Suchanek
2009-10-11  3:58                                                                                                                                                                                   ` Bean
2009-10-11 10:03                                                                                                                                                                                     ` Michal Suchanek
2009-10-16 20:47                                                                                                                                                                                       ` Bean
2009-10-17 20:01                                                                                                                                                                                         ` Bean
2009-10-18 17:01                                                                                                                                                                                           ` Bean
2009-10-20 14:52                                                                                                                                                                                             ` Bean
2009-10-20 19:31                                                                                                                                                                                               ` Michal Suchanek
2009-10-21  1:01                                                                                                                                                                                                 ` Peter Cros
2009-10-21  4:07                                                                                                                                                                                                 ` Bean
2009-10-21 20:55                                                                                                                                                                                                   ` Michal Suchanek
2009-10-22  3:47                                                                                                                                                                                                     ` Bean
2009-10-20 19:20                                                                                                                                                                                             ` Michal Suchanek
2009-10-21  3:45                                                                                                                                                                                               ` Bean
2009-10-21 20:47                                                                                                                                                                                                 ` Michal Suchanek
2009-10-22  4:34                                                                                                                                                                                                   ` Bean
2009-10-22  7:41                                                                                                                                                                                                     ` Michal Suchanek
2009-10-22  8:15                                                                                                                                                                                                       ` Bean
2009-10-23  5:59                                                                                                                                                                                                         ` Peter Cros
2009-10-23  7:31                                                                                                                                                                                                           ` Bean
2009-10-24  8:04                                                                                                                                                                                                             ` Peter Cros
2009-10-25 14:27                                                                                                                                                                                                               ` Peter Cros
2009-10-26 18:24                                                                                                                                                                                                                 ` Bean
2009-10-27 17:34                                                                                                                                                                                                                   ` Bean
2009-10-28 20:29                                                                                                                                                                                                                     ` Bean
2009-10-28 21:12                                                                                                                                                                                                                       ` Vladimir 'phcoder' Serbinenko
2009-10-29  3:24                                                                                                                                                                                                                         ` Bean
2009-10-29  9:10                                                                                                                                                                                                                           ` Vladimir 'phcoder' Serbinenko
2009-10-29  9:25                                                                                                                                                                                                                             ` Bean
2009-10-29  9:33                                                                                                                                                                                                                               ` Vladimir 'phcoder' Serbinenko
2009-10-29  9:52                                                                                                                                                                                                                                 ` Bean
2009-10-30 12:07                                                                                                                                                                                                                                   ` Bean
2009-11-01 17:16                                                                                                                                                                                                                                     ` Bean
2009-11-09 15:55                                                                                                                                                                                                                                       ` Bean
2009-11-09 16:16                                                                                                                                                                                                                                         ` mingw32 compile fixes (Re: [GITGRUB] New menu interface (implementation)) Robert Millan
2009-11-09 16:46                                                                                                                                                                                                                                           ` Bean
2009-11-09 20:03                                                                                                                                                                                                                                             ` Robert Millan
2009-11-10 13:51                                                                                                                                                                                                                                               ` Bean
2009-11-09 20:04                                                                                                                                                                                                                                             ` warn_unused_result attribute (Re: mingw32 compile fixes (Re: [GITGRUB] New menu interface (implementation))) Robert Millan
2009-11-09 20:10                                                                                                                                                                                                                                               ` Felix Zielcke
2009-11-09 21:07                                                                                                                                                                                                                                                 ` Robert Millan
2009-11-09 20:20                                                                                                                                                                                                                                               ` Colin Watson
2009-10-20 19:06                                                                                                                                                                                           ` [GITGRUB] New menu interface (implementation) Michal Suchanek
2009-10-21  3:21                                                                                                                                                                                             ` Bean
2009-10-09 16:56                                                                                                                                                               ` richardvoigt
2009-10-09 17:09                                                                                                                                                                 ` Michal Suchanek
2009-10-09 18:28                                                                                                                                                                   ` richardvoigt
2009-10-09 18:49                                                                                                                                                                     ` Bean
2009-10-09 20:22                                                                                                                                                                     ` Michal Suchanek
2009-10-09 15:58                                                                                                                                                             ` Bean
2009-10-08 11:18                                                                                                                                           ` Michal Suchanek
2009-10-08 13:07                                                                                                                                             ` Bean
2009-10-08 21:46                                                                                                                                               ` Michal Suchanek
2009-10-09  3:34                                                                                                                                                 ` Bean
2009-10-09 11:48                                                                                                                                                   ` Michal Suchanek
2009-10-09 12:34                                                                                                                                                     ` Bean
2009-10-06 22:59                                                                                                                             ` Michal Suchanek
2009-10-04 21:24                                                                                                 ` Michal Suchanek
2009-10-04 21:57                                                                                             ` Michal Suchanek
2009-10-05  5:01                                                                                               ` Bean
2009-10-05  9:12                                                                                                 ` Michal Suchanek
2009-10-04 12:03                                                                                         ` Peter Cros
2009-10-04 13:26                                                                                           ` Bean
2009-09-27 23:01                                                     ` Michal Suchanek
2009-09-28  2:59                                                       ` Bean
2009-09-28  9:32                                                         ` Michal Suchanek
2009-09-19 18:45 ` Michal Suchanek
2009-09-19 18:55   ` richardvoigt
2009-09-20  8:31     ` Michal Suchanek
2009-09-20 18:51       ` richardvoigt
2009-09-21  9:23         ` Michal Suchanek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca0f59980909272048m75ac1deen9d000fad5604c27d@mail.gmail.com \
    --to=bean123ch@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.