summaryrefslogtreecommitdiffstats
path: root/ui/ncurses
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-09-04 15:47:42 +1000
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-09-07 16:55:46 +1000
commitf84a33d3b924b3fff999826e4bf86d64067728b2 (patch)
tree4dc35ce6dc120569fa2185fa8d2ea80f7a5a47aa /ui/ncurses
parentb4d338c2ae40f16091a4bb4a0cc4f2e322f4f4b9 (diff)
downloadpetitboot-f84a33d3b924b3fff999826e4bf86d64067728b2.zip
petitboot-f84a33d3b924b3fff999826e4bf86d64067728b2.tar.gz
ui/ncurses: Resize & adjust OK/Help/Cancel buttons
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>
Diffstat (limited to 'ui/ncurses')
-rw-r--r--ui/ncurses/nc-add-url.c6
-rw-r--r--ui/ncurses/nc-boot-editor.c11
-rw-r--r--ui/ncurses/nc-config.c6
-rw-r--r--ui/ncurses/nc-lang.c4
4 files changed, 15 insertions, 12 deletions
diff --git a/ui/ncurses/nc-add-url.c b/ui/ncurses/nc-add-url.c
index cf55b03..451b050 100644
--- a/ui/ncurses/nc-add-url.c
+++ b/ui/ncurses/nc-add-url.c
@@ -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);
diff --git a/ui/ncurses/nc-boot-editor.c b/ui/ncurses/nc-boot-editor.c
index f55fe4a..e2357f9 100644
--- a/ui/ncurses/nc-boot-editor.c
+++ b/ui/ncurses/nc-boot-editor.c
@@ -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);
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index f7c6b8c..aba3f99 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -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);
diff --git a/ui/ncurses/nc-lang.c b/ui/ncurses/nc-lang.c
index 0b87156..3d86659 100644
--- a/ui/ncurses/nc-lang.c
+++ b/ui/ncurses/nc-lang.c
@@ -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);
OpenPOWER on IntegriCloud