diff options
| author | Adrien Tétar | 2015-10-21 12:27:04 +0200 | 
|---|---|---|
| committer | Adrien Tétar | 2015-10-21 12:28:21 +0200 | 
| commit | 7282ab52d852815c77c6f54791aea14e2ea3e456 (patch) | |
| tree | 481811cc6d3c102e64c7550487d4056fb8fd685d /Lib/defconQt/glyphCollectionView.py | |
| parent | be72e9780959796ed0bd536edd4a34eb26f9ce35 (diff) | |
| download | trufont-7282ab52d852815c77c6f54791aea14e2ea3e456.tar.bz2 | |
glyphCollectionView: fix scroll/ptSize, fontView: fix markColor
Diffstat (limited to 'Lib/defconQt/glyphCollectionView.py')
| -rw-r--r-- | Lib/defconQt/glyphCollectionView.py | 17 | 
1 files changed, 5 insertions, 12 deletions
| diff --git a/Lib/defconQt/glyphCollectionView.py b/Lib/defconQt/glyphCollectionView.py index d7c3188..eb939a5 100644 --- a/Lib/defconQt/glyphCollectionView.py +++ b/Lib/defconQt/glyphCollectionView.py @@ -50,7 +50,7 @@ class GlyphCollectionWidget(QWidget):          super(GlyphCollectionWidget, self).__init__(parent)          self.setAttribute(Qt.WA_KeyCompression)          self._glyphs = [] -        self._squareSize = 56 +        self.squareSize = 56          self._columns = 10          self._selection = set()          self._oldSelection = None @@ -123,16 +123,6 @@ class GlyphCollectionWidget(QWidget):          index = self._lastSelectedCell          return self._glyphs[index] if index is not None else None -    def _get_squareSize(self): -        return self._squareSize - -    def _set_squareSize(self, squareSize): -        self._squareSize = squareSize -        voidFont.setPointSize(.425 * self.squareSize) - -    squareSize = property(_get_squareSize, _set_squareSize, doc="The size of" -                          "a glyph cell.") -      def scrollArea(self):          return self._scrollArea @@ -158,7 +148,9 @@ class GlyphCollectionWidget(QWidget):      def pipeDragMoveEvent(self, event):          if event.source() == self: -            pos = event.posF() +            # Get the position in scrollArea canvas coordinates (from the +            # beginning of the widget we are scrolling over) +            pos = self.mapFromParent(event.pos())              self.currentDropIndex = int(                  self._columns * (pos.y() // self.squareSize) +                  (pos.x() + .5 * self.squareSize) // self.squareSize) @@ -497,6 +489,7 @@ class GlyphCollectionWidget(QWidget):          dirtyGradient.setColorAt(1.0, cellHeaderLineColor.darker(125))          markGradient = QLinearGradient(              0, 0, 0, self.squareSize - GlyphCellHeaderHeight) +        voidFont.setPointSize(.425 * self.squareSize)          for row in range(beginRow, endRow + 1):              for column in range(beginColumn, endColumn + 1): | 
