From ad874c6ce94b0db42860446011cb1d9b64dc5558 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sun, 18 Aug 2024 20:32:34 +0300 Subject: [PATCH] FileDialogButton: Show more components of the file name --- ReText/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ReText/config.py b/ReText/config.py index 0dbd86c6..dd765e1c 100644 --- a/ReText/config.py +++ b/ReText/config.py @@ -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)