From: Michael Tremer Date: Thu, 21 Aug 2014 18:32:58 +0000 (+0200) Subject: installer: Sanitize button positions X-Git-Tag: v2.17-core87~103^2~51^2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a996d39fb64b7176fba1bfb0a3e85d9d77e75223;p=ipfire-2.x.git installer: Sanitize button positions --- diff --git a/src/installer/main.c b/src/installer/main.c index 445426a469..b938d994da 100644 --- a/src/installer/main.c +++ b/src/installer/main.c @@ -111,8 +111,11 @@ static int newtWinOkCancel(const char* title, const char* message, int width, in newtTextboxSetText(textbox, message); newtFormAddComponent(form, textbox); - newtComponent btn_ok = newtButton((width - 16) / 3, height - 4, btn_txt_ok); - newtComponent btn_cancel = newtButton((width - 16) / 3 * 2 + 9, height - 4, + unsigned int btn_width_ok = strlen(btn_txt_ok); + unsigned int btn_width_cancel = strlen(btn_txt_cancel); + + newtComponent btn_ok = newtButton((width / 3) - (btn_width_ok / 2) - 2, height - 4, btn_txt_ok); + newtComponent btn_cancel = newtButton((width * 2 / 3) - (btn_width_cancel / 2) - 2, height - 4, btn_txt_cancel); newtFormAddComponents(form, btn_ok, btn_cancel, NULL);