Exemplo n.º 1
0
    def get_stylesheet(self):
        """
        :return: a string with the qt stylesheet to be used for this application as a string
        or None if no stylesheet needed.

        Camelot comes with a couple of default stylesheets :

         * stylesheet/office2007_blue.qss
         * stylesheet/office2007_black.qss
         * stylesheet/office2007_silver.qss

        Have a look at the default implementation to use another stylesheet.
        """
        return art.read('stylesheet/office2007_blue.qss')
Exemplo n.º 2
0
def get_application():
    """Get the singleton QApplication"""
    if not len(_application_):
        #
        # Uniform style for screenshot generation
        #
        application = QtWidgets.QApplication.instance()
        if not application:
            import sys
            from camelot.view import art
            QtWidgets.QApplication.setStyle('cleanlooks')
            application = QtWidgets.QApplication(sys.argv)
            application.setStyleSheet( art.read('stylesheet/office2007_blue.qss').decode('utf-8') )
            QtCore.QLocale.setDefault( QtCore.QLocale('nl_BE') )
            #try:
            #    from PyTitan import QtnOfficeStyle
            #    QtnOfficeStyle.setApplicationStyle( QtnOfficeStyle.Windows7Scenic )
            #except:
            #    pass 
        _application_.append( application )
    return _application_[0]
Exemplo n.º 3
0
    def get_stylesheet(self):
        """
        :return: a string with the content of a qt stylesheet to be used for 
        this application as a string or None if no stylesheet needed.

        Camelot comes with a couple of default stylesheets :

         * stylesheet/office2007_blue.qss
         * stylesheet/office2007_black.qss
         * stylesheet/office2007_silver.qss

        Have a look at the default implementation to use another stylesheet.
        """
        #
        # Try to load a custom QStyle, if that fails use a stylesheet from
        # a file
        #
        try:
            from PyTitan import QtnOfficeStyle
            QtnOfficeStyle.setApplicationStyle( QtnOfficeStyle.Windows7Scenic )
        except:
            pass
        return art.read('stylesheet/office2007_blue.qss')
Exemplo n.º 4
0
    def get_stylesheet(self):
        """
        :return: a string with the content of a qt stylesheet to be used for 
        this application as a string or None if no stylesheet needed.

        Camelot comes with a couple of default stylesheets :

         * stylesheet/office2007_blue.qss
         * stylesheet/office2007_black.qss
         * stylesheet/office2007_silver.qss

        Have a look at the default implementation to use another stylesheet.
        """
        #
        # Try to load a custom QStyle, if that fails use a stylesheet from
        # a file
        #
        try:
            from PyTitan import QtnOfficeStyle
            QtnOfficeStyle.setApplicationStyle( QtnOfficeStyle.Windows7Scenic )
        except:
            pass
        return art.read('stylesheet/office2007_blue.qss')
Exemplo n.º 5
0
def get_application():
    """Get the singleton QApplication"""
    from PyQt4.QtGui import QApplication
    if not len(_application_):
        #
        # Uniform style for screenshot generation
        #
        application = QApplication.instance()
        if not application:
            import sys
            from camelot.view import art
            QApplication.setStyle('cleanlooks')
            application = QApplication(sys.argv)
            application.setStyleSheet( art.read('stylesheet/office2007_blue.qss') )
            from PyQt4 import QtCore
            QtCore.QLocale.setDefault( QtCore.QLocale('nl_BE') )
            #try:
            #    from PyTitan import QtnOfficeStyle
            #    QtnOfficeStyle.setApplicationStyle( QtnOfficeStyle.Windows7Scenic )
            #except:
            #    pass 
        _application_.append( application )
    return _application_[0]
Exemplo n.º 6
0
def stylesheet_from_profile():
    profile = selected_profile_info()
    from camelot.view import art
    return art.read( 'stylesheet/office2007_' + profile.get('stylesheet', 'blue') + '.qss' )
Exemplo n.º 7
0
def stylesheet_from_profile():
    profile = selected_profile_info()
    from camelot.view import art
    return art.read( 'stylesheet/office2007_' + profile.get('stylesheet', 'blue') + '.qss' )
Exemplo n.º 8
0
 def get_stylesheet(self):
     from camelot.view import art
     return art.read('stylesheet/black.qss')
Exemplo n.º 9
0
 def get_stylesheet(self):
     from camelot.view import art
     return art.read('stylesheet/black.qss').decode('utf-8')
Exemplo n.º 10
0
def stylesheet_from_profile():
    profile = selected_profile_info()
    from camelot.view import art

    return art.read("stylesheet/office2007_" + profile.get("stylesheet", "blue") + ".qss")