summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2010-10-11 22:18:53 +0300
committerStefan Kost <ensonic@users.sf.net>2010-10-11 22:18:53 +0300
commitcd9e6909ec4bedd8865dba80a440e4b8d6f14909 (patch)
tree65bf75f0291b0ff4086f1efadb0a5c09b441f0e9
parent86d1ec800b0fbfc2a1f3a1e3ee5ff2c81b0d98b1 (diff)
ui: align pads with the parent borders.
Gives a visual hint on pad-direction.
-rw-r--r--src/ui/main-window.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ui/main-window.c b/src/ui/main-window.c
index 08aebc0..b85bbcc 100644
--- a/src/ui/main-window.c
+++ b/src/ui/main-window.c
@@ -533,6 +533,7 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
// create/update canvas pads
arr = self->priv->pads;
+ parr = self->priv->elements;
for (i = 0; i < arr->len; i++) {
GstTLPad *item = arr->pdata[i];
gchar *s1, *s2;
@@ -542,6 +543,8 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
continue;
if ((attr = agget (item->node, "pos"))) {
+ GstTLElement *pitem = (GstTLElement *)g_ptr_array_check (parr,item->elem_ix);
+
TRACE("pos = '%s'", attr);
// split on ','
@@ -574,6 +577,17 @@ refresh_layout (GstTLMainWindow *self, GstTLRefreshMode mode)
TRACE("pad(%s): x,y,w,h = %d,%d,%d,%d", item->node->name, x,y,w,h);
+ if(pitem) {
+ /* align with element */
+ if(item->pad_dir) {
+ /* sink */
+ x = pitem->x;
+ } else {
+ /* src */
+ x = (pitem->x + pitem->w) - w;
+ }
+ }
+
if (item->ci_group) {
// update attributes
if((item->x != x) || (item->y != y) || (item->w != w) || (item->h != h)) {