Add support for CSS styles

This commit is contained in:
James Westman 2021-10-23 00:59:10 -05:00
parent 75a05fe5ce
commit bef92f2879
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
4 changed files with 73 additions and 2 deletions

View file

@ -45,6 +45,7 @@ class TestParser(unittest.TestCase):
}
Label {
style "dim-label", "my-class";
label: "Text";
notify::visible => on_notify_visible();
}
@ -109,3 +110,7 @@ class TestParser(unittest.TestCase):
self.assertEqual(signal.handler, "on_notify_visible")
self.assertEqual(signal.detail_name, "visible")
self.assertFalse(signal.swapped)
self.assertEqual(len(obj.object_content.style), 1)
style = obj.object_content.style[0]
self.assertEqual(len(style.style_classes), 2)
self.assertEqual([s.name for s in style.style_classes], ["dim-label", "my-class"])