ui/ncurses: Improve update handling in nested screens
[petitboot] / ui / ncurses / nc-subset.c
index d90ed20e09881effb49a3cf35976b5ce559397a7..0faed3b1d6f1b510fdaa9872f81ab69099c8d4af 100644 (file)
@@ -62,6 +62,12 @@ struct nc_scr *subset_screen_return_scr(struct subset_screen *screen)
        return screen->return_scr;
 }
 
+void subset_screen_update(struct subset_screen *screen)
+{
+       pb_debug("Exiting subset due to update\n");
+       return screen->on_exit(screen->cui);
+}
+
 static struct subset_screen *subset_screen_from_scr(struct nc_scr *scr)
 {
        struct subset_screen *subset_screen;
@@ -144,7 +150,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 +161,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 +271,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;