Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsUnderlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/762986/#msg_762986
I am using 1.5M2.
I am unable to get underlined text in a Label after I change the Label's font... to be clear -- if I don't use the setFont() I do get the underline.
I created a custom variant in my CSS file:
]]>Mikhail Nefedov2011-12-08T23:04:27-00:00Re: Underlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/763109/#msg_763109
the text-decoration is currently supported only by theming. Setting the
new font will remove the decoration. If you need the decoration to be
preserved on the new set font please file an enhancement request.
Best,
Ivan
On 12/9/2011 1:04 AM, mnefedov wrote:
> Hello,
>
> I am using 1.5M2.
> I am unable to get underlined text in a Label after I change the
> Label's font... to be clear -- if I don't use the setFont() I do get
> the underline.
> I created a custom variant in my CSS file:
>
> Label.link {
> text-decoration:underline;
> }
>
> I set the custom variant on my label like this:
>
> label.setData( WidgetUtil.CUSTOM_VARIANT, "link" );
>
> Is there something I am missing?
>
> Regards,
> -mikhail.
>
>
>
>
>]]>Ivan Furnadjiev2011-12-09T07:35:18-00:00Re: Underlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/763136/#msg_763136
to work around this issue you may try to wrap the Label into a Composite
and set the font on this Composite.
HTH
Rüdiger
On 09.12.2011 08:35, Ivan Furnadjiev wrote:
> Hi mikhail,
> the text-decoration is currently supported only by theming. Setting the
> new font will remove the decoration. If you need the decoration to be
> preserved on the new set font please file an enhancement request.
> Best,
> Ivan
>
> On 12/9/2011 1:04 AM, mnefedov wrote:
>> Hello,
>>
>> I am using 1.5M2.
>> I am unable to get underlined text in a Label after I change the
>> Label's font... to be clear -- if I don't use the setFont() I do get
>> the underline.
>> I created a custom variant in my CSS file:
>>
>> Label.link {
>> text-decoration:underline;
>> }
>>
>> I set the custom variant on my label like this:
>>
>> label.setData( WidgetUtil.CUSTOM_VARIANT, "link" );
>>
>> Is there something I am missing?
>>
>> Regards,
>> -mikhail.
>>
>>
>>
>>
>>
--
Rüdiger Herrmann http://codeaffine.com]]>Rüdiger Herrmann2011-12-09T08:40:10-00:00Re: Underlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/763282/#msg_763282
I need a little more guidance on this. This is what I tried, and it didn't work:
Label label = new Label( composite, SWT.CENTER );
// NO FONT SETTING!
label.setText( a_text );
label.setData( WidgetUtil.CUSTOM_VARIANT, "link" );
// layout stuff...
Is this what you meant?
Regards,
-mikhail.]]>Mikhail Nefedov2011-12-09T13:48:29-00:00Re: Underlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/763319/#msg_763319
the Link widget? It can be used to display text with links. The links
are underlined.
Regards,
Rüdiger
On 09.12.2011 14:48, mnefedov wrote:
> I need a little more guidance on this. This is what I tried, and it
> didn't work:
>
>
> Composite composite = new Composite( parent, 0 );
> composite.setFont( a_font );
> // composite... layout stuff
>
> Label label = new Label( composite, SWT.CENTER );
> // NO FONT SETTING!
> label.setText( a_text );
> label.setData( WidgetUtil.CUSTOM_VARIANT, "link" );
> // layout stuff...
>
> Is this what you meant?
> Regards,
> -mikhail.
--
Rüdiger Herrmann http://codeaffine.com]]>Rüdiger Herrmann2011-12-09T14:56:18-00:00Re: Underlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/763335/#msg_763335
Mikhail Nefedov2011-12-09T15:35:34-00:00Re: Underlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/763438/#msg_763438
> Yes, I did try the Link widget. The problem is that it doesn't centre
> properly, and it seems the size calculations are "really" off.
Hm, lot's of dead ends. Sory for that.
Would you mind to open some bugs? One (or rather two) for centering and
wrong size calculations of the Link widget.
And then one for the text-decoration. My current thinking is that it
should be possible to specify text-decoration independently of the font
settings. Hence your initial approach should work.
- Rüdiger]]>Rüdiger Herrmann2011-12-09T19:07:30-00:00Re: Underlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/832050/#msg_832050
Link link = new Link(parent, SWT.NONE);
link.setText("<A>Click me</A>");
The link works fine but it is always underlined. How can I disable it through CSS?
I tried:
Link {
text-decoration: none;
}
but it's not working.
Thanks!]]>Ronald So2012-03-29T17:52:49-00:00Re: Underlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/832081/#msg_832081
this is currently not possible. We have a bug opened to improve the Link
widget themability:
346438: [Theming][Link] Make Link Widget more themable https://bugs.eclipse.org/bugs/show_bug.cgi?id=346438
Best,
Ivan
On 3/29/2012 8:52 PM, Ronald So wrote:
> I am using the SWT Link class to create a link in my RAP UI.
>
>
> Link link = new Link(parent, SWT.NONE);
> link.setText("<A>Click me</A>");
>
>
> The link works fine but it is always underlined. How can I disable it
> through CSS?
>
> I tried:
>
>
> Link {
> text-decoration: none;
> }
>
>
> but it's not working.
>
> Thanks!
Professional services for RAP and RCP? http://eclipsesource.com/services/rap/]]>Ivan Furnadjiev2012-03-29T18:41:21-00:00Re: Underlined text in a Label
https://www.eclipse.org/forums/index.php/mv/msg/264474/832091/#msg_832091
Ronald So2012-03-29T19:01:39-00:00