2013/3/2 Jason Heeris <[email protected]>:
> I've been trying to vertically align components in an St.BoxLayout
> (with vertical = false), but nothing I do seems to have any affect.
> I've tried setting 'vertical-align' in the CSS for a component, and
> setting y_align and y_expand on both the components and the BoxLayout.
> The components always end up aligned along the top edge of the
> BoxLayout.
CSS vertical-align is not implemented, and StBoxLayout doesn't use the
standard [xy]_align and [xy]_expand properties.
Instead, it uses [xy]_align and [xy]_fill child properties, that you
can set with .add(actor, { y_align: St.Align.MIDDLE }).
Alternatively, you can use a regular StWidget and set a
ClutterBoxLayout layout manager. That would honor the align and expand
properties on the actor.
> How can I vertically centre components? Or better yet, can I align
> text-based components (eg. labels and text fields) along the text
> baseline?
Unfortunately, baseline alignment is not implemented anywhere in the
gnome libraries. See
https://mail.gnome.org/archives/gtk-devel-list/2013-February/msg00130.html
for a discussion of implementing it in gtk+, but it'll take time
before its copied to St as well.
Giovanni
_______________________________________________
gnome-shell-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gnome-shell-list