Commit 36941c61 authored by Glen Ditchfield's avatar Glen Ditchfield 🐛 Committed by Glen Ditchfield
Browse files

Shorten holiday names to fit the Agenda view's header

If the Agenda view displays many days, holiday names may be too wide to
fit in their days' column headers, causing the misalignments reported in
BUG: 225498

This patch shortens the name to ft.  Original patch by m4rkusxxl at web.de.
parent e1b591a2
Pipeline #68924 passed with stage
in 7 minutes and 35 seconds
......@@ -1215,10 +1215,10 @@ void AgendaView::createDayLabels(bool force)
d->mDateDayLabels.append(dayLabel);
// if a holiday region is selected, show the holiday name
const QStringList texts = CalendarSupport::holiday(date);
const int columnWidth = (d->mTopDayLabelsFrame->width() - (!d->mIsSideBySide ? d->mTimeLabelsZone->width() : 0)
- SPACING - d->mAllDayAgenda->scrollArea()->frameWidth()) / d->mSelectedDates.count();
for (const QString &text : texts) {
// Compute a small version of the holiday string for AlternateLabel
const KWordWrap ww = KWordWrap::formatText(fm, topDayLabelBox->rect(), 0, text, -1);
auto label = new AlternateLabel(ww.truncatedString(), text, text, topDayLabelBox);
auto label = new AlternateLabel(fm.elidedText(text, Qt::ElideRight, columnWidth), text, text, topDayLabelBox);
topDayLabelBoxLayout->addWidget(label);
label->setAlignment(Qt::AlignCenter);
}
......
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