summaryrefslogtreecommitdiff
path: root/src/entry.cpp
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-03-09 16:53:38 -0500
committerLouie S <louie@example.com>2024-03-09 16:53:38 -0500
commitafcae23cbf63b31a7ce111ffcd76c027b332bdf9 (patch)
treee86001041d05e13cb778ada13c5a3addccf93a8d /src/entry.cpp
parent312ea44966ca5ee65185fc837d15143e7dd59761 (diff)
Break entry/group/rule into sub-classes
Diffstat (limited to 'src/entry.cpp')
-rw-r--r--src/entry.cpp73
1 files changed, 0 insertions, 73 deletions
diff --git a/src/entry.cpp b/src/entry.cpp
index cdaa69a..4876641 100644
--- a/src/entry.cpp
+++ b/src/entry.cpp
@@ -1,5 +1,3 @@
-#include <QLabel>
-
#include "entry.h"
Entry::Entry(int id, int parent_id, QString desc, QDateTime due, QString due_alt, QUrl link, QString color, QString highlight, bool done, bool hidden) :
@@ -14,75 +12,4 @@ Entry::Entry(int id, int parent_id, QString desc, QDateTime due, QString due_alt
done(done),
hidden(hidden)
{
- QLabel *bullet = new QLabel();
- QLabel *body = new QLabel();
-
- // set styling
- this->setContentsMargins(2, 2, 2, 2);
-
- bullet->setFont(QFont("Arial", 11));
- bullet->setMaximumWidth(15);
-
- body->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
- body->setFont(QFont("Arial", 11));
- body->setWordWrap(true);
- body->setToolTip("Right-Click for actions");
-
- // Check rules
- // TODO
-
- // set conditional styling
- if(this->done) {
- bullet->setText("\u2713");
- /*
- bullet->setStyleSheet(
- "QLabel {"
- " color: green;"
- "}"
- );
- */
- }
- else
- bullet->setText("- ");
- this->addWidget(bullet);
-
- if(!this->due.isNull())
- body->setText(this->due.toString("MM/dd/yyyy: "));
- else if(!this->due_alt.isEmpty())
- body->setText(this->due_alt + ": ");
-
- if(!this->link.isEmpty()) {
- body->setOpenExternalLinks(true);
- body->setText(body->text() + "<a href=\"" + this->link.toString() + "\" " "style=\"color: " + (this->color.isEmpty() ? "default" : this->color ) + ";\">");
- }
- body->setText(body->text() + this->desc);
- if(!this->link.isEmpty()) {
- body->setText(body->text() + "</a>");
- body->setToolTip(this->link.toString());
- }
-
- if(this->done) {
- QFont body_font = body->font();
- body_font.setStrikeOut(true);
- body->setFont(body_font);
- /*
- body->setStyleSheet(
- "QLabel {"
- " color: green"
- "}"
- );
- */
- }
- else {
- /*
- body->setStyleSheet(
- "QLabel {"
- " color: " + (this->color.isEmpty() ? "default" : this->color) + ";"
- " background-color: " + (this->highlight.isEmpty() ? "none" : this->highlight) + ";"
- " font-weight: " + (this->due.isValid() && this->due <= QDateTime::currentDateTime() ? "bold" : "normal") + ";"
- ";"
- );
- */
- }
- this->addWidget(body);
}