Updated icon and font for session timer, and added language info for status bar

This commit is contained in:
Veronica K. B. Olsen
2019-11-08 19:56:38 +01:00
parent 7fcd0731bf
commit f01c2f9dee
4 changed files with 31 additions and 8 deletions
+22 -7
View File
@@ -19,6 +19,8 @@ from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QIcon, QColor, QPixmap, QFont
from PyQt5.QtWidgets import QStatusBar, QLabel, QFrame
from nw.tools import NWSpellCheck
logger = logging.getLogger(__name__)
class GuiMainStatus(QStatusBar):
@@ -45,10 +47,13 @@ class GuiMainStatus(QStatusBar):
self.boxStats = QLabel()
self.boxStats.setToolTip("Project Word Count | Session Word Count")
self.boxTime = QLabel("")
self.boxTime.setToolTip("Session Time")
self.boxTime.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
self.boxTime.setFont(self.monoFont)
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")
@@ -63,16 +68,22 @@ class GuiMainStatus(QStatusBar):
self.docChanged.setFixedWidth(14)
self.docChanged.setToolTip("Document Changes Saved")
self.docLanguage = QLabel("")
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.boxTime)
self.addPermanentWidget(self.timeIcon)
self.addPermanentWidget(self.timeBox)
self.setSizeGripEnabled(True)
@@ -104,6 +115,10 @@ class GuiMainStatus(QStatusBar):
self.showMessage(theMessage, int(timeOut*1000))
return
def setLanguage(self, theLanguage):
self.langBox.setText(NWSpellCheck.expandLanguage(theLanguage))
return
def setProjectStatus(self, isChanged):
if isChanged is None:
self.projChanged.setPixmap(self.iconGrey)
@@ -149,7 +164,7 @@ class GuiMainStatus(QStatusBar):
tM = tM - tH*60
tS = tS - tM*60 - tH*3600
theTime = "%02d:%02d:%02d" % (tH,tM,tS)
self.boxTime.setText(theTime)
self.timeBox.setText(theTime)
return
# END Class GuiMainStatus