Commits

Tom Burdick committed 48755bb

no longer draw tags as some polygon thing but just make a column out of it, eventually move it in to the message and highlight it

  • Participants
  • Parent commits a3060c2

Comments (0)

Files changed (3)

File cutehg/views/historyview.py

         self.tableView.setModel(self._historyModel)
         self.tableView.setItemDelegateForColumn( self._historyModel.columns.getIndex("Graph"), self._historyGraphDelegate )
         self.tableView.setSelectionModel(self.selectionModel)
-        self.tableView.setColumnHidden(self._historyModel.columns.getIndex("Tags"), True)
-        self.tableView.setColumnHidden(self._historyModel.columns.getIndex("Branch"), True)
         verticalHeader = self.tableView.verticalHeader()
         verticalHeader.setResizeMode(QtGui.QHeaderView.Fixed)
         

File cutehg/views/models/historygraphdelegate.py

                                              option.rect.y() + option.rect.height()/2 ),
                              3, 3 )
 
-        painter.setFont(font)
-     
-        currentX = currentX + len(edges)*self.COLUMN_WIDTH + 3
-        for tag in item.tags:
-            painter.setPen(palette.color(QtGui.QPalette.Text))
-            painter.setBrush(QtCore.Qt.NoBrush)
-
-            polygon = createTagPolygon(font, QtCore.QString(tag))
-            currentY = (option.rect.y() + option.rect.height()/2) - polygon.boundingRect().height()/2
-            polygon.translate(currentX, currentY)
-            painter.drawPolygon(polygon)
-
-            rect = polygon.boundingRect()
-            rect.translate(-2, 0)
-            painter.drawText( rect, QtCore.Qt.AlignCenter, tag )
-            
-            currentX = currentX + 5 + polygon.boundingRect().width()
-
 
     def sizeHint(self, option, index):
         if index.isValid() and index.model().columns.getName(index.column()) != "Graph":
         (column, color, edges, pedges, max_columns, max_color) = index.model().data(index, HistoryModel.GraphRole)
 
         item = index.model().data(index, HistoryModel.RevisionRole)
-        tags = item.tags
-        font = QtGui.QApplication.font()
-        width = 0
-        height = 0
-        for tag in tags:
-            rect = createTagPolygon(font, QtCore.QString(tag)).boundingRect()
-            width = width + rect.width() + 10
-            height = max(height, rect.height() + 10)
-
 
         return QtCore.QSize(max_columns*self.COLUMN_WIDTH, 15)
 

File cutehg/views/models/historymodel.py

                 return QtCore.QVariant(str(item.age))
             
             if index.column() == self.columns.getIndex("Tags"):
-                return QtCore.QVariant(item.tags)
+                tagstr = ""
+                for tag in item.tags:
+                    tagstr = str(tag) + " "
+
+                return QtCore.QVariant(tagstr)
 
             if index.column() == self.columns.getIndex("Branch"):
                return QtCore.QVariant(item.branch)