Bug 501483 - Consider deprecation of CLabel
Summary: Consider deprecation of CLabel
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on: 501482
Blocks:
  Show dependency tree
 
Reported: 2016-09-15 05:37 EDT by Mickael Istria CLA
Modified: 2018-04-11 14:26 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2016-09-15 05:37:38 EDT
+++ This bug was initially created as a clone of Bug #501482 +++

It would be worth investigating the feature gap between CLabel and regular Label, and see whether:
1. there is none, so CLabel should be deprecated
2. there is some, but some CLabel feature could properly be ported to regular Combo, so we could plan a port of feature and then deprecate CLabel
3. There is a major one, and we should document it in Javadoc

Currently, CLabel doc says

"""
 * A Label which supports aligned text and/or an image and different border styles.
 * <p>
 * If there is not enough space a CLabel uses the following strategy to fit the
 * information into the available space:
 * <pre>
 * 		ignores the indent in left align mode
 * 		ignores the image and the gap
 * 		shortens the text by replacing the center portion of the label with an ellipsis
 * 		shortens the text by removing the center portion of the label
 * </pre>
 * <p>
 * <dl>
 * <dt><b>Styles:</b>
 * <dd>LEFT, RIGHT, CENTER, SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
"""

Is it something we could also do with a regular Label?
Comment 1 Eric Williams CLA 2016-09-15 10:25:03 EDT
(In reply to Mickael Istria from comment #0)
> 
> Currently, CLabel doc says
> 
> """
>  * A Label which supports aligned text and/or an image and different border
> styles.
>  * <p>
>  * If there is not enough space a CLabel uses the following strategy to fit
> the
>  * information into the available space:
>  * <pre>
>  * 		ignores the indent in left align mode
>  * 		ignores the image and the gap
>  * 		shortens the text by replacing the center portion of the label with an
> ellipsis
>  * 		shortens the text by removing the center portion of the label
>  * </pre>
>  * <p>
>  * <dl>
>  * <dt><b>Styles:</b>
>  * <dd>LEFT, RIGHT, CENTER, SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
> """
> 
> Is it something we could also do with a regular Label?

I believe this functionality is supported in GTK3, both with a regular GtkLabel, and with GtkBox + GtkLabel/GtkImage/whatever. We had to do a similar thing with menus, where instead of using GtkImageMenuItem we used a GtkBox stuffed with a GtkMenuItem + GtkImage/checkboxes/whatever.

Generally I'm in favor of this idea since non-native GTK widgets (CLabel, CCombo, StyledText, etc.) are composed solely of SwtFixed, which can be a headache to debug.