summaryrefslogtreecommitdiff
path: root/entry.py
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-09-16 09:36:14 -0400
committerLouie S <louie@example.com>2023-09-16 09:36:14 -0400
commitfe34cdaa6bd0efdc605ae89c96d7075645eaa5fd (patch)
tree9650abd173a803d32f9305812925f8dfa01b8043 /entry.py
parent6e52afa26d8c50d07988376e43a641c70370b9c5 (diff)
Add bolding to entries that are due today or earlier
Diffstat (limited to 'entry.py')
-rw-r--r--entry.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/entry.py b/entry.py
index 0a0b3b1..addc96a 100644
--- a/entry.py
+++ b/entry.py
@@ -1,3 +1,4 @@
+from datetime import date, datetime
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QHBoxLayout, QLabel
@@ -39,10 +40,17 @@ class Entry:
output.addWidget(bullet)
if self.due:
- body.setText("{0}/{1}/{2}: ".format(self.due.month(), self.due.day(), self.due.year()))
+ body.setText("{0}/{1}/{2}: ".format(
+ self.due.month(),
+ self.due.day(),
+ self.due.year()
+ ))
if self.link:
body.setOpenExternalLinks(True)
- body.setText(body.text() + "<a href=\"{0}\" style=\"color: {1}; text-decoration: none;\">".format(self.link, self.color if self.color else "default"))
+ body.setText(body.text() + "<a href=\"{0}\" style=\"color: {1};\">".format(
+ self.link,
+ self.color if self.color else "default"
+ ))
body.setText(body.text() + self.desc)
if self.link:
body.setText(body.text() + "</a>")
@@ -66,9 +74,11 @@ class Entry:
QLabel{{
color: {0};
background-color: {1};
+ font-weight: {2};
}}""".format(
self.color if self.color else "default",
- self.highlight if self.highlight else "none"
+ self.highlight if self.highlight else "none",
+ "bold" if self.due and self.due <= date.today() else "normal"
))
return output