~glitter-team/glitter/trunk

« back to all changes in this revision

Viewing changes to glitter/container.py

bliss

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
            elif key == 'h-offset':
72
72
                self.h_offset = value
73
73
            elif key == 'v-offset':
74
 
                self.V_offset = value
 
74
                self.v_offset = value
75
75
                
76
76
    def _update_layout(self):
77
77
        """ Updates layout """
121
121
            else:
122
122
                tmp_y = m_y
123
123
            
124
 
            tmp_x = float(tmp_x)
125
 
            tmp_y = float(tmp_y)
 
124
            tmp_x = int(tmp_x)
 
125
            tmp_y = int(tmp_y)
126
126
            
127
 
            self.set_positionu(tmp_x, tmp_y)
 
127
            self.set_position(tmp_x, tmp_y)
128
128
        
129
129
    def get_natural_width(self):
130
130
        """ Retrieve natural width """
303
303
        value -- (float) offset as a factor of parent width
304
304
        """
305
305
        
 
306
        self._h_offset = value
306
307
        self.natural_x = value
307
308
        self.natural_width = 1.0 - 2 * value
308
309
        
311
312
    def get_v_offset(self):
312
313
        """ Retrieve vertical offset """
313
314
        
314
 
        return self._h_offset
 
315
        return self._v_offset
315
316
        
316
317
    def set_v_offset(self, value):
317
318
        """ Sets vertical offset. Overwrites values for natural y and height. 
319
320
        value -- (float) offset as a factor of parent height
320
321
        """
321
322
 
 
323
        self._v_offset = value
322
324
        self.natural_y = value
323
 
        self.natural_height = 1.0 - 2 * value
 
325
        if self.natural_height > 0: 
 
326
            self.natural_height = self.natural_height - 2 * value
324
327
        
325
328
    v_offset = property(get_v_offset, set_v_offset)
326
329