Opened 5 years ago

Closed 5 years ago

#199 closed enhancement (fixed)

Add "eliding" cut off mode for text labels

Reported by: Thore Böckelmann Owned by: Thore Böckelmann
Priority: normal Milestone: 4.0-2015R2
Component: Text.mui Version: 4.0-2015R1
Severity: minor Keywords:
Cc: OS Platform: All
Blocked By: Blocking:
Release Notes:

Description

Problem

Currently too long text labels can only just simply cut off the text to be displayed to fit into the window. Unfortunately this happens without any visual feedback to the user and the cutting process can only be recognized actively by resizing the window and seeing that additional characters occur.

Analysis

Other GUI systems (i.e. Qt) offer "eliding" which adds en ellipsis ("…") at the end of the text portion which can be displayed at most. Only after that additional dots the text is really cut off.

Enhancement recommendation

Implement this kind of cut off procedure to give the user a visual feedback about some possibly cut off text. The text should be cut off as far as necessary that at least one original character plus the "…" remains visible. If no original character can be displayed along with the "…" then the cut off process should fall back to the current simple cut off approach.

Change History (3)

comment:1 Changed 5 years ago by Jens Maus

This is really a great idea and should enhance user experience of MUI quite significantly.

One additional idea for this new feature would be to implement this feature with an additional attribute (e.g. MUIA_Text_Strip_Location) with possible values MUIA_Text_Strip_Location_Left, MUIA_Text_Strip_Location_Center, MUIA_Text_Strip_Location_Right with default to MUIA_Text_Strip_Location_Right. Using this attribute would allow to have this functionality to either strip text on the right, left or centered seeing the "…" substitution at that very position.

comment:2 Changed 5 years ago by Thore Böckelmann

Milestone: future release4.0-2015R2
Owner: set to Thore Böckelmann
Status: newassigned

comment:3 Changed 5 years ago by Thore Böckelmann

Resolution: fixed
Status: assignedclosed

In 4664:

  • mastertext.c, List.c, Text.c: implemented three additional cutoff modes for the MUIA_Text_Shorten attributes. These shorten too long texts by inserting an ellipsis ("…") either at the left side, in the middle or at the right side of the text while omitting as many characters as necessary to make the text fit into the visible area. The list class has been enhanced to make use of this new feature, but only if this is explicitly requested. The NewStuff demo demonstrates the text eliding for labels and lists. This closes #199.
Note: See TracTickets for help on using tickets.