diff options
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/defconQt/fontView.py | 5 | ||||
| -rw-r--r-- | Lib/defconQt/glyphCollectionView.py | 24 | ||||
| -rw-r--r-- | Lib/defconQt/groupsView.py | 5 | ||||
| -rw-r--r-- | Lib/defconQt/resources/defaultColor.svg | 31 |
4 files changed, 37 insertions, 28 deletions
diff --git a/Lib/defconQt/fontView.py b/Lib/defconQt/fontView.py index c3849d3..02656f8 100644 --- a/Lib/defconQt/fontView.py +++ b/Lib/defconQt/fontView.py @@ -468,6 +468,9 @@ class SortDialog(QDialog): self.setWindowTitle("Sort…") self.smartSortBox = QRadioButton("Smart sort", self) + self.smartSortBox.setToolTip("A combination of simple, complex and " + "custom sorts that give optimized " + "ordering results.") self.glyphSetBox = QRadioButton("Glyph set", self) self.glyphSetBox.toggled.connect(self.glyphSetToggle) self.glyphSetDrop = QComboBox(self) @@ -1022,7 +1025,7 @@ class MainWindow(QMainWindow): for key in self.collectionWidget.selection: glyph = glyphs[key] glyph.markColor = Color( - color.getRgbF() if color is not None else None) + color.getRgbF()) if color is not None else None def _fontChanged(self, notification): self.collectionWidget.update() diff --git a/Lib/defconQt/glyphCollectionView.py b/Lib/defconQt/glyphCollectionView.py index d7c3188..795ac08 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 @@ -157,11 +147,12 @@ class GlyphCollectionWidget(QWidget): event.acceptProposedAction() def pipeDragMoveEvent(self, event): - if event.source() == self: - pos = event.posF() - self.currentDropIndex = int( - self._columns * (pos.y() // self.squareSize) + - (pos.x() + .5 * self.squareSize) // self.squareSize) + # 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) def pipeDragLeaveEvent(self, event): self.currentDropIndex = None @@ -497,6 +488,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): diff --git a/Lib/defconQt/groupsView.py b/Lib/defconQt/groupsView.py index d52a0c5..3a4f959 100644 --- a/Lib/defconQt/groupsView.py +++ b/Lib/defconQt/groupsView.py @@ -131,6 +131,7 @@ class GroupCollectionWidget(GlyphCollectionWidget): super(GroupCollectionWidget, self).pipeDropEvent(event) elif self.characterDropCallback is not None: self.characterDropCallback(event) + self.currentDropIndex = None class GroupsWindow(QWidget): @@ -275,7 +276,9 @@ class GroupsWindow(QWidget): # Due to defcon limitations, we must fetch and update for the # notification to pass through currentGroupList = self.font.groups[currentGroup] - currentGroupList.append(gName) + # TODO: decouple better + index = self.collectionWidget.currentDropIndex + currentGroupList.insert(index, gName) self.font.groups[currentGroup] = currentGroupList event.acceptProposedAction() self._groupChanged() diff --git a/Lib/defconQt/resources/defaultColor.svg b/Lib/defconQt/resources/defaultColor.svg index 0c343cb..2c69bd1 100644 --- a/Lib/defconQt/resources/defaultColor.svg +++ b/Lib/defconQt/resources/defaultColor.svg @@ -5,6 +5,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" @@ -12,7 +13,7 @@ height="24" viewBox="0 0 24 24" id="svg2" - inkscape:version="0.91 r13725" + inkscape:version="0.91+devel r" sodipodi:docname="defaultColor.svg"> <metadata id="metadata10"> @@ -37,15 +38,15 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1920" - inkscape:window-height="1171" + inkscape:window-width="1358" + inkscape:window-height="698" id="namedview6" showgrid="false" - inkscape:zoom="13.906433" - inkscape:cx="11.775211" - inkscape:cy="7.2423214" + inkscape:zoom="6.9532165" + inkscape:cx="-6.3150787" + inkscape:cy="0.5417927" inkscape:window-x="0" - inkscape:window-y="2" + inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="svg2" /> <rect @@ -55,8 +56,18 @@ height="24" x="0" y="0" /> + <use + x="0" + y="0" + xlink:href="#path3616" + id="use3707" + transform="matrix(-1,0,0,1,24,0)" + width="32" + height="32" /> <path - style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" - d="M 17.546875 0 L 0 17.546875 L 0 24 L 5.5664062 24 L 24 5.5664062 L 24 0 L 17.546875 0 z " - id="rect4145" /> + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#6d0000;fill-opacity:1;stroke:none;stroke-width:4.5;marker:none;enable-background:accumulate" + d="M 0,0 V 1.6875 L 22.3125,24 H 24 V 22.3125 L 1.6875,0 Z" + id="path3616" + sodipodi:nodetypes="ccccccc" + inkscape:connector-curvature="0" /> </svg> |
