forked from openlp/openlp
Use Icon to show we have Notes
This commit is contained in:
parent
5560aac575
commit
6f87c362d1
@ -430,12 +430,21 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
serviceitem = item[u'service_item']
|
serviceitem = item[u'service_item']
|
||||||
treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
|
treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
|
||||||
if len(serviceitem.notes) > 0:
|
if len(serviceitem.notes) > 0:
|
||||||
title = u'%s - %s' % (self.trUtf8('(N)'), serviceitem.title)
|
icon = QtGui.QImage(serviceitem.icon)
|
||||||
|
icon = icon.scaled(80, 80, QtCore.Qt.KeepAspectRatio,
|
||||||
|
QtCore.Qt.SmoothTransformation)
|
||||||
|
|
||||||
|
overlay = QtGui.QImage(':/services/service_item_notes.png')
|
||||||
|
overlay = overlay.scaled(80, 80, QtCore.Qt.KeepAspectRatio,
|
||||||
|
QtCore.Qt.SmoothTransformation)
|
||||||
|
painter = QtGui.QPainter(icon)
|
||||||
|
painter.drawImage(0, 0, overlay)
|
||||||
|
painter.end()
|
||||||
|
treewidgetitem.setIcon(0, build_icon(icon))
|
||||||
else:
|
else:
|
||||||
title = serviceitem.title
|
treewidgetitem.setIcon(0, serviceitem.iconic_representation)
|
||||||
treewidgetitem.setText(0, title)
|
treewidgetitem.setText(0, serviceitem.title)
|
||||||
treewidgetitem.setToolTip(0, serviceitem.notes)
|
treewidgetitem.setToolTip(0, serviceitem.notes)
|
||||||
treewidgetitem.setIcon(0, serviceitem.iconic_representation)
|
|
||||||
treewidgetitem.setData(0, QtCore.Qt.UserRole,
|
treewidgetitem.setData(0, QtCore.Qt.UserRole,
|
||||||
QtCore.QVariant(item[u'order']))
|
QtCore.QVariant(item[u'order']))
|
||||||
treewidgetitem.setExpanded(item[u'expanded'])
|
treewidgetitem.setExpanded(item[u'expanded'])
|
||||||
|
@ -61,7 +61,7 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.OnNewPrompt = self.trUtf8('Select Image(s)')
|
self.OnNewPrompt = self.trUtf8('Select Image(s)')
|
||||||
self.OnNewFileMasks = \
|
self.OnNewFileMasks = \
|
||||||
self.trUtf8('Images (*.jpg *jpeg *.gif *.png *.bmp)')
|
self.trUtf8('Images (*.jpg *jpeg *.gif *.png *.bmp);; All files (*)')
|
||||||
|
|
||||||
def requiredIcons(self):
|
def requiredIcons(self):
|
||||||
MediaManagerItem.requiredIcons(self)
|
MediaManagerItem.requiredIcons(self)
|
||||||
|
@ -78,6 +78,7 @@
|
|||||||
<qresource prefix="services">
|
<qresource prefix="services">
|
||||||
<file>service_edit.png</file>
|
<file>service_edit.png</file>
|
||||||
<file>service_notes.png</file>
|
<file>service_notes.png</file>
|
||||||
|
<file>service_item_notes.png</file>
|
||||||
<file>service_bottom.png</file>
|
<file>service_bottom.png</file>
|
||||||
<file>service_down.png</file>
|
<file>service_down.png</file>
|
||||||
<file>service_top.png</file>
|
<file>service_top.png</file>
|
||||||
|
BIN
resources/images/service_item_notes.png
Normal file
BIN
resources/images/service_item_notes.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 876 B |
Loading…
Reference in New Issue
Block a user