text alignment in label tag

Bug #134488 reported by Robert Kubík (Pastierovič)
2
Affects Status Importance Assigned to Milestone
gDesklets
In Progress
Wishlist
gDesklets Desklet Team

Bug Description

It would be good to add text alignment to "label" tag. I would like to use 'justify' for Quotes-of-the-Day desklet. Left/right alignment can be done with anchor attribute in group tag but 'justify' is not possible AFAIK.

Revision history for this message
Christian Meyer (chrisime) wrote :

We need to discuss this feature.

Changed in gdesklets:
assignee: nobody → gdesklets
status: New → Confirmed
Revision history for this message
Christian Meyer (chrisime) wrote :

IMHO,it's not a must-have for 0.36 rather for 0.36.x.
Agreed?
I don't want to hold back the beta much longer.

Changed in gdesklets:
importance: Undecided → Wishlist
Revision history for this message
Robert Kubík (Pastierovič) (just-me) wrote : Re: [Bug 134488] Re: text alignment in label tag

Christian Meyer wrote:
> IMHO,it's not a must-have for 0.36 rather for 0.36.x.
> Agreed?
> I don't want to hold back the beta much longer.
>
> ** Changed in: gdesklets
> Importance: Undecided => Wishlist
>
>
no problem

Robo

Revision history for this message
Bjoern Koch (h.humpel) wrote :

Not quite sure if you are looking for "justify" or "center", but I've just committed a first try to add an "alignment" (left, center, right) and "justify" (boolean) attribute to the label element (rev.90).
"Alignment" isn't perfect yet (no perfect clipping sometimes) but it is basically working (and needs of course a multi-lined label).
"Justify" isn't working at all (but it is there ;) ).

This should be a useful starting point for someone how knows what's going on.

Changed in gdesklets:
status: Confirmed → In Progress
Revision history for this message
Robert Kubík (Pastierovič) (just-me) wrote :

Bjoern Koch wrote:
> Not quite sure if you are looking for "justify" or "center", but I've just committed a first try to add an "alignment" (left, center, right) and "justify" (boolean) attribute to the label element (rev.90).
> "Alignment" isn't perfect yet (no perfect clipping sometimes) but it is basically working (and needs of course a multi-lined label).
> "Justify" isn't working at all (but it is there ;) ).
>
> This should be a useful starting point for someone how knows what's
> going on.
>
> ** Changed in: gdesklets
> Status: Confirmed => In Progress
>
>
As I have written I need the "justify" :) Other types of alignment can
be done another way.

BTW: What about doing a release? Christmas are over. It would be good to
bring new features to users and see if any bugs appear before
implementing new ones (either bugs or features ;)

Cheers,

Robo

Revision history for this message
Bjoern Koch (h.humpel) wrote :

OK. Just wanted to make sure ;).
Although: if I take a look at the pygtk docs things are a bit "confusing" to me.
As far as I can tell (and I may be wrong here): the label element in gDesklets is a pango.layout (which is put into a gdk.Pixmap). The pango.layout supports set_justify (boolean) and set_alignment (left, center, right) (http://www.pygtk.org/pygtk2reference/class-pangolayout.html#method-pangolayout--set-justify). This what I started to implement.
But typically alignment/justification of a text/label is handled - as you can see in gtk.Label (http://www.pygtk.org/pygtk2reference/class-gtklabel.html#method-gtklabel--set-justify) - by only one attribute: set_justify (left, center, fill, right).

gDesklets uses pango.layout for the label element. And I am wondering what happens (or should happen) when you set the attributes to "justified" and "right". This doesn't make any sense at all to me unless the "justified" is interpreted as "stretching" rather than "filling up with whitespaces".

This is the point where someone needs to lighten things up who knows what's going on and how things are meant to be done ;).

Revision history for this message
Bjoern Koch (h.humpel) wrote :

Btw:

> Other types of alignment can be done another way.
I am pretty sure that a multi-lined label can't be done anyway else, but again: I my be wrong here.

Bjoern Koch (h.humpel)
Changed in gdesklets:
milestone: none → release-of-0.36.2
Bjoern Koch (h.humpel)
Changed in gdesklets:
milestone: release-of-0.36.2 → release-of-0.36.3
Bjoern Koch (h.humpel)
Changed in gdesklets:
milestone: release-of-0.36.3 → release-of-0.36.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.