summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2015-06-26 12:06:33 +0800
committerJeremy Kerr <jk@ozlabs.org>2015-06-26 12:06:33 +0800
commitf0ab23af1b0758b6ff984ba26a2cd7dbf25ea775 (patch)
treec0f9249d4e880869c1223eba81edf021393a3217 /ui
parent757d3ed67988099a279fa4f05f07ace8bb3f7596 (diff)
downloadtalos-petitboot-f0ab23af1b0758b6ff984ba26a2cd7dbf25ea775.tar.gz
talos-petitboot-f0ab23af1b0758b6ff984ba26a2cd7dbf25ea775.zip
ui/ncurses: Layout tweaks for boot order interface
This change implements a few minor tweaks for the bootorder layout interface: - make the verical spacing of widgets more consistent (we have a couple of 3-line gaps) - use a consistent 2-space gap between buttons on the same line - clarify the title text for the subset widget instance, and move the select widget closer to the title - use consistent title-case for widget labels - left-align the select & button widgets on the subset screen, for consistency with other screens Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/ncurses/nc-config.c22
-rw-r--r--ui/ncurses/nc-subset.c10
2 files changed, 16 insertions, 16 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index 911559d..76ede39 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -383,11 +383,11 @@ static void config_screen_layout_widgets(struct config_screen *screen)
bool show;
y = 1;
+ /* currently, the longest label we have is the DNS-servers
+ * widget, so layout our screen based on that */
help_x = screen->field_x + 2 +
widget_width(widget_textbox_base(screen->widgets.dns_f));
- y += 1;
-
wl = widget_label_base(screen->widgets.boot_order_l);
widget_set_visible(wl, true);
widget_move(wl, y, screen->label_x);
@@ -412,9 +412,9 @@ static void config_screen_layout_widgets(struct config_screen *screen)
widget_move(widget_button_base(screen->widgets.boot_add_b),
y, screen->field_x);
widget_move(widget_button_base(screen->widgets.boot_any_b),
- y, screen->field_x + 12);
+ y, screen->field_x + 14);
widget_move(widget_button_base(screen->widgets.boot_none_b),
- y, screen->field_x + 30);
+ y, screen->field_x + 34);
wf = widget_button_base(screen->widgets.boot_add_b);
if (widget_subset_n_inactive(screen->widgets.boot_order_f))
@@ -453,7 +453,7 @@ static void config_screen_layout_widgets(struct config_screen *screen)
y += 1;
}
- y += 2;
+ y += 1;
y += layout_pair(screen, y, screen->widgets.network_l,
widget_select_base(screen->widgets.network_f));
@@ -571,7 +571,7 @@ static void config_screen_add_device(void *arg)
struct config_screen *screen = arg;
screen->show_subset = true;
- cui_show_subset(screen->cui, _("Select an option"),
+ cui_show_subset(screen->cui, _("Select a boot device to add"),
screen->widgets.boot_order_f);
}
@@ -704,19 +704,19 @@ static void config_screen_setup_widgets(struct config_screen *screen,
ifcfg = first_active_interface(config);
screen->widgets.boot_add_b = widget_new_button(set, 0, 0, 10,
- _("Add Device"), config_screen_add_device,
- screen);
+ _("Add Device"),
+ config_screen_add_device, screen);
screen->widgets.boot_none_b = widget_new_button(set, 0, 0, 10,
_("Clear"),
config_screen_autoboot_none, screen);
screen->widgets.boot_any_b = widget_new_button(set, 0, 0, 16,
- _("Clear & Boot Any"), config_screen_autoboot_any,
- screen);
+ _("Clear & Boot Any"),
+ config_screen_autoboot_any, screen);
screen->widgets.boot_order_l = widget_new_label(set, 0, 0,
- _("Boot order:"));
+ _("Boot Order:"));
screen->widgets.boot_order_f = widget_new_subset(set, 0, 0,
COLS - screen->field_x,
config_screen_update_subset);
diff --git a/ui/ncurses/nc-subset.c b/ui/ncurses/nc-subset.c
index d90ed20..f38e394 100644
--- a/ui/ncurses/nc-subset.c
+++ b/ui/ncurses/nc-subset.c
@@ -144,7 +144,7 @@ static void cancel_click(void *arg)
static void subset_screen_layout_widgets(struct subset_screen *screen)
{
- int y = 2;
+ int y = 1;
/* select */
widget_move(widget_select_base(screen->widgets.options_f),
@@ -155,9 +155,9 @@ static void subset_screen_layout_widgets(struct subset_screen *screen)
y += 1;
widget_move(widget_button_base(screen->widgets.ok_b),
- y, screen->field_x + 12);
+ y, screen->field_x);
widget_move(widget_button_base(screen->widgets.cancel_b),
- y, screen->field_x + 24);
+ y, screen->field_x + 14);
}
static void subset_screen_option_select(void *arg, int value)
@@ -265,8 +265,8 @@ struct subset_screen *subset_screen_init(struct cui *cui,
screen->cui = cui;
screen->on_exit = on_exit;
screen->options = (struct nc_widget_subset *) subset;
- screen->label_x = 2;
- screen->field_x = 22;
+ screen->label_x = 8;
+ screen->field_x = 8;
screen->return_scr = current_scr;
OpenPOWER on IntegriCloud