Beispiel #1
0
class CssPanel(FocusProxy):
    def __init__(self, parent, panel):
        self.parent = parent
        self.panel = panel
        filename = panel.tree.currentPage.path + '/__page.css'
        self.editor = WinterEditor(parent, filename, lexer='CSS')
        self.editor.onSave = lambda: self.onSave()
        self.editor.tb.hide()
        #            self.editor.editor.setLexer()
        FocusProxy.__init__(self, self.editor)
        l = QVBoxLayout()
        l.addWidget(self.editor)
        self.setLayout(l)

    def onShow(self):
        self.editor.open(self.panel.tree.currentPage.path + '/__page.css')

    def onSave(self):
        self.parent.statusBar.showMessage('Style for %s saved' % self.panel.tree.currentPage.title)
        self.panel.view.js('reloadStylesheets()')