[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#416543: [newt] Last letter of the title is cut

On Sat, Mar 31, 2007 at 12:42:11PM +0200, Frans Pop wrote:
> > Tried to increase it to "10" with the patch below and title looks ok
> > (see attached screenshot showing trunk vs patched cdebconf)
> > Will hopefully try to understand how sizes are computed early next
> > week.
> That still does not explain exactly _why_ it needs to be 10, which makes 
> me uncomfortable. At the very least a value of 10 does not match the 
> comment above.

The problem is triggered in show_select_window() (but the same 
code for computing size of windows is duplicated in a couple of
other places) and in particular when the following function is called:

  newt_create_window(win_width, win_height, obj->title, q->priority);

Let's focus on "win_width", computed a few lines before the above call:

    t_width_title = newt_get_text_width(obj->title) + TITLE_PADDING;
    if (t_width_title > win_width)
        win_width = t_width_title;

the value is "45", which is 37 chars (lenght of the title) + 8 (value of TITLE_PADDING):

┌┤ [!] Alegerea unui aranjament de tastatur ├─┐

as reported in the BR the last letter "ă" is missing; you can also notice that the call
to newt_create_window() with a width of 45 creates a window 47 characters wide.
Forcing win_width=46 gives the following result:

┌┤ [!] Alegerea unui aranjament de tastatură ├─┐

border is still unbalanced but the title is all visible;

forcing win_width to 47 gives the 
┌─┤ [!] Alegerea unui aranjament de tastatură ├─┐

TITLE_PADDING is 8 and is currently computed counting the following chars:

6  - "┌┤ [!]"
2  - "├┐"

changing it to 10 might take into account the two space characters surrounding
the title, even if it still does not convince me completely.
One simple improvement we could add after fixing this problem, could be making
sure that the number of chararacters surrounding the title is always the same
both on the right and the left.


Attachment: signature.asc
Description: Digital signature

Reply to: