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,
QtGui.QIcon.Off)
else:
ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QImage(icon)),
ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
return ButtonIcon
@ -75,7 +75,7 @@ from themexmlhandler import ThemeXML
from renderer import Renderer
from rendermanager import RenderManager
from mediamanageritem import MediaManagerItem
from baselistwithdnd import BaseListWithDnD
from baselistwithdnd import BaseListWithDnD
from listwithpreviews import ListWithPreviews
__all__ = [ 'translate', 'file_to_xml', 'str_to_bool',

View File

@ -21,7 +21,7 @@ import logging
import os
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
# We have to explicitly create separate classes for each plugin
@ -62,7 +62,7 @@ class ImageMediaItem(MediaManagerItem):
def initialise(self):
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))
def onDeleteClick(self):
@ -77,7 +77,7 @@ class ImageMediaItem(MediaManagerItem):
for file in list:
(path, filename) = os.path.split(unicode(file))
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))
self.ListView.addItem(item_name)