grub-devel
[Top][All Lists]
Advanced

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

Re: [GITGRUB] New menu interface (implementation)


From: Michal Suchanek
Subject: Re: [GITGRUB] New menu interface (implementation)
Date: Tue, 20 Oct 2009 21:31:52 +0200

2009/10/20 Bean <address@hidden>:
> Hi,
>
> Update:
>
> Add dialog support, it allows you to write a template and call it with
> different parameters, for example:
>
> dialog_edit {
>  panel {
>    parameters = "text=edit.text"
>    class = frame
>    width = 80%
>    attach_hcenter = 0
>    attach_vcenter = 0
>
>    edit {
>      lines = 10
>    }
>  }
> }

I can see this used for the edit boxen and text mesasge dialogs which
would be quite similar.

Also the templating seems quite flexible and versatile.

However, can't this be done with a shell function?

Both the grub.d scripts and grub.cfg can define a function with a few
parameters to achieve pretty much the same results.

IIRC one of the sample menu.cfg files defined functions as part of
grub configuration so we do not need another facility for this.

>
> The parameters property control the mapping between parameter and
> internal property name. To use it to edit current command:
>
> menu_edit dialog_edit text=command
>
> It also allows you to edit other properties, for example, the demo add
> a hotkey t to edit the title:
>
> t = "menu_edit dialog_edit text=title\nmenu_refresh"
>
> The generated menu also uses templates, one for submenu, and one for menuitem:
>
> menu_template {
>  panel {
>    class = frame
>  }
> }
>
> item_template {
>  panel {
>    parameters = "class=image.class:title=text.text"
>    class = select
>    image {}
>    text {}
>  }
> }
>
> The names of the template is passed to menu_create command:
>
> menu_create menu_template item_template.
>
> Smart popup window. The sub menu would pop to the direction with the
> most space, which would make sure it won't be truncated by the border.

It won't. You cannot know how much space the "most space" is.

> For example, if the parent menu is at the top of screen, sub menu pops
> at the bottom, if it's at the bottom, sub menu pops at the top.
>
> add command menu_next_node, menu_prev_node, menu_next_anchor and
> menu_prev_anchor, you can assign these to other keys. The demo adds
> the two terminal example. Inside terminal, direction key and TAB are
> all used, so you need to assign another hotkey to switch between the
> two window. The demo uses f6:
>
> f6 = menu_next_anchor

This is an interesting addition but I'm not sure where this would be used.

Normally one terminal is enough so you can just open it fullscreen and
close it when you want to do something else.

Thanks

Michal




reply via email to

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