def __init__(self, parent=None):
        """Default class constructor."""
        super(AboutDialog, self).__init__(parent)

        p = self.palette()
        p.setColor(self.backgroundRole(), Qt.white)
        self.setPalette(p)

        if parent:
            self.gImgDir = parent.gImgDir
            self.gIconDir = parent.gIconDir
        elif __name__ == '__main__':
            self.gImgDir = gAppDir + os.sep + 'images'
            self.gIconDir = gAppDir + os.sep + 'icons' + os.sep + 'default'

        # The tiled theme background texture.
        self.bgLogo = QPixmap(self.gImgDir + os.sep + 'texture-spirals.png')
        self.bgBrush = QBrush(self.bgLogo)
        self.setWhatsThis(self.tr("""\
The background is a tiled image of an actual design that was stitched out during the pre-alpha stage.
It was created by Nina Paley and Theodore Gray using Mathematica in conjunction with our software.
They have graciously allowed us to use it for the project in whichever way we wish.
We thought it looked so good, that it has become the new theme for Embroidermodder 2.
To check out some of the more interesting embroidery projects they are working on,
visit http://blog.ninapaley.com/"""))

        self.imgLbl = EmbroidermodderLogo(self)

        aboutLbl = QTextBrowser(self)
        aboutLbl.setReadOnly(True)
        aboutLbl.setOpenExternalLinks(True)
        aboutLbl.setText('<b>%s</b>' % '<br>'.join(__doc__.split('\n')))
        aboutLbl.setWhatsThis(self.tr('This is the AWESOME people that brought Embroidermodder 2 to life.'))

        # We want very slight opacity of the white background
        # so the seamless texture shows slightly through.
        opacityStyleSheet = """\
        QTextEdit:read-only {
            color: rgb(50, 50, 50);
            font-size: 12px;
            font-weight: bold;
            background-color: rgba(255, 255, 255, 240);
            border: 1px solid rgba(0, 0, 0, 255);
            }
            """

        aboutLbl.setStyleSheet(opacityStyleSheet)
        op = QGraphicsOpacityEffect(aboutLbl)
        op.setOpacity(0.95)
        aboutLbl.setGraphicsEffect(op)

        self.notebook = QTabWidget(self)
        self.notebook.setMinimumWidth(500)
        self.notebook.addTab(aboutLbl, self.tr('About'))
        self.notebook.setTabIcon(0, QIcon(self.gIconDir + os.sep + 'app.png'))
        self.notebook.setTabIcon(1, QIcon(self.gImgDir + os.sep + 'kickstarter-logo-k-color.png'))

        notebookStyleSheet = """\
            QTabWidget::pane { /* The tab widget frame */
                border-top: 1px solid #000000;
                position: absolute;
                top: -0.5em;
            }

            QTabWidget::tab-bar {
                alignment: center;
            }

            /* Style the tab using the tab sub-control. Note that
                it reads QTabBar _not_ QTabWidget */
            QTabBar::tab {
                margin-top: 2px; /* make non-selected tabs look smaller */
                font-size: 14px;
                font-weight: bold;
                background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                            stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
                                            stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
                border: 1px solid #000000;
                /* border-bottom-color: #C2C7CB; */ /* same as the pane color */
                border-top-left-radius: 4px;
                border-top-right-radius: 4px;
                min-width: 40ex;
                min-height: 5ex;
                padding: 3px;
            }

            QTabBar::tab:selected {
                margin-top: 0px;
                font-size: 16px;
                font-weight: bold;
                background: qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,
                                            stop: 0 #0C6AB0, stop: 0.15 #55C4E6,
                                            stop: 0.15 #55C4E6, stop: 0.5 #FFFFFF,
                                            stop: 0.5 #FFFFFF, stop: 0.85 #55C4E6,
                                            stop: 0.85 #55C4E6, stop: 1.0 #0C6AB0);
                border: 1px solid #000000;
            }

            QTabBar::tab:!selected:hover {
                margin-top: 2px; /* make non-selected tabs look smaller */
                font-size: 14px;
                font-weight: bold;
                background: qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,
                                            stop: 0 #888888, stop: 0.15 #BBBBBB,
                                            stop: 0.15 #BBBBBB, stop: 0.5 #FFFFFF,
                                            stop: 0.5 #FFFFFF, stop: 0.85 #BBBBBB,
                                            stop: 0.85 #BBBBBB, stop: 1.0 #888888);
                border: 1px solid #000000;
            }

            QTabBar::tab:selected {
                border-color: #000000;
                border-bottom-color: #000000; /* same as pane color */
            }
            """

        self.notebook.setStyleSheet(notebookStyleSheet)
        self.notebook.currentChanged.connect(self.CurrentTabChanged)

        buttonbox = QDialogButtonBox(Qt.Horizontal, self)
        button = QPushButton(self)
        button.setText(self.tr("Oh, Yeah!"))
        button.setWhatsThis(self.tr('This is the Oh, Yeah! button!') + '\n' + self.tr('Oh, Yeah!'))
        buttonbox.addButton(button, QDialogButtonBox.AcceptRole)
        buttonbox.setCenterButtons(True)
        buttonbox.accepted.connect(self.accept)

        hbLayout1 = QHBoxLayout()
        hbLayout2 = QHBoxLayout()
        vbLayout = QVBoxLayout()
        hbLayout1.addStretch()
        hbLayout1.addWidget(self.imgLbl)
        hbLayout1.addStretch()
        hbLayout2.addStretch()
        hbLayout2.addWidget(self.notebook)
        hbLayout2.addStretch()
        vbLayout.addLayout(hbLayout1)
        vbLayout.addLayout(hbLayout2)
        vbLayout.addWidget(buttonbox)
        self.setLayout(vbLayout)

        self.setWindowTitle(self.tr('About Embroidermodder Version 2.0'))

        QApplication.restoreOverrideCursor() # TODO/???/PORT# don't mess with the window resize cursors.
Exemple #2
0
    def __init__(self, parent=None):
        """
        Default class constructor.

        :param `parent`: Pointer to a parent widget instance.
        :type `parent`: `QWidget`_
        """
        super(AboutDialog, self).__init__(parent)

        p = self.palette()
        p.setColor(self.backgroundRole(), Qt.white)
        self.setPalette(p)

        if parent:
            self.gImgDir = parent.gImgDir
            self.gIconDir = parent.gIconDir
        elif __name__ == '__main__':
            self.gImgDir = gAppDir + os.sep + 'images'
            self.gIconDir = gAppDir + os.sep + 'icons' + os.sep + 'default'

        # The tiled theme background texture.
        self.bgLogo = QPixmap(self.gImgDir + os.sep + 'texture-spirals.png')
        self.bgBrush = QBrush(self.bgLogo)
        self.setWhatsThis(
            self.tr("""\
The background is a tiled image of an actual design that was stitched out during the pre-alpha stage.
It was created by Nina Paley and Theodore Gray using Mathematica in conjunction with our software.
They have graciously allowed us to use it for the project in whichever way we wish.
We thought it looked so good, that it has become the new theme for Embroidermodder 2.
To check out some of the more interesting embroidery projects they are working on,
visit http://blog.ninapaley.com/"""))

        self.imgLbl = EmbroidermodderLogo(self)

        aboutLbl = QTextBrowser(self)
        aboutLbl.setReadOnly(True)
        aboutLbl.setOpenExternalLinks(True)

        aboutLbl.setText('<b>%s</b>' % '<br>'.join(ABOUT.split('\n')))
        aboutLbl.setWhatsThis(
            self.
            tr('This is the AWESOME people that brought Embroidermodder 2 to life.'
               ))

        # We want very slight opacity of the white background
        # so the seamless texture shows slightly through.
        opacityStyleSheet = """\
        QTextEdit:read-only {
            color: rgb(50, 50, 50);
            font-size: 12px;
            font-weight: bold;
            background-color: rgba(255, 255, 255, 240);
            border: 1px solid rgba(0, 0, 0, 255);
            }
            """

        aboutLbl.setStyleSheet(opacityStyleSheet)
        op = QGraphicsOpacityEffect(aboutLbl)
        op.setOpacity(0.95)
        aboutLbl.setGraphicsEffect(op)

        self.notebook = QTabWidget(self)
        self.notebook.setMinimumWidth(500)
        self.notebook.addTab(aboutLbl, self.tr('About'))
        self.notebook.setTabIcon(0, QIcon(self.gIconDir + os.sep + 'app.png'))
        self.notebook.setTabIcon(
            1, QIcon(self.gImgDir + os.sep + 'kickstarter-logo-k-color.png'))

        notebookStyleSheet = """\
            QTabWidget::pane { /* The tab widget frame */
                border-top: 1px solid #000000;
                position: absolute;
                top: -0.5em;
            }

            QTabWidget::tab-bar {
                alignment: center;
            }

            /* Style the tab using the tab sub-control. Note that
                it reads QTabBar _not_ QTabWidget */
            QTabBar::tab {
                margin-top: 2px; /* make non-selected tabs look smaller */
                font-size: 14px;
                font-weight: bold;
                background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                            stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
                                            stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
                border: 1px solid #000000;
                /* border-bottom-color: #C2C7CB; */ /* same as the pane color */
                border-top-left-radius: 4px;
                border-top-right-radius: 4px;
                min-width: 40ex;
                min-height: 5ex;
                padding: 3px;
            }

            QTabBar::tab:selected {
                margin-top: 0px;
                font-size: 16px;
                font-weight: bold;
                background: qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,
                                            stop: 0 #0C6AB0, stop: 0.15 #55C4E6,
                                            stop: 0.15 #55C4E6, stop: 0.5 #FFFFFF,
                                            stop: 0.5 #FFFFFF, stop: 0.85 #55C4E6,
                                            stop: 0.85 #55C4E6, stop: 1.0 #0C6AB0);
                border: 1px solid #000000;
            }

            QTabBar::tab:!selected:hover {
                margin-top: 2px; /* make non-selected tabs look smaller */
                font-size: 14px;
                font-weight: bold;
                background: qlineargradient(x1: 0, y1: 0, x2: 2, y2: 2,
                                            stop: 0 #888888, stop: 0.15 #BBBBBB,
                                            stop: 0.15 #BBBBBB, stop: 0.5 #FFFFFF,
                                            stop: 0.5 #FFFFFF, stop: 0.85 #BBBBBB,
                                            stop: 0.85 #BBBBBB, stop: 1.0 #888888);
                border: 1px solid #000000;
            }

            QTabBar::tab:selected {
                border-color: #000000;
                border-bottom-color: #000000; /* same as pane color */
            }
            """

        self.notebook.setStyleSheet(notebookStyleSheet)
        self.notebook.currentChanged.connect(self.CurrentTabChanged)

        buttonbox = QDialogButtonBox(Qt.Horizontal, self)
        button = QPushButton(self)
        button.setText(self.tr("Oh, Yeah!"))
        button.setWhatsThis(
            self.tr('This is the Oh, Yeah! button!') + '\n' +
            self.tr('Oh, Yeah!'))
        buttonbox.addButton(button, QDialogButtonBox.AcceptRole)
        buttonbox.setCenterButtons(True)
        buttonbox.accepted.connect(self.accept)

        hbLayout1 = QHBoxLayout()
        hbLayout2 = QHBoxLayout()
        vbLayout = QVBoxLayout()
        hbLayout1.addStretch()
        hbLayout1.addWidget(self.imgLbl)
        hbLayout1.addStretch()
        hbLayout2.addStretch()
        hbLayout2.addWidget(self.notebook)
        hbLayout2.addStretch()
        vbLayout.addLayout(hbLayout1)
        vbLayout.addLayout(hbLayout2)
        vbLayout.addWidget(buttonbox)
        self.setLayout(vbLayout)

        self.setWindowTitle(self.tr('About Embroidermodder Version 2.0'))

        QApplication.restoreOverrideCursor(
        )  # TODO/???/PORT# don't mess with the window resize cursors.