Example #1
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.Tool)
        self.outputEdit = OutputEdit(self)
        palette = self.outputEdit.palette()
        palette.setColor(QPalette.Base, Qt.black)
        palette.setColor(QPalette.Text, Qt.white)
        self.outputEdit.setPalette(palette)
        self.outputEdit.viewport().setCursor(Qt.ArrowCursor)
        self.wrapLinesBox = QCheckBox(self.tr("Wrap Lines"), self)
        self.wrapLinesBox.toggled.connect(self.setWordWrapEnabled)
        clearOutputButton = QPushButton(self.tr("Clear"), self)
        clearOutputButton.clicked.connect(self.outputEdit.clear)

        self.setCentralWidget(self.outputEdit)
        self.setWindowTitle(self.tr("Output"))
        statusBar = self.statusBar()
        statusBar.addWidget(self.wrapLinesBox)
        statusBar.addPermanentWidget(clearOutputButton)
        statusBar.setSizeGripEnabled(False)
        if platformSpecific.needsTighterMargins():
            margins = (7, -10, 9, -12)
        else:
            margins = (4, -1, 5, 0)
        statusBar.setContentsMargins(*margins)

        for channel in ("stdout", "stderr"):
            stream = OutputStream(channel, self)
            stream.messagePassed.connect(self.outputEdit.write)

        self.readSettings()
Example #2
0
    def __init__(self, parent=None):
        super().__init__(parent, Qt.Tool)
        self.outputEdit = OutputEdit(self)
        palette = self.outputEdit.palette()
        palette.setColor(QPalette.Base, Qt.black)
        palette.setColor(QPalette.Text, Qt.white)
        self.outputEdit.setPalette(palette)
        self.outputEdit.viewport().setCursor(Qt.ArrowCursor)
        self.wrapLinesBox = QCheckBox(self.tr("Wrap Lines"), self)
        self.wrapLinesBox.toggled.connect(self.setWordWrapEnabled)
        clearOutputButton = QPushButton(self.tr("Clear"), self)
        clearOutputButton.clicked.connect(self.outputEdit.clear)

        self.setCentralWidget(self.outputEdit)
        self.setWindowTitle(self.tr("Output"))
        statusBar = self.statusBar()
        statusBar.addWidget(self.wrapLinesBox)
        statusBar.addPermanentWidget(clearOutputButton)
        statusBar.setSizeGripEnabled(False)
        if platformSpecific.needsTighterMargins():
            margins = (7, -10, 9, -12)
        else:
            margins = (4, -1, 5, 0)
        statusBar.setContentsMargins(*margins)

        for channel in ("stdout", "stderr"):
            stream = OutputStream(channel, self)
            stream.messagePassed.connect(self.outputEdit.write)

        self.readSettings()
Example #3
0
    def __init__(self, font, parent=None):
        super().__init__(parent)
        self._font = None

        self._settingsWindow = None
        self._infoWindow = None
        self._featuresWindow = None
        self._metricsWindow = None
        self._groupsWindow = None

        self.glyphCellView = FontCellView(self)
        self.glyphCellView.glyphActivated.connect(self._glyphActivated)
        self.glyphCellView.glyphsDropped.connect(self._orderChanged)
        self.glyphCellView.selectionChanged.connect(self._selectionChanged)
        self.glyphCellView.setAcceptDrops(True)
        self.glyphCellView.setCellRepresentationName("TruFont.GlyphCell")
        self.glyphCellView.setFocus()

        self.cellSizeSlider = QSlider(Qt.Horizontal, self)
        self.cellSizeSlider.setMinimum(32)
        self.cellSizeSlider.setMaximum(116)
        self.cellSizeSlider.setFixedWidth(.9 * self.cellSizeSlider.width())
        self.cellSizeSlider.sliderReleased.connect(self.writeSettings)
        self.cellSizeSlider.valueChanged.connect(self._sliderCellSizeChanged)
        self.selectionLabel = QLabel(self)

        statusBar = self.statusBar()
        statusBar.addPermanentWidget(self.cellSizeSlider)
        statusBar.addWidget(self.selectionLabel)
        statusBar.setSizeGripEnabled(False)
        if platformSpecific.needsTighterMargins():
            margins = (6, -4, 9, -3)
        else:
            margins = (2, 0, 8, 0)
        statusBar.setContentsMargins(*margins)

        self.setFont_(font)

        app = QApplication.instance()
        app.dispatcher.addObserver(self, "_fontSaved", "fontSaved")

        self.setCentralWidget(self.glyphCellView)
        self.setWindowTitle()

        self.readSettings()
Example #4
0
    def __init__(self, parent=None):
        super().__init__(parent)
        if platformSpecific.needsTighterMargins():
            margins = (6, -10, 9, -12)
        else:
            margins = (2, -1, 5, 0)
        self.setContentsMargins(*margins)
        self.setSizeGripEnabled(False)
        self.positionLabel = ClickLabel(self)
        self.indentLabel = IndentLabel(self)
        self.clearButton = QPushButton(self.tr("Clear"), self)
        self.runButton = QPushButton(self.tr("Run"), self)

        self.addWidget(self.positionLabel)
        self.addPermanentWidget(self.indentLabel)
        self.addPermanentWidget(self.clearButton)
        self.addPermanentWidget(self.runButton)

        self.indentModified = self.indentLabel.indentModified
        self.positionClicked = self.positionLabel.clicked
        self.clearButtonClicked = self.clearButton.clicked
        self.runButtonClicked = self.runButton.clicked
Example #5
0
    def __init__(self, parent=None):
        super().__init__(parent)
        if platformSpecific.needsTighterMargins():
            margins = (6, -10, 9, -12)
        else:
            margins = (2, -1, 5, 0)
        self.setContentsMargins(*margins)
        self.setSizeGripEnabled(False)
        self.positionLabel = ClickLabel(self)
        self.indentLabel = IndentLabel(self)
        self.clearButton = QPushButton(self.tr("Clear"), self)
        self.runButton = QPushButton(self.tr("Run"), self)
        self.runButton.setShortcut("Ctrl+R")

        self.addWidget(self.positionLabel)
        self.addPermanentWidget(self.indentLabel)
        self.addPermanentWidget(self.clearButton)
        self.addPermanentWidget(self.runButton)

        self.indentModified = self.indentLabel.indentModified
        self.positionClicked = self.positionLabel.clicked
        self.clearButtonClicked = self.clearButton.clicked
        self.runButtonClicked = self.runButton.clicked