Spec LabelModel's #font: and other styles

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Spec LabelModel's #font: and other styles

Peter Uhnak
Does it make sense to be able to specify font and similar  at Spec-level?

And not just font, also the size, color, or emphasis (which currently only emphasis is supported).

From one perspective it's handy, because I can change it at a whim, however I wonder whether this shouldn't be responsibility of some styler instead.

Text as far as I know is capable of storing styled information. This would enable to outsource the style information to someone else (e.g. your stylesheet). However from practical perspective for the end user it would be extra work as it would add an indirection step.

For TextModel that would be clearly better (because you might want to style different parts of text differently), however for LabelModel I'm not so sure.

Any opinions?

Thanks,
Peter
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-users] Spec LabelModel's #font: and other styles

jfabry

I think it is better to avoid setting absolute style info for labels, e.g. font size and color. This because system settings allow you to set, e.g. font size systemwide, and it would be ugly if suddenly some labels don’t obey. Now, what could be done is to set some attributes like ‘bigger’, ‘smaller’, et cetera, and these should then take the system settings into account.

On Oct 2, 2015, at 08:47, Peter Uhnák <[hidden email]> wrote:

Does it make sense to be able to specify font and similar  at Spec-level?

And not just font, also the size, color, or emphasis (which currently only emphasis is supported).

From one perspective it's handy, because I can change it at a whim, however I wonder whether this shouldn't be responsibility of some styler instead.

Text as far as I know is capable of storing styled information. This would enable to outsource the style information to someone else (e.g. your stylesheet). However from practical perspective for the end user it would be extra work as it would add an indirection step.

For TextModel that would be clearly better (because you might want to style different parts of text differently), however for LabelModel I'm not so sure.

Any opinions?

Thanks,
Peter



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of Chile

Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel's #font: and other styles

Skip Lentz-2
In reply to this post by Peter Uhnak

> On Oct 2, 2015, at 1:47 PM, Peter Uhnák <[hidden email]> wrote:
>
> (...)
>
> For TextModel that would be clearly better (because you might want to style different parts of text differently), however for LabelModel I'm not so sure.
>
> Any opinions?

A few days ago I wanted to style different parts of a label differently (some words bold/italic, some normal). When I passed in the
Text object to the label, it did not show the different styles. It only showed the very last one. That is, if the last style was bold, the whole
label would be in bold.

A workaround for achieving what I want is putting it in different labels. But then I need to position the text manually, even though it is supposed
to be one sentence.. (For example: ‘Comment added by _User_ around _2 seconds_ ago’)

So right now I think the label only works with one style..
Reply | Threaded
Open this post in threaded view
|

Re: Spec LabelModel's #font: and other styles

Stephan Eggermont-3
In reply to this post by Peter Uhnak
On 02-10-15 13:47, Peter Uhnák wrote:
> Does it make sense to be able to specify font and similar  at Spec-level?
>
> And not just font, also the size, color, or emphasis (which currently only
> emphasis is supported).

Yes, you want to be able to override all theme-based settings at a
widget level.

Stephan