← Back to team overview

dbusmenu-list team mailing list archive

Re: Adding a label property to StatusNotifierItem

 

On 18/05/2010 16:36, Marco Martin wrote:
> On Tuesday 18 May 2010, Aurélien Gâteau wrote:
>> On 18/05/2010 16:04, Marco Martin wrote:
>>> On Tuesday 18 May 2010, Aurélien Gâteau wrote:

>>> i did think about it back then, but
>>> I'm not sure about that, because it would require said text to be very
>>> short, 2-3 letters max
>>> this way it would put a bond on what the visualization is
>>> also it can really open a can of worms mixing text and  icons in general,
>>> because in this way you have to do an assumption on what color the icon
>>> is, what size it is, and where the text will be put over the icon
>>
>> The thing is: it does not have to be painted over the icon. It's up to
>> the visualisation to decide this. There is no reason why the text
>> shouldn't be displayed on the right of the item for example (or is there
>> a reason and I just missed it?).
>>
>> On the other hand if the visualisation wants to paint the label over the
>> icon, it can do things like painting a border around the text to ensure
>> it remains readable. Again, this will ensure a more consistent look than
>> having each application paint the text itself.
>>
>> Aurélien
> this is true, hmm
> how you would do it in our visualization?
> maybe an opaque rectangle over the icon of plasma background color and text 
> over it of plasma text color?

I would leave this decision up to Nuno :)

> fact is, i would keep our systray with as square icons as possible, without 
> long side labels, so with just maybe 4 character max and the rest of the text 
> in the tooltip if it doesn't fit?

Arbitrarily cropping to 4 characters does not sound good to me. I can
see two ways to handle lengthy text:

# The simple way

Show the text if it's less than 5 characters, otherwise move all the
text to the tooltip and show an indicator that there is more text to
read. Something like "...".

# The more complicated way

We could make it possible for applications to provide more information
about the text, so that the visualization can take a more informed decision.

Here is my crazy idea:
- Turn the Label into a variant which can be either a string or an int.
- Provide a LabelType property which would be an enum describing the
type of label. Possible values could be "text", "count", "percent".

We could even go further and replace "text" with "text-squeeze-right",
"text-squeeze-left" and "text-squeeze-middle", making it possible for
the application to tell the visualization what the best way to squeeze
the text would be.

What do you think?
Aurélien



References