Attached Documents

#70307: make file name selectable -- patch (selectable_name.diff)

#70307: make file name selectable -- patch (selectable_name.diff)

download
# HG changeset patch
# Parent d43754c8e5b5a69629c3f43b196623566054e20c
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
Allow filename to be selected (close #70307)

filename displayed as a title of diff was not selectable.


diff --git a/hgviewlib/qt4/hgfileview.py b/hgviewlib/qt4/hgfileview.py
--- a/hgviewlib/qt4/hgfileview.py
+++ b/hgviewlib/qt4/hgfileview.py
@@ -104,10 +104,13 @@ class HgFileView(QtGui.QFrame):
         l.setSpacing(0)
 
         self.topLayout = QtGui.QVBoxLayout()
         self.filenamelabel = QtGui.QLabel()
         self.filenamelabel.setWordWrap(True)
+        self.filenamelabel.setTextInteractionFlags(
+            QtCore.Qt.TextSelectableByKeyboard|
+            QtCore.Qt.TextSelectableByMouse)
         self.execflaglabel = QtGui.QLabel()
         self.execflaglabel.setWordWrap(True)
         self.topLayout.addWidget(self.filenamelabel)
         self.topLayout.addWidget(self.execflaglabel)
         self.execflaglabel.hide()