コード例 #1
0
ファイル: StatusBar.py プロジェクト: yougukepp/lib
    def __init__(self, parent=None):
        QStatusBar.__init__(self, parent)

        self.mLabelPos = QLabel("当前位置:(nan,nan)")
        self.mLabelTestName = QLabel("当前测试:凸包")
        self.addWidget(self.mLabelPos)
        self.addWidget(self.mLabelTestName)
コード例 #2
0
 def __init__(self, mainwinref, parent=None): # 'mainwinref' is a MainApplication object 
     module_logger.info("Inside 'ArcaneStatusBar' constructor.")
     
     QStatusBar.__init__(self, parent)
     self.asbar = mainwinref.statusBar()
             
     module_logger.info("Done.")
コード例 #3
0
ファイル: status_bar.py プロジェクト: yougukepp/gesture
    def __init__(self, parent=None):
        QStatusBar.__init__(self, parent)

        self.mLabelPhyPos = QLabel("物理坐标:(nan,nan)")
        self.mLabelPaintPos = QLabel("绘制坐标:(nan,nan)")
        self.addWidget(self.mLabelPhyPos)
        self.addWidget(self.mLabelPaintPos)
コード例 #4
0
ファイル: StatusBar.py プロジェクト: yougukepp/lib
    def __init__(self, parent=None):
        QStatusBar.__init__(self, parent)

        self.mLabelPos = QLabel("当前位置:(nan,nan)")
        self.mLabelTestName = QLabel("当前测试:凸包")
        self.addWidget(self.mLabelPos)
        self.addWidget(self.mLabelTestName)
コード例 #5
0
    def __init__(self, parent=None):
        QStatusBar.__init__(self, parent)
        self.setAutoFillBackground(
            True)  # set the widget background to be filled automatically

        # Define colours to use in animations
        red = QColor(255, 0, 0)
        red_transparent = QColor(255, 0, 0, alpha=0)
        green = QColor(0, 255, 0)
        green_transparent = QColor(0, 255, 0, alpha=0)

        # Setup fade out animation for red
        fade_out = QPropertyAnimation(self, b"back_color")
        fade_out.setStartValue(red)
        fade_out.setEndValue(red_transparent)
        fade_out.setDuration(2000)

        # Setup fade in animation for red
        fade_in = QPropertyAnimation(self, b"back_color")
        fade_in.setStartValue(red_transparent)
        fade_in.setEndValue(red)
        fade_in.setDuration(2000)

        # Setup stay animation for red
        stay_red = QPropertyAnimation(self, b"back_color")
        stay_red.setStartValue(red)
        stay_red.setEndValue(red)
        stay_red.setDuration(1000)

        # Setup animation group for no connection
        self._no_conn_anim = QSequentialAnimationGroup()
        self._no_conn_anim.addAnimation(fade_out)
        self._no_conn_anim.addAnimation(fade_in)
        self._no_conn_anim.addAnimation(stay_red)
        self._no_conn_anim.setLoopCount(-1)  # loop infinitely

        # Setup fade out animation for green
        fade_out = QPropertyAnimation(self, b"back_color")
        fade_out.setStartValue(green)
        fade_out.setEndValue(green_transparent)
        fade_out.setDuration(2000)

        # Setup fade in animation for green
        fade_in = QPropertyAnimation(self, b"back_color")
        fade_in.setStartValue(green_transparent)
        fade_in.setEndValue(green)
        fade_in.setDuration(2000)

        # Setup stay animation for green
        stay_green = QPropertyAnimation(self, b"back_color")
        stay_green.setStartValue(green)
        stay_green.setEndValue(green)
        stay_green.setDuration(1000)

        # Setup animation group for a connection
        self._conn_anim = QSequentialAnimationGroup()
        self._conn_anim.addAnimation(fade_out)
        self._conn_anim.addAnimation(fade_in)
        self._conn_anim.addAnimation(stay_green)
        self._conn_anim.setLoopCount(-1)
コード例 #6
0
 def __init__(self, common_settings, parent=None):
     QStatusBar.__init__(self, parent)
     self.common_settings = common_settings
     self.setSizeGripEnabled(False)
     self.timer = QtCore.QTimer(self)
     self.timer.timeout.connect(self.clear_status)
     self.status_txt = QLabel()
     self.status_txt.setStyleSheet("background-color: transparent")
     self.addWidget(self.status_txt)
     self.set_status()
コード例 #7
0
ファイル: mainwindow.py プロジェクト: bjones1/enki
 def __init__(self, *args):
     QStatusBar.__init__(self, *args)
     self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding)
     self.setSizeGripEnabled(False)
     self.setStyleSheet("QStatusBar {border: 0} QStatusBar::item {border: 0}")
     self._label = QLabel(self)
     self._label.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
     self._label.setStyleSheet("color: red")
     self.addWidget(self._label)
     self._timer = QTimer()
     self._timer.setSingleShot(True)
     self._timer.timeout.connect(self.clearMessage)
コード例 #8
0
 def __init__(self, *args):
     QStatusBar.__init__(self, *args)
     self.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Expanding)
     self.setSizeGripEnabled(False)
     self.setStyleSheet("QStatusBar {border: 0} QStatusBar::item {border: 0}")
     self._label = QLabel(self)
     self._label.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
     self._label.setStyleSheet("color: red")
     self.addWidget(self._label)
     self._timer = QTimer()
     self._timer.setSingleShot(True)
     self._timer.timeout.connect(self.clearMessage)
コード例 #9
0
 def __init__(self):
     QStatusBar.__init__(self)
     self.setVisible(False)
コード例 #10
0
    def __init__(self, theParent):
        QStatusBar.__init__(self, theParent)

        logger.debug("Initialising GuiMainStatus ...")

        self.mainConf = nw.CONFIG
        self.theParent = theParent
        self.theTheme = theParent.theTheme
        self.refTime = None

        colNone = QColor(*self.theTheme.statNone)
        colTrue = QColor(*self.theTheme.statUnsaved)
        colFalse = QColor(*self.theTheme.statSaved)

        iPx = self.theTheme.baseIconSize

        # Permanent Widgets
        # =================

        xM = self.mainConf.pxInt(8)

        ## The Spell Checker Language
        self.langIcon = QLabel("")
        self.langText = QLabel("None")
        self.langIcon.setPixmap(
            self.theTheme.getPixmap("status_lang", (iPx, iPx)))
        self.langIcon.setContentsMargins(0, 0, 0, 0)
        self.langText.setContentsMargins(0, 0, xM, 0)
        self.addPermanentWidget(self.langIcon)
        self.addPermanentWidget(self.langText)

        ## The Editor Status
        self.docIcon = StatusLED(colNone, colTrue, colFalse, iPx, iPx, self)
        self.docText = QLabel("Editor")
        self.docIcon.setContentsMargins(0, 0, 0, 0)
        self.docText.setContentsMargins(0, 0, xM, 0)
        self.addPermanentWidget(self.docIcon)
        self.addPermanentWidget(self.docText)

        ## The Project Status
        self.projIcon = StatusLED(colNone, colTrue, colFalse, iPx, iPx, self)
        self.projText = QLabel("Project")
        self.projIcon.setContentsMargins(0, 0, 0, 0)
        self.projText.setContentsMargins(0, 0, xM, 0)
        self.addPermanentWidget(self.projIcon)
        self.addPermanentWidget(self.projText)

        ## The Project and Session Stats
        self.statsIcon = QLabel()
        self.statsText = QLabel("")
        self.statsIcon.setPixmap(
            self.theTheme.getPixmap("status_stats", (iPx, iPx)))
        self.statsIcon.setContentsMargins(0, 0, 0, 0)
        self.statsText.setContentsMargins(0, 0, xM, 0)
        self.addPermanentWidget(self.statsIcon)
        self.addPermanentWidget(self.statsText)

        ## The Session Clock
        ### Set the mimimum width so the label doesn't rescale every second
        self.timeIcon = QLabel()
        self.timeText = QLabel("")
        self.timeIcon.setPixmap(
            self.theTheme.getPixmap("status_time", (iPx, iPx)))
        self.timeText.setToolTip("Session Time")
        self.timeText.setMinimumWidth(self.theTheme.getTextWidth("00:00:00:"))
        self.timeIcon.setContentsMargins(0, 0, 0, 0)
        self.timeText.setContentsMargins(0, 0, 0, 0)
        self.addPermanentWidget(self.timeIcon)
        self.addPermanentWidget(self.timeText)

        # Other Settings
        self.setSizeGripEnabled(True)

        # Start the Clock
        self.sessionTimer = QTimer()
        self.sessionTimer.setInterval(1000)
        self.sessionTimer.timeout.connect(self._updateTime)
        self.sessionTimer.start()

        logger.debug("GuiMainStatus initialisation complete")

        self.clearStatus()

        return
コード例 #11
0
    def __init__(self, theParent):
        QStatusBar.__init__(self, theParent)

        logger.debug("Initialising GuiMainStatus ...")

        self.mainConf   = nw.CONFIG
        self.theParent  = theParent
        self.refTime    = None

        self.iconGrey   = QPixmap(16,16)
        self.iconYellow = QPixmap(16,16)
        self.iconGreen  = QPixmap(16,16)

        self.iconGrey.fill(QColor(*self.theParent.theTheme.statNone))
        self.iconYellow.fill(QColor(*self.theParent.theTheme.statUnsaved))
        self.iconGreen.fill(QColor(*self.theParent.theTheme.statSaved))

        self.boxStats = QLabel()
        self.boxStats.setToolTip("Project Word Count | Session Word Count")

        self.boxTime = QLabel("")
        self.boxTime.setToolTip("Session Time")
        self.boxTime.setAlignment(Qt.AlignRight)
        self.boxTime.setMinimumWidth(80)

        self.boxCounts = QLabel()
        self.boxCounts.setToolTip("Document Character | Word | Paragraph Count")

        self.projChanged = QLabel("")
        self.projChanged.setFixedHeight(16)
        self.projChanged.setFixedWidth(16)
        self.projChanged.setToolTip("Project Changes Saved")

        self.docChanged = QLabel("")
        self.docChanged.setFixedHeight(16)
        self.docChanged.setFixedWidth(16)
        self.docChanged.setToolTip("Document Changes Saved")

        self.boxDocHandle = QLabel()
        self.boxDocHandle.setFrameStyle(QFrame.Panel | QFrame.Sunken);

        # Add Them
        self.addPermanentWidget(self.docChanged)
        self.addPermanentWidget(self.boxCounts)
        self.addPermanentWidget(QLabel("  "))
        self.addPermanentWidget(self.projChanged)
        self.addPermanentWidget(self.boxStats)
        self.addPermanentWidget(self.boxTime)
        if self.mainConf.debugGUI:
            self.addPermanentWidget(self.boxDocHandle)

        self.setSizeGripEnabled(True)

        self.sessionTimer = QTimer()
        self.sessionTimer.setInterval(1000)
        self.sessionTimer.timeout.connect(self._updateTime)
        self.sessionTimer.start()

        logger.debug("GuiMainStatus initialisation complete")

        self.clearStatus()

        return
コード例 #12
0
 def __init__(self):
     QStatusBar.__init__(self)
     self.progress_bar = QProgressBar()
     self.addWidget(self.progress_bar)
コード例 #13
0
    def __init__(self, mainGui):
        QStatusBar.__init__(self, mainGui)

        logger.debug("Initialising GuiMainStatus ...")

        self.mainConf = novelwriter.CONFIG
        self.mainGui = mainGui
        self.mainTheme = mainGui.mainTheme
        self.refTime = None
        self.userIdle = False

        colNone = QColor(*self.mainTheme.statNone)
        colTrue = QColor(*self.mainTheme.statUnsaved)
        colFalse = QColor(*self.mainTheme.statSaved)

        iPx = self.mainTheme.baseIconSize

        # Permanent Widgets
        # =================

        xM = self.mainConf.pxInt(8)

        # The Spell Checker Language
        self.langIcon = QLabel("")
        self.langText = QLabel(self.tr("None"))
        self.langIcon.setPixmap(
            self.mainTheme.getPixmap("status_lang", (iPx, iPx)))
        self.langIcon.setContentsMargins(0, 0, 0, 0)
        self.langText.setContentsMargins(0, 0, xM, 0)
        self.addPermanentWidget(self.langIcon)
        self.addPermanentWidget(self.langText)

        # The Editor Status
        self.docIcon = StatusLED(colNone, colTrue, colFalse, iPx, iPx, self)
        self.docText = QLabel(self.tr("Editor"))
        self.docIcon.setContentsMargins(0, 0, 0, 0)
        self.docText.setContentsMargins(0, 0, xM, 0)
        self.addPermanentWidget(self.docIcon)
        self.addPermanentWidget(self.docText)

        # The Project Status
        self.projIcon = StatusLED(colNone, colTrue, colFalse, iPx, iPx, self)
        self.projText = QLabel(self.tr("Project"))
        self.projIcon.setContentsMargins(0, 0, 0, 0)
        self.projText.setContentsMargins(0, 0, xM, 0)
        self.addPermanentWidget(self.projIcon)
        self.addPermanentWidget(self.projText)

        # The Project and Session Stats
        self.statsIcon = QLabel()
        self.statsText = QLabel("")
        self.statsIcon.setPixmap(
            self.mainTheme.getPixmap("status_stats", (iPx, iPx)))
        self.statsIcon.setContentsMargins(0, 0, 0, 0)
        self.statsText.setContentsMargins(0, 0, xM, 0)
        self.addPermanentWidget(self.statsIcon)
        self.addPermanentWidget(self.statsText)

        # The Session Clock
        # Set the mimimum width so the label doesn't rescale every second
        self.timePixmap = self.mainTheme.getPixmap("status_time", (iPx, iPx))
        self.idlePixmap = self.mainTheme.getPixmap("status_idle", (iPx, iPx))

        self.timeIcon = QLabel()
        self.timeText = QLabel("")
        self.timeIcon.setPixmap(self.timePixmap)
        self.timeText.setToolTip(self.tr("Session Time"))
        self.timeText.setMinimumWidth(self.mainTheme.getTextWidth("00:00:00:"))
        self.timeIcon.setContentsMargins(0, 0, 0, 0)
        self.timeText.setContentsMargins(0, 0, 0, 0)
        self.addPermanentWidget(self.timeIcon)
        self.addPermanentWidget(self.timeText)

        # Other Settings
        self.setSizeGripEnabled(True)

        logger.debug("GuiMainStatus initialisation complete")

        self.clearStatus()

        return
コード例 #14
0
ファイル: statusbar.py プロジェクト: countjocular/novelWriter
    def __init__(self, theParent):
        QStatusBar.__init__(self, theParent)

        logger.debug("Initialising MainStatus ...")

        self.mainConf = nw.CONFIG
        self.theParent = theParent
        self.refTime = None

        self.iconGrey = QPixmap(16, 16)
        self.iconYellow = QPixmap(16, 16)
        self.iconGreen = QPixmap(16, 16)

        self.monoFont = QFont("Monospace", 10)

        self.iconGrey.fill(QColor(*self.theParent.theTheme.statNone))
        self.iconYellow.fill(QColor(*self.theParent.theTheme.statUnsaved))
        self.iconGreen.fill(QColor(*self.theParent.theTheme.statSaved))

        self.boxStats = QLabel()
        self.boxStats.setToolTip("Project Word Count | Session Word Count")

        self.timeBox = QLabel("")
        self.timeBox.setToolTip("Session Time")
        self.timeBox.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
        self.timeBox.setFont(self.monoFont)

        self.timeIcon = QLabel()
        self.timeIcon.setPixmap(
            self.theParent.theTheme.getPixmap("time", (14, 14)))

        self.boxCounts = QLabel()
        self.boxCounts.setToolTip(
            "Document Character | Word | Paragraph Count")

        self.projChanged = QLabel("")
        self.projChanged.setFixedHeight(14)
        self.projChanged.setFixedWidth(14)
        self.projChanged.setToolTip("Project Changes Saved")

        self.docChanged = QLabel("")
        self.docChanged.setFixedHeight(14)
        self.docChanged.setFixedWidth(14)
        self.docChanged.setToolTip("Document Changes Saved")

        self.langBox = QLabel("None")
        self.langIcon = QLabel("")
        self.langIcon.setPixmap(
            self.theParent.theTheme.getPixmap("globe", (14, 14)))

        # Add Them
        self.addPermanentWidget(self.langIcon)
        self.addPermanentWidget(self.langBox)
        self.addPermanentWidget(QLabel("  "))
        self.addPermanentWidget(self.docChanged)
        self.addPermanentWidget(self.boxCounts)
        self.addPermanentWidget(QLabel("  "))
        self.addPermanentWidget(self.projChanged)
        self.addPermanentWidget(self.boxStats)
        self.addPermanentWidget(QLabel("  "))
        self.addPermanentWidget(self.timeIcon)
        self.addPermanentWidget(self.timeBox)

        self.setSizeGripEnabled(True)

        self.sessionTimer = QTimer()
        self.sessionTimer.setInterval(1000)
        self.sessionTimer.timeout.connect(self._updateTime)
        self.sessionTimer.start()

        logger.debug("MainStatus initialisation complete")

        self.clearStatus()

        return
コード例 #15
0
 def __init__(self, parent=None):
     """
     Initialize the status bar.
     """
     QStatusBar.__init__(self, parent)
     self.initUI()
コード例 #16
0
 def __init__(self):
     QStatusBar.__init__(self)
     self.progress_bar = QProgressBar()
     self.progress_bar.setMaximumSize(200, 20)
     self.addWidget(self.progress_bar)