Commit cc0b66b4 authored by Allen Winter's avatar Allen Winter
Browse files

korgac/alarmdialog.cpp - fix column resizing

parent 0e6dedd3
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QPushButton> #include <QPushButton>
#include <QToolButton> #include <QToolButton>
#include <QHeaderView>
using namespace KIdentityManagement; using namespace KIdentityManagement;
using namespace KCalendarCore; using namespace KCalendarCore;
...@@ -245,12 +246,20 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par ...@@ -245,12 +246,20 @@ AlarmDialog::AlarmDialog(const Akonadi::ETMCalendar::Ptr &calendar, QWidget *par
<< i18nc("@title:column happens at date/time", "Date Time") << i18nc("@title:column happens at date/time", "Date Time")
<< i18nc("@title:column trigger date/time", "Trigger Time")); << i18nc("@title:column trigger date/time", "Trigger Time"));
mIncidenceTree->setHeaderLabels(headerLabels); mIncidenceTree->setHeaderLabels(headerLabels);
QHeaderView *header = mIncidenceTree->header();
header->setSectionResizeMode(0, QHeaderView::Stretch);
mIncidenceTree->headerItem()->setToolTip( mIncidenceTree->headerItem()->setToolTip(
0, 0,
i18nc("@info:tooltip", "The event or to-do title")); i18nc("@info:tooltip", "The event or to-do title"));
header->setSectionResizeMode(1, QHeaderView::ResizeToContents);
mIncidenceTree->headerItem()->setToolTip( mIncidenceTree->headerItem()->setToolTip(
1, 1,
i18nc("@info:tooltip", "The reminder is set for this date/time")); i18nc("@info:tooltip", "The reminder is set for this date/time"));
header->setSectionResizeMode(2, QHeaderView::ResizeToContents);
header->setStretchLastSection(false);
mIncidenceTree->headerItem()->setToolTip( mIncidenceTree->headerItem()->setToolTip(
2, 2,
i18nc("@info:tooltip", "The date/time the reminder was triggered")); i18nc("@info:tooltip", "The date/time the reminder was triggered"));
...@@ -378,16 +387,8 @@ ReminderTreeItem *AlarmDialog::searchByItem(const Akonadi::Item &incidence) ...@@ -378,16 +387,8 @@ ReminderTreeItem *AlarmDialog::searchByItem(const Akonadi::Item &incidence)
static QString cleanSummary(const QString &summary) static QString cleanSummary(const QString &summary)
{ {
static QString etc = i18nc("@label an ellipsis", "...");
int maxLen = 30;
QString retStr = summary; QString retStr = summary;
retStr.replace(QLatin1Char('\n'), QLatin1Char(' ')); return retStr.replace(QLatin1Char('\n'), QLatin1Char(' '));
if (retStr.length() > maxLen) {
maxLen -= etc.length();
retStr.truncate(maxLen);
retStr += etc;
}
return retStr;
} }
void AlarmDialog::addIncidence(const Akonadi::Item &incidenceitem, void AlarmDialog::addIncidence(const Akonadi::Item &incidenceitem,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment