From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N0i68-0004Sv-ME for mharc-grub-devel@gnu.org; Wed, 21 Oct 2009 16:47:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0i66-0004RY-Iy for grub-devel@gnu.org; Wed, 21 Oct 2009 16:47:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0i62-0004Mj-Pa for grub-devel@gnu.org; Wed, 21 Oct 2009 16:47:54 -0400 Received: from [199.232.76.173] (port=39736 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0i62-0004MO-JU for grub-devel@gnu.org; Wed, 21 Oct 2009 16:47:50 -0400 Received: from mail-fx0-f228.google.com ([209.85.220.228]:35727) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0i62-0004Ic-0k for grub-devel@gnu.org; Wed, 21 Oct 2009 16:47:50 -0400 Received: by fxm28 with SMTP id 28so8329988fxm.42 for ; Wed, 21 Oct 2009 13:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type:content-transfer-encoding; bh=9d4Gvm0d4eka/gaWI23KPL6AhanYmtxenS7NptDM0OI=; b=XWeyQJl2yFLYTVj9IL/8A+nhthRec/bkk2mqD5imQPVJF2jfNrSnwNwybGtuT6NcH7 +NjdFAEDPq7Z62n6XVAlHghUvbR33OD2pOqZucvwH231GBYnA+CE0m9s4O/ysmZVXd3t /EsWUV5pplndHvc4NAVm/8SYxw5S+3UWgq9SA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=Gj4GaGoXJxU7giZ9W6BQSvXuCUfFPgTJy02Hh39jBTWHQRH67r1uf7PxP2MilNKMIp gxfhtMZuWghFsqWliq0Lk9ka7wRwC0BqV3EXYlCxOAsv/utLxECQXLgoH7xvKhux2xtd 6aTvjM+SzA1Hk9hajcw2EzJb/O/CbzgbnkZ4w= MIME-Version: 1.0 Sender: hramrach@gmail.com Received: by 10.204.162.137 with SMTP id v9mr1483307bkx.60.1256158067247; Wed, 21 Oct 2009 13:47:47 -0700 (PDT) In-Reply-To: References: From: Michal Suchanek Date: Wed, 21 Oct 2009 22:47:27 +0200 X-Google-Sender-Auth: 538a0fa5c0186eed Message-ID: To: The development of GRUB 2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [GITGRUB] New menu interface (implementation) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 20:47:55 -0000 2009/10/21 Bean : > On Wed, Oct 21, 2009 at 3:20 AM, Michal Suchanek wr= ote: >> 2009/10/18 Bean : >>> Hi, >>> >>> Update: >>> >>> Add mapkey section. For example: >>> >>> mapkey { >>> =C2=A0f5 =3D ctrl-x >>> } >> >> Does this also generate a mapkey text which you can dump into a text >> box so that people know what is mapped to what (and the same for the >> default bindings and grub version/last git commit)? >> >> Wouldn't it be more practical and transparent to just make the >> mappings configurable? >> >> That is write the current mappings as key->function assignments and >> then allow change mappings / add new mappings. >> >>> >>> maps f5 key to ctrl-x, this is important for platforms like EFI as >>> ctrl-x can't be input. >>> >>> key name should be lowercase, it can be single character, f1 to f10, >>> ctrl-a to ctrl-z, left, right, up, down, home, end, delete, page_up, >>> page_down, esc, tab, backspace and space. >>> >>> Add onkey section, which allow you to assign a function when a key is >>> pressed. For example ,this is the onkey section for the demo: >>> >>> onkey { >>> =C2=A0c =3D "menu_popup term_window" >>> =C2=A0e =3D "menu_popup edit_window edit.text=3Dcommand" >>> =C2=A0f7 =3D "menu_popup layout_test" >>> =C2=A0f8 =3D menu_toggle_mode >>> =C2=A0f9 =3D halt >>> =C2=A0f10 =3D reboot >>> } >> >> This should be merged with the mapkey into a single key mapping function= . >> > > Hi, > > The difference of mapkey and onkey is when they're executed. The order > is as follows: > > mapkey > onkey function of current widget > key binding in onkey section > > For example in the edit widget, you use ctrl-x to finish current edit. > But in EFI, you can't input ctrl-x. The way to solve this is to map > another key as ctrl-x, which use mapkey function. Adding function in > onkey doesn't help, as by the time it reaches there, the edit widget > has finish handling. > > Also, if the key is used by widget, the binding in onkey doesn't help. > This is actually a good thing, for example, =C2=A0we can add hotkey c to > open a terminal window. This has effect on main menu, but we certainly > don't want it when inside term already. But if we do need to change a > key used by widget, we can map it in mapkey section. Why do you need a separate mapping? The widget either handles the key or not, and it should pass it to its parent if it does not handle it. The function in question is either a widget specific function or not so you know where it should be processed. I am not sure what is the difference in mapkey and "onkey in current widget= ". > >>> >>> c open a terminal window, e open a edit box to edit the current >>> command, use ctrl-x to save it. f7 runs the layout demo test, f8 >>> toggle between text and graphic mode, f9 shutdown, f10 reboot. >>> >>> Data binding for popup windows, for example, in the above example, >>> >>> menu_popup edit_window edit.text=3Dcommand >>> >>> property text in the edit widget in the popup dialog binds to the >>> command property of current node, this is used to implement the edit >>> function. >>> >>> Add two property attach_hcenter and attach_vcenter for layout manager. >> >> What is the actual use case for windows which are not managed in the >> layout and thus potentially overlap other windows in a system where >> window overlapping is not handled? > > Popup window. For example, the e hotkey popup a edit box to edit > current command. The top window of popup is placed in screen directly > and not controlled by layout manger. In gfxterm the edit box is fullscreen and some lines still wrap for me so I think it is the right way to handle these edits. They should get as much space as possible, there can be (and typically is) quite a bit of text. You can add the title of the edited item as a label at the top of the edit screen perhaps. > >> >>> The top widget of popup window must use absolute position, as widget >>> are already placed in screen and can't be moved without refresh. But >>> it's not easy to put the widget in the middle of screen using >>> attach_left/right/top/bottom, the new property attach_hcenter and >>> attach_vcenter defines the offset from the center of screen. >> >> Can't you just make the popup fullscreen? >> >> IMHO it rids us of quite a few things =C2=A0that allow people to shoot >> themselves in the foot and require documentation and maintenance while >> not removing anything particularly useful. > > You can configure the sub menu to pop up full screen. But I like it > alongside the parent menu. IMO, this is the most common way to display > a submenu. What's the advantage of having submenu alongside the parent menu? The disadvantage is complex, error-prone and inefficient layout algorithm. How do you handle submenus that are larger than the screen and would not fit in any case, for example. Or submenus that would just fit if there wasn't any parent menu alongside the submenu. Or submenus that are as wide/large as the screen but pop up from an item in the middle of the screen. Another disadvantage is cluttered screen. Many distributions present timezone and/or language selection as menus. These are large multilevel selections because putting all the options into one list is quite useless, you could navigate all day just to find your timezone and language. Imagine drawing these with the alongside-menu. I see no advantage. For clarity you can put the name of the parent item as a title of the menu screen so you know exactly where you are, what are your choices, and the screen is not cluttered with other inaccessible distracting rubbish. I know that submenus displayed at some random point near the menu item from which they were activated are often used in GUI toolkits but this does not make the practice good or desirable. There are many corner cases which are likely experienced on small screens (and grub may often use small resolution for compatibility) which are quite confusing. When there are multiple levels of such menus it gets very messy and it is getting hard to find a sensible placing for new submenus. It does not add to readability or anything, you still have to walk the submenus to see which options are available. An advantage of a simple menu it it can be also presented as a list of choices on a dumb terminal (see Debian reportbug as a sample of such interface or the difference between dpkg dialog and readline frontends). No need to write a separate menu for that case, new visualization should suffice. Thanks Michal