Skip to content

Commit

Permalink
FileDialogButton: Show more components of the file name
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya57 committed Aug 18, 2024
1 parent 2c50ad5 commit ad874c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ReText/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def processClick(self):

def updateButtonText(self):
if self.fileName:
self.setText(QFileInfo(self.fileName).fileName())
components = self.fileName.split('/')
if len([x for x in components if x]) > 3:
components[:-3] = '…'
self.setText('/'.join(components))
else:
self.setText(self.defaultText)

Expand Down

0 comments on commit ad874c6

Please sign in to comment.