Example #1
0
    def test_rect(self):
        self.assertEqual(Rect(50, 80, 100, 120), self.panel.rect)

        rect = Rect(11, 22, 33, 44)
        self.panel.rect = rect.as_tuple()
        self.assertEqual(rect, self.panel.rect)
        self.assertTrue(self.panel.layout_dirty)

        self.panel.layout_dirty = False
        self.panel.rect = rect
        self.assertFalse(self.panel.layout_dirty)
        self.panel.rect = rect.as_tuple()
        self.assertFalse(self.panel.layout_dirty)
Example #2
0
    def test_margins(self):
        self.assertEqual(Rect(17, 23, 29, 37), self.panel.margins)

        rect = Rect(11, 22, 33, 44)
        self.panel.margins = rect.as_tuple()
        self.assertEqual(rect, self.panel.margins)
        self.assertTrue(self.panel.layout_dirty)

        self.panel.layout_dirty = False
        self.panel.margins = rect
        self.assertFalse(self.panel.layout_dirty)
Example #3
0
    def test_padding(self):
        self.assertEqual(Rect(2, 3, 5, 11), self.panel.padding)

        rect = Rect(11, 22, 33, 44)
        self.panel.padding = rect.as_tuple()
        self.assertEqual(rect, self.panel.padding)
        self.assertTrue(self.panel.layout_dirty)

        self.panel.layout_dirty = False
        self.panel.padding = rect
        self.assertFalse(self.panel.layout_dirty)