forked from openlp/openlp
removal of util function
This commit is contained in:
parent
19cb16d65b
commit
52c7d89706
@ -132,7 +132,7 @@ class InfoLabel(QtGui.QLabel):
|
|||||||
"""
|
"""
|
||||||
self.setToolTip(text)
|
self.setToolTip(text)
|
||||||
super().setText(text)
|
super().setText(text)
|
||||||
|
|
||||||
|
|
||||||
class SlideController(DisplayController, RegistryProperties):
|
class SlideController(DisplayController, RegistryProperties):
|
||||||
"""
|
"""
|
||||||
|
@ -506,18 +506,6 @@ def get_natural_key(string):
|
|||||||
return [b''] + key
|
return [b''] + key
|
||||||
return key
|
return key
|
||||||
|
|
||||||
def elide_text(text, font, width):
|
|
||||||
"""
|
|
||||||
Add an ellipsis to text if it is wider than width.
|
|
||||||
|
|
||||||
:param text: The string to elide
|
|
||||||
:param font: The font that the text is being desplayed in
|
|
||||||
:param width: The width that the elided text string needs to fill
|
|
||||||
:return: The elided string or just text
|
|
||||||
"""
|
|
||||||
font_metrics = QtGui.QFontMetrics(font)
|
|
||||||
return font_metrics.elidedText(text, QtCore.Qt.ElideRight, width)
|
|
||||||
|
|
||||||
from .languagemanager import LanguageManager
|
from .languagemanager import LanguageManager
|
||||||
from .actions import ActionList
|
from .actions import ActionList
|
||||||
|
|
||||||
|
@ -133,4 +133,3 @@ class TestInitFunctions(TestMixin, TestCase):
|
|||||||
# THEN: The connection parameters should be set for socket
|
# THEN: The connection parameters should be set for socket
|
||||||
self.assertEqual(result, 'libreoffice --nologo --norestore --minimized --nodefault --nofirststartwizard'
|
self.assertEqual(result, 'libreoffice --nologo --norestore --minimized --nodefault --nofirststartwizard'
|
||||||
' "--accept=socket,host=localhost,port=2002;urp;"')
|
' "--accept=socket,host=localhost,port=2002;urp;"')
|
||||||
|
|
||||||
|
@ -118,19 +118,3 @@ class TestMediaItem(TestCase, TestMixin):
|
|||||||
mocked_list_view.selectAll.assert_called_once_with()
|
mocked_list_view.selectAll.assert_called_once_with()
|
||||||
self.assertEqual(self.media_item.search_results, {})
|
self.assertEqual(self.media_item.search_results, {})
|
||||||
self.assertEqual(self.media_item.second_search_results, {})
|
self.assertEqual(self.media_item.second_search_results, {})
|
||||||
|
|
||||||
|
|
||||||
def elide_text_short_text_test(self):
|
|
||||||
result = elide_text('Test String', QtGui.QFont(),)
|
|
||||||
|
|
||||||
def elide_text(text, font, width):
|
|
||||||
"""
|
|
||||||
Add an ellipsis to text if it is wider than width.
|
|
||||||
|
|
||||||
:param text: The string to elide
|
|
||||||
:param font: The font that the text is being desplayed in
|
|
||||||
:param width: The width that the elided text string needs to fill
|
|
||||||
:return: The elided string or just text
|
|
||||||
"""
|
|
||||||
font_metrics = QtGui.QFontMetrics(font)
|
|
||||||
return font_metrics.elidedText(text, QtCore.Qt.ElideRight, width)
|
|
Loading…
Reference in New Issue
Block a user