removal of util function

This commit is contained in:
Phill Ridout 2014-12-30 11:23:01 +00:00
parent 19cb16d65b
commit 52c7d89706
4 changed files with 1 additions and 30 deletions

View File

@ -132,7 +132,7 @@ class InfoLabel(QtGui.QLabel):
"""
self.setToolTip(text)
super().setText(text)
class SlideController(DisplayController, RegistryProperties):
"""

View File

@ -506,18 +506,6 @@ def get_natural_key(string):
return [b''] + 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 .actions import ActionList

View File

@ -133,4 +133,3 @@ class TestInitFunctions(TestMixin, TestCase):
# THEN: The connection parameters should be set for socket
self.assertEqual(result, 'libreoffice --nologo --norestore --minimized --nodefault --nofirststartwizard'
' "--accept=socket,host=localhost,port=2002;urp;"')

View File

@ -118,19 +118,3 @@ class TestMediaItem(TestCase, TestMixin):
mocked_list_view.selectAll.assert_called_once_with()
self.assertEqual(self.media_item.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)