[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
90/197: installer: Enable direct scrolling to top or bottom of menus.
From: |
Danny Milosavljevic |
Subject: |
90/197: installer: Enable direct scrolling to top or bottom of menus. |
Date: |
Mon, 3 Jul 2017 20:37:05 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit eae069f345ddc3c5e596454ec5e747ae99e859bc
Author: John Darrington <address@hidden>
Date: Thu Jan 12 16:57:38 2017 +0100
installer: Enable direct scrolling to top or bottom of menus.
* gurses/menu.scm (menu-goto-start, menu-goto-end): New procedures.
(std-menu-key-handler): connect them to Home and End keys.
---
gurses/menu.scm | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/gurses/menu.scm b/gurses/menu.scm
index 8a8f74b..1fca9bc 100644
--- a/gurses/menu.scm
+++ b/gurses/menu.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016 John Darrington <address@hidden>
+;;; Copyright © 2016, 2017 John Darrington <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -78,6 +78,19 @@
(menu-set-top-item! menu (max 0 (- (menu-top-item menu) step)))
(menu-redraw menu))
+(define (menu-goto-start menu)
+ (menu-set-top-item! menu 0)
+ (menu-set-current-item! menu 0)
+ (menu-redraw menu))
+
+(define (menu-goto-end menu)
+ (let ((n-items (length (menu-items menu)))
+ (window-height (getmaxy (menu-window menu))))
+ (menu-set-top-item! menu (max 0 (- n-items window-height)))
+ (menu-set-current-item! menu (1- n-items))
+ (menu-redraw menu)))
+
+
(define* (menu-down menu #:key (step 1))
"Move the selected item down by STEP items. Returns #f if on the last item."
(if (< (menu-current-item menu) (1- (length (menu-items menu))))
@@ -141,7 +154,13 @@
((eq? ch KEY_PPAGE)
(menu-active menu)
(menu-up menu #:step (getmaxy (menu-window menu))))
-
+
+ ((eq? ch KEY_HOME)
+ (menu-goto-start menu))
+
+ ((eq? ch KEY_END)
+ (menu-goto-end menu))
+
((or (eq? ch KEY_DOWN)
(eq? ch #\so))
(if (menu-active menu)
- 71/197: installer: Add confidence indicator., (continued)
- 71/197: installer: Add confidence indicator., Danny Milosavljevic, 2017/07/03
- 67/197: installer: Add predicate for the network task., Danny Milosavljevic, 2017/07/03
- 74/197: installer: Remove explicit calls to curs-set from pages., Danny Milosavljevic, 2017/07/03
- 64/197: installer: Make setting up of the network a prerequisite., Danny Milosavljevic, 2017/07/03
- 80/197: installer: Ignore case in button accelerators., Danny Milosavljevic, 2017/07/03
- 86/197: installer: slurp: Ignore blank lines in output., Danny Milosavljevic, 2017/07/03
- 76/197: installer: New procedure "page-leave"., Danny Milosavljevic, 2017/07/03
- 84/197: installer: Use guix build syscalls module for network interrogation., Danny Milosavljevic, 2017/07/03
- 94/197: installer: Add the notion of uuids to prospective filesystems., Danny Milosavljevic, 2017/07/03
- 89/197: installer: Make the network menu more reliable., Danny Milosavljevic, 2017/07/03
- 90/197: installer: Enable direct scrolling to top or bottom of menus.,
Danny Milosavljevic <=
- 78/197: installer: Ensure that the cursor visibility is updated on each page., Danny Milosavljevic, 2017/07/03
- 107/197: installer: Do not allow the creation of invalid file-system specificaitons., Danny Milosavljevic, 2017/07/03
- 57/197: installer: Add a console-keymap service., Danny Milosavljevic, 2017/07/03
- 69/197: installer: Remove "continue" button from host name page., Danny Milosavljevic, 2017/07/03
- 58/197: installer: Add flags to indicate network interface status., Danny Milosavljevic, 2017/07/03
- 72/197: installer: Use --fallback when installing., Danny Milosavljevic, 2017/07/03
- 73/197: installer: Correct behaviour of push-cursor and pop-cursor procedures., Danny Milosavljevic, 2017/07/03
- 77/197: installer: New procedure: page-enter., Danny Milosavljevic, 2017/07/03
- 82/197: installer: Rename 'file-browser.scm' to 'key-map.scm'., Danny Milosavljevic, 2017/07/03
- 63/197: installer: Change essid --> wireless., Danny Milosavljevic, 2017/07/03