src/eric7/EricWidgets/EricSqueezeLabels.py

branch
eric7
changeset 9624
b47dfa7a137d
parent 9482
a2bc06a54d9d
child 9653
e67609152c5e
equal deleted inserted replaced
9623:9c1f429cb56b 9624:b47dfa7a137d
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)

eric ide

mercurial