From c70adf8f1d16cb83e771124a789acc6e55209c98 Mon Sep 17 00:00:00 2001 From: BlackXanthus Date: Sat, 4 May 2019 13:25:28 +0100 Subject: [PATCH] Changed self.header() resize method to ensure that the Title column always shows the name of the file --- manuskript/ui/views/outlineView.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/manuskript/ui/views/outlineView.py b/manuskript/ui/views/outlineView.py index 34794852..c97e2075 100644 --- a/manuskript/ui/views/outlineView.py +++ b/manuskript/ui/views/outlineView.py @@ -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) @@ -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) @@ -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) @@ -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)