def makeSplashLogo(): '''Make a splash screen logo.''' splash = qt4.QSplashScreen() splash.setStyleSheet("background-color:white;") # draw logo on pixmap layout = qt4.QVBoxLayout(splash) pm = utils.getPixmap('logo.png') logo = qt4.QLabel() logo.setPixmap(pm) logo.setAlignment(qt4.Qt.AlignCenter) layout.addWidget(logo) # add copyright text message = qt4.QLabel() message.setText(splashcopyr % utils.version()) message.setAlignment(qt4.Qt.AlignCenter) # increase size of font font = message.font() font.setPointSize(font.pointSize()*1.5) message.setFont(font) layout.addWidget(message) h = qt4.QFontMetrics(font).height() layout.setContentsMargins(h,h,h,h) # Center the spash screen screen = qt4.QDesktopWidget().screenGeometry() splash.move((screen.width()-layout.sizeHint().width())/2, (screen.height()-layout.sizeHint().height())/2) return splash
def updateHighlight(self): """Show drop down arrow if item has focus.""" if self.inmouse or self.infocus or self.inmenu: pixmap = 'downarrow.png' else: if self.setting.isReference() and not self.setting.isDefault(): pixmap = 'link.png' else: pixmap = 'downarrow_blank.png' self.iconlabel.setPixmap(utils.getPixmap(pixmap))
def __init__(self, mainwin): TutorialStep.__init__( self, _(''' <p>Now we will change the point color.</p> <p class="usercmd">Click on the "Marker fill (%s)" formatting tab. Change the fill color of the plotted data.</p> ''') % utils.pixmapAsHtml(utils.getPixmap('settings_plotmarkerfill.png')), mainwin, disablenext=True, nextonsetting = ('/page1/graph1/xy1/MarkerFill/color', lambda val: val != 'black'), nextstep=AddXY2nd)
def __init__(self, mainwin): TutorialStep.__init__( self, _(''' <p>We can fill regions under plots using the Fill Below Formatting tab (%s).</p> <p class="usercmd">Go to this tab, and unselect the "Hide edge fill" option.</p> ''') % utils.pixmapAsHtml(utils.getPixmap('settings_plotfillbelow.png')), mainwin, disablenext=True, nextonsetting = ('/page1/graph1/xy2/FillBelow/hide', lambda val: not val), nextstep=File1)
def __init__(self, mainwin): TutorialStep.__init__( self, _(''' <p>Now we will change the point color.</p> <p class="usercmd">Click on the "Marker fill (%s)" formatting tab. Change the fill color of the plotted data.</p> ''') % utils.pixmapAsHtml(utils.getPixmap('settings_plotmarkerfill.png')), mainwin, disablenext=True, nextonsetting=('/page1/graph1/xy1/MarkerFill/color', lambda val: val != 'black'), nextstep=AddXY2nd)
def __init__(self, mainwin): TutorialStep.__init__( self, _(''' <p>We can fill regions under plots using the Fill Below Formatting tab (%s).</p> <p class="usercmd">Go to this tab, and unselect the "Hide edge fill" option.</p> ''') % utils.pixmapAsHtml(utils.getPixmap('settings_plotfillbelow.png')), mainwin, disablenext=True, nextonsetting=('/page1/graph1/xy2/FillBelow/hide', lambda val: not val), nextstep=File1)
def __init__(self, mainwindow): VeuszDialog.__init__(self, mainwindow, 'about.ui', modal=True) # draw logo in dialog self.frame.setBackgroundRole(qt4.QPalette.Base) self.frame.setAutoFillBackground(True) self.logolabel.setPixmap(utils.getPixmap('logo.png')) # add version to copyright text copyrighttext = unicode(self.copyrightlabel.text()) copyrighttext = copyrighttext % {'version': utils.version()} self.copyrightlabel.setText(copyrighttext) self.connect(self.licenseButton, qt4.SIGNAL('clicked()'), self.licenseClicked)
def __init__(self, mainwindow): VeuszDialog.__init__(self, mainwindow, 'about.ui', modal=True) # draw logo in dialog self.frame.setBackgroundRole(qt4.QPalette.Base) self.frame.setAutoFillBackground(True) self.logolabel.setPixmap( utils.getPixmap('logo.png') ) # add version to copyright text copyrighttext = unicode(self.copyrightlabel.text()) copyrighttext = copyrighttext % {'version': utils.version()} self.copyrightlabel.setText(copyrighttext) self.connect(self.licenseButton, qt4.SIGNAL('clicked()'), self.licenseClicked)
def __init__(self, mainwin): TutorialStep.__init__( self, _(''' <p>Veusz has now plotted the data on the graph. You can manipulate how the data are shown using the formatting settings.</p> <p class="usercmd">Make sure that the line Formatting tab (%s) for the widget is selected.</p> <p class="usercmd">Click on the check box next to the Hide option at the bottom, to hide the line plotted between the data points.</p> ''') % utils.pixmapAsHtml(utils.getPixmap('settings_plotline.png')), mainwin, disablenext=True, nextonsetting = ('/page1/graph1/xy1/PlotLine/hide', lambda val: val), nextstep=SetXYFill)
def __init__(self, mainwin): TutorialStep.__init__(self, _(''' <p>Veusz has now plotted the data on the graph. You can manipulate how the data are shown using the formatting settings.</p> <p class="usercmd">Make sure that the line Formatting tab (%s) for the widget is selected.</p> <p class="usercmd">Click on the check box next to the Hide option at the bottom, to hide the line plotted between the data points.</p> ''') % utils.pixmapAsHtml(utils.getPixmap('settings_plotline.png')), mainwin, disablenext=True, nextonsetting=('/page1/graph1/xy1/PlotLine/hide', lambda val: val), nextstep=SetXYFill)
def __init__(self, mainwin): tb = mainwin.formatdock.tabwidget.tabBar() label = qt4.QLabel(" ") tb.setTabButton(1, qt4.QTabBar.LeftSide, label) TutorialStep.__init__( self, _(''' <p>Different types of formatting properties are grouped under separate tables. The options for drawing the function line are grouped under the flashing Line tab (%s).</p> <p class="usercmd">Click on the Line tab to continue.</p> ''') % utils.pixmapAsHtml(utils.getPixmap('settings_plotline.png')), mainwin, flash=label, disablenext=True, nextstep=FunctionLineFormatting) self.connect(tb, qt4.SIGNAL('currentChanged(int)'), self.slotCurrentChanged)
def __init__(self, mainwin): tb = mainwin.formatdock.tabwidget.tabBar() label = qt4.QLabel(" ") tb.setTabButton(1, qt4.QTabBar.LeftSide, label) TutorialStep.__init__(self, _(''' <p>Different types of formatting properties are grouped under separate tables. The options for drawing the function line are grouped under the flashing Line tab (%s).</p> <p class="usercmd">Click on the Line tab to continue.</p> ''') % utils.pixmapAsHtml(utils.getPixmap('settings_plotline.png')), mainwin, flash=label, disablenext=True, nextstep=FunctionLineFormatting) self.connect(tb, qt4.SIGNAL('currentChanged(int)'), self.slotCurrentChanged)
def makeSplash(app): '''Make a splash screen logo.''' splash = qt.QSplashScreen() splash.setStyleSheet("background-color:white; color: black;") # draw logo on pixmap layout = qt.QVBoxLayout(splash) logo = qt.QLabel() logo.setPixmap(utils.getPixmap('logo.png')) logo.setAlignment(qt.Qt.AlignCenter) layout.addWidget(logo) # add copyright text message = qt.QLabel() message.setText(splashcopyr % utils.version()) message.setAlignment(qt.Qt.AlignCenter) # increase size of font font = message.font() font.setPointSizeF(font.pointSize()*1.5) message.setFont(font) layout.addWidget(message) h = qt.QFontMetrics(font).height() layout.setContentsMargins(h,h,h,h) # Center the spash screen splash.setGeometry(5, 5, 100, 100) screen = qt.QDesktopWidget().screenGeometry() splash.move( (screen.width()-layout.sizeHint().width())//2, (screen.height()-layout.sizeHint().height())//2 ) # make sure dialog goes away - avoid problem if a message box pops # up before it is removed qt.QTimer.singleShot(2000, splash.hide) return splash
def makeSplashLogo(): '''Make a splash screen logo.''' border = 16 xw, yw = 520, 240 pix = qt4.QPixmap(xw, yw) pix.fill() p = qt4.QPainter(pix) # draw logo on pixmap logo = utils.getPixmap('logo.png') p.drawPixmap( xw/2 - logo.width()/2, border, logo ) # add copyright text doc = qt4.QTextDocument() doc.setPageSize( qt4.QSizeF(xw, yw - 3*border - logo.height()) ) f = qt4.qApp.font() f.setPointSize(14) doc.setDefaultFont(f) doc.setDefaultTextOption( qt4.QTextOption(qt4.Qt.AlignCenter) ) doc.setHtml(splashcopyr % utils.version()) p.translate(0, 2*border + logo.height()) doc.drawContents(p) p.end() return pix
def makeSplashLogo(): '''Make a splash screen logo.''' border = 16 xw, yw = 520, 240 pix = qt4.QPixmap(xw, yw) pix.fill() p = qt4.QPainter(pix) # draw logo on pixmap logo = utils.getPixmap('logo.png') p.drawPixmap(xw / 2 - logo.width() / 2, border, logo) # add copyright text doc = qt4.QTextDocument() doc.setPageSize(qt4.QSizeF(xw, yw - 3 * border - logo.height())) f = qt4.qApp.font() f.setPointSize(14) doc.setDefaultFont(f) doc.setDefaultTextOption(qt4.QTextOption(qt4.Qt.AlignCenter)) doc.setHtml(splashcopyr % utils.version()) p.translate(0, 2 * border + logo.height()) doc.drawContents(p) p.end() return pix