Skip to content

Commit

Permalink
Changed self.header() resize method to ensure that the Title column a…
Browse files Browse the repository at this point in the history
…lways shows the name of the file
  • Loading branch information
BlackXanthus committed Aug 16, 2019
1 parent 877d578 commit c70adf8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions manuskript/ui/views/outlineView.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@

class outlineView(QTreeView, dndView, outlineBasics):



def __init__(self, parent=None, modelCharacters=None, modelLabels=None, modelStatus=None):
QTreeView.__init__(self,parent)
QTreeView.__init__(self, parent)
dndView.__init__(self)
outlineBasics.__init__(self, parent)

Expand All @@ -38,7 +36,7 @@ def setModelStatus(self, model):
self.modelStatus = model

def setModel(self, model):
QTreeView.setModel(self,model)
QTreeView.setModel(self, model)

# Setting delegates
self.outlineTitleDelegate = outlineTitleDelegate(self)
Expand All @@ -60,11 +58,7 @@ def setModel(self, model):

#Changed Resize Model on the Title.
#This ensures that everything can be seen when a character's name is too long
#Old Code Below:
#self.header().setSectionResizeMode(Outline.title, QHeaderView.Stretch)
#New Code Below:
self.header().setSectionResizeMode(Outline.title,QHeaderView.ResizeToContents)

self.header().setSectionResizeMode(Outline.POV, QHeaderView.ResizeToContents)
self.header().setSectionResizeMode(Outline.status, QHeaderView.ResizeToContents)
self.header().setSectionResizeMode(Outline.label, QHeaderView.ResizeToContents)
Expand All @@ -91,8 +85,8 @@ def setRootIndex(self, index):

def dragMoveEvent(self, event):
dndView.dragMoveEvent(self, event)
QTreeView.dragMoveEvent(self,event)
QTreeView.dragMoveEvent(self, event)

def mouseReleaseEvent(self, event):
QTreeView.mouseReleaseEvent(self,event)
QTreeView.mouseReleaseEvent(self, event)
outlineBasics.mouseReleaseEvent(self, event)

0 comments on commit c70adf8

Please sign in to comment.