Example #1
0
    def set_prop(self, name, value):
        super(ThemeObject, self).set_prop(name, value)
        if name == 'include':
            load_skin(value)

        elif name == 'icontheme':
            osd_skin.set_icon_theme(self.icontheme)
Example #2
0
    def _load_handler(self, fxd, node):
        file_geometry = attr_str(node, 'geometry', '800x600')
        if file_geometry:
            w, h = file_geometry.split('x')
        else:
            w = config.CONF.width
            h = config.CONF.height

        self.width = int(w)
        self.height = int(h)

        self.include  = attr_str(node, 'include', '')
        if self.include:
            load_skin(self.include)

        self.icontheme = attr_str(node, 'icontheme', '')
        if self.icontheme:
            osd_skin.set_icon_theme(self.icontheme)

        for cnode in node.children:
            obj = None

            if cnode.name == 'font':
                obj = FontObject(cnode)
            elif cnode.name == 'color':
                obj = ColorObject(cnode)
            elif cnode.name == 'osd':
                obj = DialogObject(cnode)
            elif cnode.name == 'widgetstyle':
                obj = WidgetStyleObject(cnode)
            elif cnode.name == 'name':
                self.name = cnode.textof()
            elif cnode.name == 'author':
                self.email = attr_str(cnode, 'email', '')
                self.author = cnode.textof()
            elif cnode.name == 'description':
                self.description = cnode.textof()
            elif cnode.name == 'version':
                self.version = cnode.textof()

            if obj:
                self.add_child(obj)

        for child in self.children:
            if isinstance(child, WidgetStyleObject):
                child.update_widget_style()