aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-24 17:04:16 +0200
committerDanilo M. <danix@danix.xyz>2026-09-24 17:04:16 +0200
commitab9bad27b4aab552d3aa95164eefacf4945c1d60 (patch)
tree9e50c9b621b2393c2aa7a63897580b8fe9f6fd48
parentc1fc03f2eccad138361d4205e0b56ba832fe73ae (diff)
downloadqtmaildir-ab9bad27b4aab552d3aa95164eefacf4945c1d60.tar.gz
qtmaildir-ab9bad27b4aab552d3aa95164eefacf4945c1d60.zip
fix: show the collection swatch and translate the attendee line in the event pane
-rw-r--r--src/eventpane.cpp18
-rw-r--r--src/eventpane.h1
2 files changed, 16 insertions, 3 deletions
diff --git a/src/eventpane.cpp b/src/eventpane.cpp
index 1b63fd5..c83a569 100644
--- a/src/eventpane.cpp
+++ b/src/eventpane.cpp
@@ -96,9 +96,17 @@ QWidget *EventPane::buildDetails()
m_notes = plainLabel(page);
m_reminder = plainLabel(page);
m_people = plainLabel(page);
+ m_calendarSwatch = new QLabel(page);
+ m_calendarSwatch->setFixedSize(12, 12);
+ auto *calendarRow = new QWidget(page);
+ auto *calendarLayout = new QHBoxLayout(calendarRow);
+ calendarLayout->setContentsMargins(0, 0, 0, 0);
+ calendarLayout->setSpacing(4);
+ calendarLayout->addWidget(m_calendarSwatch);
+ calendarLayout->addWidget(m_calendar, 1);
form->addRow(tr("When"), m_when);
form->addRow(tr("Repeats"), m_repeatText);
- form->addRow(tr("Calendar"), m_calendar);
+ form->addRow(tr("Calendar"), calendarRow);
form->addRow(tr("Location"), m_location);
form->addRow(tr("Notes"), m_notes);
form->addRow(tr("Reminder"), m_reminder);
@@ -407,6 +415,10 @@ void EventPane::showDetails(const CalEvent &event, const CalCollection &collecti
m_repeatText->setText(event.repeat.freq == RepeatRule::Freq::None && !event.repeat.custom
? tr("Does not repeat") : event.repeat.describe());
m_calendar->setText(collection.displayName);
+ if (collection.color.isValid())
+ m_calendarSwatch->setPixmap(swatch(collection.color).pixmap(12, 12));
+ else
+ m_calendarSwatch->clear();
m_location->setText(ov ? ov->location : event.location);
m_notes->setText(ov ? ov->description : event.description);
m_reminder->setText(event.hasAlarm ? tr("Yes, kept as set elsewhere") : tr("None"));
@@ -416,8 +428,8 @@ void EventPane::showDetails(const CalEvent &event, const CalCollection &collecti
people << tr("Organiser: %1").arg(event.organizer.name.isEmpty()
? event.organizer.address : event.organizer.name);
for (const CalPerson &a : event.attendees)
- people << QStringLiteral("%1 (%2)").arg(a.name.isEmpty() ? a.address : a.name,
- a.partstat.isEmpty() ? tr("no reply") : a.partstat.toLower());
+ people << tr("%1 (%2)").arg(a.name.isEmpty() ? a.address : a.name,
+ a.partstat.isEmpty() ? tr("no reply") : a.partstat.toLower());
m_people->setText(people.join(QLatin1Char('\n')));
QString notice;
diff --git a/src/eventpane.h b/src/eventpane.h
index 149d96d..0be4661 100644
--- a/src/eventpane.h
+++ b/src/eventpane.h
@@ -82,6 +82,7 @@ private:
QLabel *m_when;
QLabel *m_repeatText;
QLabel *m_calendar;
+ QLabel *m_calendarSwatch;
QLabel *m_location;
QLabel *m_notes;
QLabel *m_reminder;