ui/ncurses: Resize & adjust OK/Help/Cancel buttons
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Fri, 4 Sep 2015 05:47:42 +0000 (15:47 +1000)
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Mon, 7 Sep 2015 06:55:46 +0000 (16:55 +1000)
The localisation of 'OK' is cut short in a few languages by a character
or two - adjust the buttons in each affected screen slightly to
accommodate.

Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
ui/ncurses/nc-add-url.c
ui/ncurses/nc-boot-editor.c
ui/ncurses/nc-config.c
ui/ncurses/nc-lang.c

index cf55b03a104df725fcb9c2207c816cda87df1b5a..451b05014cc2a752659fe43fce6a619d79bfac2c 100644 (file)
@@ -194,9 +194,9 @@ static void add_url_screen_layout_widgets(struct add_url_screen *screen)
        widget_move(widget_button_base(screen->widgets.ok_b),
                y, screen->field_x);
        widget_move(widget_button_base(screen->widgets.help_b),
-               y, screen->field_x + 10);
+               y, screen->field_x + 14);
        widget_move(widget_button_base(screen->widgets.cancel_b),
-               y, screen->field_x + 24);
+               y, screen->field_x + 28);
 }
 
 static void add_url_screen_setup_widgets(struct add_url_screen *screen)
@@ -210,7 +210,7 @@ static void add_url_screen_setup_widgets(struct add_url_screen *screen)
                        _("Configuration URL:"));
        screen->widgets.url_f = widget_new_textbox(set, 0, 0, 50, NULL);
 
-       screen->widgets.ok_b = widget_new_button(set, 0, 0, 6, _("OK"),
+       screen->widgets.ok_b = widget_new_button(set, 0, 0, 10, _("OK"),
                        ok_click, screen);
        screen->widgets.help_b = widget_new_button(set, 0, 0, 10, _("Help"),
                        help_click, screen);
index f55fe4ad649854e08018e35d9274f4ad067c9e29..e2357f9b4623e556e15830c6ce5206c52c4aad88 100644 (file)
@@ -317,9 +317,12 @@ static void boot_editor_layout_widgets(struct boot_editor *boot_editor)
 
 
        y++;
-       widget_move(widget_button_base(boot_editor->widgets.ok_b), y, 9);
-       widget_move(widget_button_base(boot_editor->widgets.help_b), y, 19);
-       widget_move(widget_button_base(boot_editor->widgets.cancel_b), y, 33);
+       widget_move(widget_button_base(boot_editor->widgets.ok_b), y,
+                   boot_editor->field_x);
+       widget_move(widget_button_base(boot_editor->widgets.help_b), y,
+                   boot_editor->field_x + 14);
+       widget_move(widget_button_base(boot_editor->widgets.cancel_b), y,
+                   boot_editor->field_x + 28);
 }
 
 static void boot_editor_widget_focus(struct nc_widget *widget, void *arg)
@@ -490,7 +493,7 @@ static void boot_editor_setup_widgets(struct boot_editor *boot_editor,
        boot_editor->widgets.args_f = widget_new_textbox(set, 0, 0,
                                        field_size, boot_editor->args);
 
-       boot_editor->widgets.ok_b = widget_new_button(set, 0, 0, 6,
+       boot_editor->widgets.ok_b = widget_new_button(set, 0, 0, 10,
                                        _("OK"), ok_click, boot_editor);
        boot_editor->widgets.help_b = widget_new_button(set, 0, 0, 10,
                                        _("Help"), help_click, boot_editor);
index f7c6b8c4b1cc11cfee9d975590906b4e55edeb19..aba3f99a84390932faebcf195736a5c0af499480 100644 (file)
@@ -557,9 +557,9 @@ static void config_screen_layout_widgets(struct config_screen *screen)
        widget_move(widget_button_base(screen->widgets.ok_b),
                        y, screen->field_x);
        widget_move(widget_button_base(screen->widgets.help_b),
-                       y, screen->field_x + 10);
+                       y, screen->field_x + 14);
        widget_move(widget_button_base(screen->widgets.cancel_b),
-                       y, screen->field_x + 24);
+                       y, screen->field_x + 28);
 }
 
 static void config_screen_network_change(void *arg, int value)
@@ -926,7 +926,7 @@ static void config_screen_setup_widgets(struct config_screen *screen,
                                _("Allow bootloader scripts to modify disks"),
                                config->allow_writes);
 
-       screen->widgets.ok_b = widget_new_button(set, 0, 0, 6, _("OK"),
+       screen->widgets.ok_b = widget_new_button(set, 0, 0, 10, _("OK"),
                        ok_click, screen);
        screen->widgets.help_b = widget_new_button(set, 0, 0, 10, _("Help"),
                        help_click, screen);
index 0b871566aa83fbeda61e02da393f6fb204be36ed..3d86659cd44e9897cf9100de60b715fee6da85eb 100644 (file)
@@ -229,7 +229,7 @@ static void lang_screen_layout_widgets(struct lang_screen *screen)
        widget_move(widget_button_base(screen->widgets.ok_b),
                        y, screen->field_x);
        widget_move(widget_button_base(screen->widgets.cancel_b),
-                       y, screen->field_x + 10);
+                       y, screen->field_x + 14);
 }
 
 static void lang_screen_setup_empty(struct lang_screen *screen)
@@ -286,7 +286,7 @@ static void lang_screen_setup_widgets(struct lang_screen *screen,
                screen->widgets.safe_mode = widget_new_label(set, 0, 0,
                         _("Selecting 'OK' will exit safe mode"));
 
-       screen->widgets.ok_b = widget_new_button(set, 0, 0, 6, _("OK"),
+       screen->widgets.ok_b = widget_new_button(set, 0, 0, 10, _("OK"),
                        ok_click, screen);
        screen->widgets.cancel_b = widget_new_button(set, 0, 0, 10, _("Cancel"),
                        cancel_click, screen);