[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/68: installer: Rewrite welcome page.
From: |
guix-commits |
Subject: |
12/68: installer: Rewrite welcome page. |
Date: |
Thu, 17 Jan 2019 08:05:10 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 113bdf6ae1819022d8c0d640b78a37c7d6b52723
Author: Mathieu Othacehe <address@hidden>
Date: Fri Nov 23 23:23:45 2018 +0900
installer: Rewrite welcome page.
The welcome page is the only page using absolute positioning for the newt
components, so that the page occupies all the screen space. This is becoming
too hard to manage, so switch to grid management like elsewhere, even if the
result is less appealing.
Also add an info text to the page with a mention on how to switch back to
the
original installer.
* gnu/installer/newt/welcome.scm (run-menu-page): Use a vertically stacked
grid instead of hard window placement.
---
gnu/installer/newt/welcome.scm | 58 ++++++++++++++++++++----------------------
1 file changed, 27 insertions(+), 31 deletions(-)
diff --git a/gnu/installer/newt/welcome.scm b/gnu/installer/newt/welcome.scm
index 8ed9f68..3a0e45e 100644
--- a/gnu/installer/newt/welcome.scm
+++ b/gnu/installer/newt/welcome.scm
@@ -26,20 +26,14 @@
#:use-module (newt)
#:export (run-welcome-page))
-;; Margin between screen border and newt root window.
-(define margin-left (make-parameter 3))
-(define margin-top (make-parameter 3))
-
;; Expected width and height for the logo.
-(define logo-width (make-parameter 50))
-(define logo-height (make-parameter 23))
+(define logo-width (make-parameter 43))
+(define logo-height (make-parameter 19))
-(define (nearest-exact-integer x)
- "Given a real number X, return the nearest exact integer, with ties going to
-the nearest exact even integer."
- (inexact->exact (round x)))
+(define info-textbox-width (make-parameter 70))
+(define options-listbox-height (make-parameter 5))
-(define* (run-menu-page title logo
+(define* (run-menu-page title info-text logo
#:key
listbox-items
listbox-item->text)
@@ -55,30 +49,27 @@ we want this page to occupy all the screen space available."
(cons key item)))
items))
- (let* ((windows
- (make-window (margin-left)
- (margin-top)
- (- (screen-columns) (* 2 (margin-left)))
- (- (screen-rows) (* 2 (margin-top)))
- title))
- (logo-textbox
- (make-textbox (nearest-exact-integer
- (- (/ (screen-columns) 2)
- (+ (/ (logo-width) 2) (margin-left))))
- (margin-top) (logo-width) (logo-height) 0))
- (text (set-textbox-text logo-textbox
- (read-all logo)))
+ (let* ((logo-textbox
+ (make-textbox -1 -1 (logo-width) (logo-height) 0))
+ (info-textbox
+ (make-reflowed-textbox -1 -1
+ info-text
+ (info-textbox-width)))
(options-listbox
- (make-listbox (margin-left)
- (+ (logo-height) (margin-top))
- (- (screen-rows) (+ (logo-height)
- (* (margin-top) 4)))
+ (make-listbox -1 -1
+ (options-listbox-height)
(logior FLAG-BORDER FLAG-RETURNEXIT)))
(keys (fill-listbox options-listbox listbox-items))
+ (grid (vertically-stacked-grid
+ GRID-ELEMENT-COMPONENT logo-textbox
+ GRID-ELEMENT-COMPONENT info-textbox
+ GRID-ELEMENT-COMPONENT options-listbox))
(form (make-form)))
- (set-listbox-width options-listbox (- (screen-columns)
- (* (margin-left) 4)))
- (add-components-to-form form logo-textbox options-listbox)
+
+ (set-textbox-text logo-textbox (read-all logo))
+
+ (add-form-to-grid grid form #t)
+ (make-wrapped-grid-window grid title)
(receive (exit-reason argument)
(run-form form)
@@ -102,6 +93,11 @@ the page. Ask the user to choose between manual
installation, graphical
installation and reboot."
(run-menu-page
(G_ "GNU GuixSD install")
+ (G_ "Welcome to GNU GuixSD installer!
+
+Please note that the present graphical installer is still under heavy \
+development, so you might want to fallback to the classical installer by \
+pressing CTRL-ALT-F3.")
logo
#:listbox-items
`((,(G_ "Install using the unguided shell based process")
- 10/68: guix: self: Do not install (gnu system install)., (continued)
- 10/68: guix: self: Do not install (gnu system install)., guix-commits, 2019/01/17
- 25/68: installer: Add services page., guix-commits, 2019/01/17
- 11/68: gnu: installer: Launch the installer as kmscon login-program., guix-commits, 2019/01/17
- 13/68: installer: Move everything to the build side., guix-commits, 2019/01/17
- 15/68: tests: Rename %test-encrypted-os to %test-encrypted-root-os., guix-commits, 2019/01/17
- 17/68: services: herd: Allow to pass arguments to start-service., guix-commits, 2019/01/17
- 19/68: gnu: Add guile-parted., guix-commits, 2019/01/17
- 16/68: build: syscalls: Add device-in-use?., guix-commits, 2019/01/17
- 18/68: gnu: guile-newt: Update to revision 4., guix-commits, 2019/01/17
- 62/68: installer: keymap: Put English layout and international variant ahead., guix-commits, 2019/01/17
- 12/68: installer: Rewrite welcome page.,
guix-commits <=
- 64/68: syscalls: 'device-in-use?' does not create a port., guix-commits, 2019/01/17
- 14/68: installer: Fix locale installation., guix-commits, 2019/01/17
- 68/68: installer: Fix manual partitioning., guix-commits, 2019/01/17
- 66/68: installer: Adjust messages on the final page., guix-commits, 2019/01/17
- 65/68: syscalls: 'device-in-use?' returns #f upon EINVAL., guix-commits, 2019/01/17
- 67/68: installer: "formating" → "formatting"., guix-commits, 2019/01/17
- 63/68: installer: partition: Add encryption password confirmation., guix-commits, 2019/01/17
- 03/68: services: kmscon: Remove virtual-terminal requirement., guix-commits, 2019/01/17
- 04/68: gnu: kmscon: Add runtime keymap update support., guix-commits, 2019/01/17
- 02/68: guile: newt: Update revision to 3., guix-commits, 2019/01/17