All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: menu loop (patch)
@ 2008-07-20  6:21 chaac
  2008-07-20  8:49 ` Carles Pina i Estany
  2008-07-22 21:40 ` Robert Millan
  0 siblings, 2 replies; 19+ messages in thread
From: chaac @ 2008-07-20  6:21 UTC (permalink / raw)
  To: The development of GRUB 2

"Yoshinori K. Okuji" [okuji@enbug.org] kirjoitti: 
> On Saturday 19 July 2008 21:58:09 Robert Millan wrote:
> > On Sat, Jul 19, 2008 at 10:34:46AM -0700, Colin D Bennett wrote:
> > > [...]  We could support a setting such as "set menuwrap=1" which
> > > would enable this feature for users who care about it.
> >
> > Isn't this a bit overkill?  The time spent adding this config option vastly
> > exceeds any time that could be saved by having or not having menu wrap.
> >
> > > Actually my graphical menu currently *does* wrap around, I guess it
> > > seemed logical to me at the time I wrote the code!  8-)  As you can
> > > tell, I am not firmly set on either wrapping or not wrapping.
> >
> > Same here..  my concern with taking arbitrary decisions is, when someone
> > comes later and asks to have it reverted, do we accept the request, and
> > otherwise what rationale do we give her? :-)
> 
> Personally, I prefer no wrapping, because it is easier for me to use only 
> Up/Down arrow keys, yet locate entries easily. Since I am lazy, I don't want 
> to look for Home or End (some keyboards really suck for them!), so when I 
> just want to jump to somewhere near to the end, I only keep pushing Down, and 
> wait for the cursor to stop. And, this is consistent with Dired mode in 
> Emacs, Directory Listing in VIM, and, of course, with GRUB Legacy.

Hi All,

I also like no wrapping mode. But lets assume we have nice graphical menu with "cylinder" of menu entries that roll when you press key up/down. In here it would be really convenient to have wraparound eg. user cant event think any other way here. But this is something I would put into theme configuration file.

Theme could be also loadable for text menu that describes colours and such. We could default to non-wrapping as that has been our way for long time. If user wants to override this in theme then they are free to do so.

In every case I would prefer that home and end keys would go to always to start and to end of the list. Page up/down would rely a bit for wrapping setting so they can clamp to list edges if needed.

Thanks,
Vesa Jääskeläinen




^ permalink raw reply	[flat|nested] 19+ messages in thread
* menu loop (patch)
@ 2008-07-17 21:22 Carles Pina i Estany
  2008-07-19 15:40 ` Robert Millan
  0 siblings, 1 reply; 19+ messages in thread
From: Carles Pina i Estany @ 2008-07-17 21:22 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]


Hello,

I'm a Grub user (thanks for your nice work!) and I always wanted to have
a menu that "loops". Like, if you press down and you are in the last
option it goes to the first one, and if you press up but you are int he
first option goes to the last.

Attached comes a patch against revision 1718.

Of course, feel free to comment anything about it. I'm open to change,
fix, etc.

I also don't know if this functionality is not in Grub because you
thought that was better to not have this functionality. 

I've copied/change a few lines (after the patch, lines 425-428 are the
same than lines 347-350). I don't think that it's needed to refactor but
if you think so I can do it.

Thank you,

-- 
Carles Pina i Estany		GPG id: 0x8CBDAE64
	http://pinux.info	Manresa - Barcelona

[-- Attachment #2: menu_loop.patch --]
[-- Type: text/x-diff, Size: 835 bytes --]

Index: normal/menu.c
===================================================================
--- normal/menu.c	(revision 1717)
+++ normal/menu.c	(working copy)
@@ -420,6 +420,17 @@
 		  first--;
 		  print_entries (menu, first, offset);
 		}
+	      else if (first==0) 
+	        {
+		  // Highlight the last entry
+		  offset = menu->size - 1;
+		  if (offset > GRUB_TERM_NUM_ENTRIES - 1)
+		     {
+			first = offset - (GRUB_TERM_NUM_ENTRIES - 1);
+			offset = GRUB_TERM_NUM_ENTRIES - 1;
+		     }
+		  print_entries (menu, first, offset);
+		}
 	      break;
 	      
 	    case 14:
@@ -440,6 +451,13 @@
 		      print_entries (menu, first, offset);
 		    }
 		}
+	      else
+	        {
+			// Highlight the first entry
+			first=0;
+			offset=0;
+			print_entries (menu, first, offset);
+		}
 	      break;
 	      
 	    case '\n':

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2008-08-05  7:32 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-20  6:21 menu loop (patch) chaac
2008-07-20  8:49 ` Carles Pina i Estany
2008-07-22 21:40 ` Robert Millan
2008-08-05  7:15   ` Vesa Jääskeläinen
  -- strict thread matches above, loose matches on Subject: below --
2008-07-17 21:22 Carles Pina i Estany
2008-07-19 15:40 ` Robert Millan
2008-07-19 17:21   ` Carles Pina i Estany
2008-07-19 19:52     ` Robert Millan
2008-07-19 22:12       ` Carles Pina i Estany
2008-07-19 23:26     ` Isaac Dupree
2008-07-19 23:31       ` Carles Pina i Estany
2008-07-19 23:45         ` Isaac Dupree
2008-07-20  4:24         ` Colin D Bennett
2008-07-19 17:34   ` Colin D Bennett
2008-07-19 19:58     ` Robert Millan
2008-07-19 20:31       ` Yoshinori K. Okuji
2008-07-19 22:06     ` Carles Pina i Estany
2008-07-19 22:15       ` Robert Millan
2008-07-19 22:28       ` Colin D Bennett

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.