Ejemplo n.º 1
0
    def __init__(self, qpart):
        QWidget.__init__(self, qpart)
        self._qpart = qpart

        qpart.blockCountChanged.connect(self.update)

        defaultSizePixmap = QPixmap(qutepart.getIconPath('bookmark.png'))
        iconSize = self._qpart.cursorRect().height()
        self._bookmarkPixmap = defaultSizePixmap.scaled(iconSize, iconSize)
Ejemplo n.º 2
0
    def _createAction(self, widget, iconFileName, text, shortcut, slot):
        """Create QAction with given parameters and add to the widget
        """
        icon = QIcon(qutepart.getIconPath(iconFileName))
        action = QAction(icon, text, widget)
        action.setShortcut(QKeySequence(shortcut))
        action.setShortcutContext(Qt.WidgetShortcut)
        action.triggered.connect(slot)

        widget.addAction(action)

        return action
Ejemplo n.º 3
0
    def _createAction(self, widget, iconFileName, text, shortcut, slot):
        """Create QAction with given parameters and add to the widget
        """
        icon = QIcon(qutepart.getIconPath(iconFileName))
        action = QAction(icon, text, widget)
        action.setShortcut(QKeySequence(shortcut))
        action.setShortcutContext(Qt.WidgetShortcut)
        action.triggered.connect(slot)

        widget.addAction(action)

        return action
Ejemplo n.º 4
0
 def _loadIcon(self, fileName):
     defaultSizePixmap = QPixmap(qutepart.getIconPath(fileName))
     iconSize = self._qpart.cursorRect().height()
     return defaultSizePixmap.scaled(iconSize, iconSize, transformMode=Qt.SmoothTransformation)
Ejemplo n.º 5
0
 def _loadIcon(self, fileName):
     defaultSizePixmap = QPixmap(qutepart.getIconPath(fileName))
     iconSize = self._qpart.cursorRect().height()
     return defaultSizePixmap.scaled(iconSize, iconSize, transformMode=Qt.SmoothTransformation)