9 """ |
9 """ |
10 |
10 |
11 from PyQt6.QtCore import Qt |
11 from PyQt6.QtCore import Qt |
12 from PyQt6.QtWidgets import QLabel |
12 from PyQt6.QtWidgets import QLabel |
13 |
13 |
14 from eric7.Utilities import compactPath |
14 from eric7.SystemUtilities import FileSystemUtilities |
15 |
15 |
16 |
16 |
17 class EricSqueezeLabel(QLabel): |
17 class EricSqueezeLabel(QLabel): |
18 """ |
18 """ |
19 Class implementing a label that squeezes its contents to fit its size. |
19 Class implementing a label that squeezes its contents to fit its size. |
111 @param event reference to the paint event (QPaintEvent) |
111 @param event reference to the paint event (QPaintEvent) |
112 """ |
112 """ |
113 if self.length(self.__path) > self.contentsRect().width(): |
113 if self.length(self.__path) > self.contentsRect().width(): |
114 super().setText( |
114 super().setText( |
115 self.__surrounding.format( |
115 self.__surrounding.format( |
116 compactPath(self.__path, self.contentsRect().width(), self.length) |
116 FileSystemUtilities.compactPath( |
|
117 self.__path, self.contentsRect().width(), self.length |
|
118 ) |
117 ) |
119 ) |
118 ) |
120 ) |
119 else: |
121 else: |
120 super().setText(self.__surrounding.format(self.__path)) |
122 super().setText(self.__surrounding.format(self.__path)) |
121 super().paintEvent(event) |
123 super().paintEvent(event) |