[Xfce4-commits] <xfce4-panel:andrzejr/deskbar-github> tasklist-widget: changing orientations and reordering button labels in plain vertical mode.
Andrzej
noreply at xfce.org
Mon Dec 12 11:40:32 CET 2011
Updating branch refs/heads/andrzejr/deskbar-github
to 0b236e43216977b6d5f2e09c1aa917ba7707cafd (commit)
from 6a4d2c92dcacad7c53b21625319ff0e039298850 (commit)
commit 0b236e43216977b6d5f2e09c1aa917ba7707cafd
Author: Andrzej <ndrwrdck at gmail.com>
Date: Tue Nov 22 12:48:06 2011 +0900
tasklist-widget: changing orientations and reordering button labels in plain vertical mode.
plugins/tasklist/tasklist-widget.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index a1e4c78..2852227 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -352,7 +352,6 @@ static void xfce_tasklist_set_rotate_vertically (XfceTa
gboolean rotate_vertically);
-
G_DEFINE_TYPE (XfceTasklist, xfce_tasklist, GTK_TYPE_CONTAINER)
@@ -982,7 +981,10 @@ xfce_tasklist_size_allocate (GtkWidget *widget,
/* swap integers with vertical orientation */
if (!xfce_tasklist_horizontal (tasklist))
- TRANSPOSE_AREA (area);
+ {
+ TRANSPOSE_AREA (area);
+ direction_rtl = !direction_rtl;
+ }
/*panel_return_if_fail (area.height == tasklist->size);*/
/* TODO if we compare the allocation with the requisition we can
@@ -2040,13 +2042,15 @@ xfce_tasklist_child_new (XfceTasklist *tasklist)
gtk_box_pack_start (GTK_BOX (child->box), child->label, TRUE, TRUE, 0);
if (xfce_tasklist_horizontal (tasklist))
{
+ gtk_box_reorder_child (GTK_BOX (child->box), child->icon, 0);
gtk_misc_set_alignment (GTK_MISC (child->label), 0.0, 0.5);
gtk_label_set_ellipsize (GTK_LABEL (child->label), tasklist->ellipsize_mode);
}
else
{
- gtk_label_set_angle (GTK_LABEL (child->label), 270);
- gtk_misc_set_alignment (GTK_MISC (child->label), 0.50, 0.00);
+ gtk_box_reorder_child (GTK_BOX (child->box), child->icon, -1);
+ gtk_label_set_angle (GTK_LABEL (child->label), 90);
+ gtk_misc_set_alignment (GTK_MISC (child->label), 0.50, 1.00);
/* TODO can we already ellipsize here yet? */
}
@@ -3801,6 +3805,7 @@ xfce_tasklist_update_orientation (XfceTasklist *tasklist)
/* update the label */
if (horizontal)
{
+ gtk_box_reorder_child (GTK_BOX (child->box), child->icon, 0);
gtk_misc_set_alignment (GTK_MISC (child->label), 0.0, 0.5);
gtk_label_set_angle (GTK_LABEL (child->label), 0);
gtk_label_set_ellipsize (GTK_LABEL (child->label),
@@ -3808,8 +3813,9 @@ xfce_tasklist_update_orientation (XfceTasklist *tasklist)
}
else
{
- gtk_misc_set_alignment (GTK_MISC (child->label), 0.50, 0.00);
- gtk_label_set_angle (GTK_LABEL (child->label), 270);
+ gtk_box_reorder_child (GTK_BOX (child->box), child->icon, -1);
+ gtk_misc_set_alignment (GTK_MISC (child->label), 0.50, 1.00);
+ gtk_label_set_angle (GTK_LABEL (child->label), 90);
gtk_label_set_ellipsize (GTK_LABEL (child->label), PANGO_ELLIPSIZE_NONE);
}
}
More information about the Xfce4-commits
mailing list