~ubuntu-branches/debian/wheezy/gnome-shell/wheezy

« back to all changes in this revision

Viewing changes to src/st/st-table-child.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette, Emilio Pozuelo Monfort
  • Date: 2010-04-27 22:32:21 UTC
  • mfrom: (17.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100427223221-21af7bf7ed9mvrkj
Tags: 2.29.0-3
[ Emilio Pozuelo Monfort ]
* debian/patches/02_gjs_build_fix.patch:
  - Backport upstream commit to fix the build with recent gjs.
* debian/source/format,
  debian/patches/series,
  debian/rules:
  - Convert to source format 3.0 (quilt).
* debian/rules:
  - Include gnome-get-source.mk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "st-private.h"
26
26
#include "st-table-child.h"
27
27
#include "st-table-private.h"
 
28
#include "st-enum-types.h"
28
29
#include <st/st-widget.h>
29
30
#include <st/st-table.h>
30
31
 
96
97
      clutter_actor_queue_relayout (CLUTTER_ACTOR (table));
97
98
      break;
98
99
    case CHILD_PROP_X_ALIGN:
99
 
      child->x_align = g_value_get_double (value);
 
100
      child->x_align = g_value_get_enum (value);
100
101
      clutter_actor_queue_relayout (CLUTTER_ACTOR (table));
101
102
      break;
102
103
    case CHILD_PROP_Y_ALIGN:
103
 
      child->y_align = g_value_get_double (value);
 
104
      child->y_align = g_value_get_enum (value);
104
105
      clutter_actor_queue_relayout (CLUTTER_ACTOR (table));
105
106
      break;
106
107
    case CHILD_PROP_X_FILL:
151
152
      g_value_set_boolean (value, child->y_expand);
152
153
      break;
153
154
    case CHILD_PROP_X_ALIGN:
154
 
      g_value_set_double (value, child->x_align);
 
155
      g_value_set_enum (value, child->x_align);
155
156
      break;
156
157
    case CHILD_PROP_Y_ALIGN:
157
 
      g_value_set_double (value, child->y_align);
 
158
      g_value_set_enum (value, child->y_align);
158
159
      break;
159
160
    case CHILD_PROP_X_FILL:
160
161
      g_value_set_boolean (value, child->x_fill);
237
238
 
238
239
  g_object_class_install_property (gobject_class, CHILD_PROP_Y_EXPAND, pspec);
239
240
 
240
 
  pspec = g_param_spec_double ("x-align",
241
 
                               "X Alignment",
242
 
                               "X alignment of the widget within the cell",
243
 
                               0, 1,
244
 
                               0.5,
245
 
                               ST_PARAM_READWRITE);
 
241
  pspec = g_param_spec_enum ("x-align",
 
242
                             "X Alignment",
 
243
                             "X alignment of the widget within the cell",
 
244
                             ST_TYPE_ALIGN,
 
245
                             ST_ALIGN_MIDDLE,
 
246
                             ST_PARAM_READWRITE);
246
247
 
247
248
  g_object_class_install_property (gobject_class, CHILD_PROP_X_ALIGN, pspec);
248
249
 
249
 
  pspec = g_param_spec_double ("y-align",
250
 
                               "Y Alignment",
251
 
                               "Y alignment of the widget within the cell",
252
 
                               0, 1,
253
 
                               0.5,
254
 
                               ST_PARAM_READWRITE);
 
250
  pspec = g_param_spec_enum ("y-align",
 
251
                             "Y Alignment",
 
252
                             "Y alignment of the widget within the cell",
 
253
                             ST_TYPE_ALIGN,
 
254
                             ST_ALIGN_MIDDLE,
 
255
                             ST_PARAM_READWRITE);
255
256
 
256
257
  g_object_class_install_property (gobject_class, CHILD_PROP_Y_ALIGN, pspec);
257
258
 
291
292
  self->col_span = 1;
292
293
  self->row_span = 1;
293
294
 
294
 
  self->x_align = 0.5;
295
 
  self->y_align = 0.5;
 
295
  self->x_align = ST_ALIGN_MIDDLE;
 
296
  self->y_align = ST_ALIGN_MIDDLE;
296
297
 
297
298
  self->x_expand = TRUE;
298
299
  self->y_expand = TRUE;
637
638
 
638
639
  meta = get_child_meta (table, child);
639
640
 
640
 
  if (meta->x_align == 0.0)
641
 
    return ST_ALIGN_START;
642
 
  else if (meta->x_align == 1.0)
643
 
    return ST_ALIGN_END;
644
 
  else
645
 
    return ST_ALIGN_MIDDLE;
 
641
  return meta->x_align;
646
642
 
647
643
}
648
644
 
668
664
 
669
665
  meta = get_child_meta (table, child);
670
666
 
671
 
  switch (align)
672
 
    {
673
 
    case ST_ALIGN_START:
674
 
      meta->x_align = 0.0;
675
 
      break;
676
 
    case ST_ALIGN_MIDDLE:
677
 
      meta->x_align = 0.5;
678
 
      break;
679
 
    case ST_ALIGN_END:
680
 
      meta->x_align = 1.0;
681
 
      break;
682
 
    }
683
 
 
 
667
  meta->x_align = align;
684
668
  clutter_actor_queue_relayout (child);
685
669
}
686
670
 
704
688
 
705
689
  meta = get_child_meta (table, child);
706
690
 
707
 
  if (meta->y_align == 0.0)
708
 
    return ST_ALIGN_START;
709
 
  else if (meta->y_align == 1.0)
710
 
    return ST_ALIGN_END;
711
 
  else
712
 
    return ST_ALIGN_MIDDLE;
713
 
 
 
691
  return meta->y_align;
714
692
}
715
693
 
716
694
/**
735
713
 
736
714
  meta = get_child_meta (table, child);
737
715
 
738
 
  switch (align)
739
 
    {
740
 
    case ST_ALIGN_START:
741
 
      meta->y_align = 0.0;
742
 
      break;
743
 
    case ST_ALIGN_MIDDLE:
744
 
      meta->y_align = 0.5;
745
 
      break;
746
 
    case ST_ALIGN_END:
747
 
      meta->y_align = 1.0;
748
 
      break;
749
 
    }
750
 
 
 
716
  meta->y_align = align;
751
717
  clutter_actor_queue_relayout (child);
752
718
}
753
719