Build Dynamic Icons for SlideController

This commit is contained in:
Tim Bentley 2009-12-02 10:59:54 +00:00
parent ca7d032aa5
commit a2ff6433ba
18 changed files with 23 additions and 21 deletions

View File

@ -105,9 +105,25 @@ def build_icon(icon):
ButtonIcon.addPixmap(
QtGui.QPixmap(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off)
else:
if len(icon) < 5:
if len(icon) > 2:
ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
else:
#lets build a Icon from text
pmap = QtGui.QPixmap(u':/pages/slide.png')
painter = QtGui.QPainter(pmap)
painter.setPen(QtGui.QColor(QtGui.QColor.black))
font = QtGui.QFont()
font.setFamily(u'Arial')
font.setBold(True)
font.setPointSize(12)
painter.setFont(font)
metrics = QtGui.QFontMetrics(font)
painter.drawText(5, 3 + metrics.ascent(), icon)
painter.end()
ButtonIcon.addPixmap(
pmap, QtGui.QIcon.Normal, QtGui.QIcon.Off)
elif type(icon) is QtGui.QImage:
ButtonIcon = QtGui.QIcon()
ButtonIcon.addPixmap(

View File

@ -269,7 +269,7 @@ class MediaManagerItem(QtGui.QWidget):
if self.hasEditIcon:
self.ListView.addAction(
contextMenuAction(
self.ListView, u':%s_new.png' % self.IconPath,
self.ListView, u':/%s_new.png' % self.IconPath,
u'%s %s' % (self.trUtf8('&Edit'), self.PluginNameVisible),
self.onEditClick))
self.ListView.addAction(contextMenuSeparator(self.ListView))

View File

@ -173,7 +173,7 @@ class SlideController(QtGui.QWidget):
self.trUtf8('Move to live'), self.onGoLive)
self.Toolbar.addToolbarSeparator(u'Close Separator')
self.Toolbar.addToolbarButton(
u'Edit Song', u':songs/song_edit.png',
u'Edit Song', u':/songs/song_edit.png',
self.trUtf8('Edit and re-preview Song'), self.onEditSong)
if isLive:
self.Toolbar.addToolbarSeparator(u'Loop Separator')
@ -210,16 +210,16 @@ class SlideController(QtGui.QWidget):
if isLive:
self.Songbar = OpenLPToolbar(self)
self.Songbar.addToolbarButton(
u'Bridge:1', u':/pages/page_bridge.png',
u'Bridge:1', u'B',
self.trUtf8('Bridge'),
self.onSongBarHandler)
self.Songbar.addToolbarButton(
u'Chorus:1', u':/pages/page_chorus.png',
u'Chorus:1', u'C',
self.trUtf8('Chorus'),
self.onSongBarHandler)
for verse in range(1, 12):
self.Songbar.addToolbarButton(
unicode(u'Verse:%s'% verse), u':/pages/page_%s.png' % verse,
unicode(u'Verse:%s'% verse), u'%s' % verse,
unicode(self.trUtf8('Verse %s'))% verse,
self.onSongBarHandler)
self.ControllerLayout.addWidget(self.Songbar)
@ -488,7 +488,6 @@ class SlideController(QtGui.QWidget):
if self.isLive:
self.serviceItem.request_audit()
log.debug(u'displayServiceManagerItems End')
print self.slideList
#Screen event methods
def onSlideSelectedFirst(self):

View File

@ -126,19 +126,6 @@
<file>theme_import.png</file>
</qresource>
<qresource prefix="pages" >
<file>page_chorus.png</file>
<file>page_bridge.png</file>
<file>page_1.png</file>
<file>page_2.png</file>
<file>page_3.png</file>
<file>page_4.png</file>
<file>page_5.png</file>
<file>page_6.png</file>
<file>page_7.png</file>
<file>page_8.png</file>
<file>page_9.png</file>
<file>page_10.png</file>
<file>page_11.png</file>
<file>page_12.png</file>
<file>slide.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B