From a437ed5d528d2304f52993e69d095dbedd17fdcc Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 27 Sep 2009 20:39:40 +0400 Subject: [PATCH] Ticket #1560: fixed button locations in editor search dialog. Signed-off-by: Andrew Borodin --- edit/editcmd_dialogs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/edit/editcmd_dialogs.c b/edit/editcmd_dialogs.c index 48f07fcbc..06da30045 100644 --- a/edit/editcmd_dialogs.c +++ b/edit/editcmd_dialogs.c @@ -239,10 +239,10 @@ editcmd_dialog_search_show (WEdit * edit, char **search_text) b0_len = str_term_width1 (quick_widgets[0].u.button.text) + 3; b1_len = str_term_width1 (quick_widgets[1].u.button.text) + 3; b2_len = str_term_width1 (quick_widgets[2].u.button.text) + 5; /* default button */ - len = b0_len + b1_len + b2_len + 6 + button_gap * 2; + len = b0_len + b1_len + b2_len + button_gap * 2; /* dialog width */ - Quick_input.xlen = max (SEARCH_DLG_WIDTH, max (dlg_width, len)); + Quick_input.xlen = max (SEARCH_DLG_WIDTH, max (dlg_width, len + 6)); /* correct widget coordinates */ for (i = 0; i < sizeof (quick_widgets)/sizeof (quick_widgets[0]); i++) @@ -254,9 +254,9 @@ editcmd_dialog_search_show (WEdit * edit, char **search_text) /* input length */ quick_widgets[last_checkbox + 2].u.input.len = Quick_input.xlen - 6; /* button positions */ - quick_widgets[1].relative_x = Quick_input.xlen/2 - b1_len/2; - quick_widgets[2].relative_x = quick_widgets[1].relative_x - button_gap - b2_len; - quick_widgets[0].relative_x = quick_widgets[1].relative_x + button_gap + b1_len; + quick_widgets[2].relative_x = Quick_input.xlen/2 - len/2; + quick_widgets[1].relative_x = quick_widgets[2].relative_x + b2_len + button_gap; + quick_widgets[0].relative_x = quick_widgets[1].relative_x + b1_len + button_gap; } dialog_result = quick_dialog (&Quick_input);