Sort out Image Plugin icons

This commit is contained in:
Tim Bentley 2009-06-29 06:13:06 +01:00
parent 560584d8f6
commit 409383add2
2 changed files with 5 additions and 5 deletions

View File

@ -39,7 +39,7 @@ def buildIcon(icon):
ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,
QtGui.QIcon.Off) QtGui.QIcon.Off)
else: else:
ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QImage(icon)), ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
QtGui.QIcon.Normal, QtGui.QIcon.Off) QtGui.QIcon.Normal, QtGui.QIcon.Off)
return ButtonIcon return ButtonIcon

View File

@ -21,7 +21,7 @@ import logging
import os import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, ServiceItem, translate, BaseListWithDnD from openlp.core.lib import MediaManagerItem, ServiceItem, translate, BaseListWithDnD, buildIcon
from openlp.plugins.images.lib.imageslidecontroller import ImageToolbar from openlp.plugins.images.lib.imageslidecontroller import ImageToolbar
# We have to explicitly create separate classes for each plugin # We have to explicitly create separate classes for each plugin
@ -62,7 +62,7 @@ class ImageMediaItem(MediaManagerItem):
def initialise(self): def initialise(self):
self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.ListView.setIconSize(QtCore.QSize(50,88)) self.ListView.setIconSize(QtCore.QSize(88,50))
self.loadList(self.parent.config.load_list(self.ConfigSection)) self.loadList(self.parent.config.load_list(self.ConfigSection))
def onDeleteClick(self): def onDeleteClick(self):
@ -77,7 +77,7 @@ class ImageMediaItem(MediaManagerItem):
for file in list: for file in list:
(path, filename) = os.path.split(unicode(file)) (path, filename) = os.path.split(unicode(file))
item_name = QtGui.QListWidgetItem(filename) item_name = QtGui.QListWidgetItem(filename)
item_name.setIcon(QtGui.QIcon(file)) item_name.setIcon(buildIcon(file))
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file))
self.ListView.addItem(item_name) self.ListView.addItem(item_name)