Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Calendar Support
Commits
2005110e
Commit
2005110e
authored
Sep 12, 2021
by
Glen Ditchfield
🐛
Browse files
Truncate holiday names in print-outs so they don't overlap dates
parent
8d5ee7e4
Pipeline
#80093
passed with stage
in 4 minutes and 33 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/printing/calprintpluginbase.cpp
View file @
2005110e
...
@@ -1011,15 +1011,17 @@ void CalPrintPluginBase::drawDayBox(QPainter &p,
...
@@ -1011,15 +1011,17 @@ void CalPrintPluginBase::drawDayBox(QPainter &p,
QString
hstring
(
holidayString
(
qd
));
QString
hstring
(
holidayString
(
qd
));
const
QFont
oldFont
(
p
.
font
());
const
QFont
oldFont
(
p
.
font
());
QRect
headerTextBox
(
subHeaderBox
);
QRect
headerTextBox
(
subHeaderBox
.
adjusted
(
5
,
0
,
-
5
,
0
));
headerTextBox
.
setLeft
(
subHeaderBox
.
left
()
+
5
);
p
.
setFont
(
QFont
(
QStringLiteral
(
"sans-serif"
),
10
,
QFont
::
Bold
));
headerTextBox
.
setRight
(
subHeaderBox
.
right
()
-
5
);
QRect
dayNumRect
;
p
.
drawText
(
headerTextBox
,
Qt
::
AlignRight
|
Qt
::
AlignVCenter
,
dayNumStr
,
&
dayNumRect
);
if
(
!
hstring
.
isEmpty
())
{
if
(
!
hstring
.
isEmpty
())
{
p
.
setFont
(
QFont
(
QStringLiteral
(
"sans-serif"
),
8
,
QFont
::
Bold
,
true
));
p
.
setFont
(
QFont
(
QStringLiteral
(
"sans-serif"
),
8
,
QFont
::
Bold
,
true
));
QFontMetrics
fm
(
p
.
font
());
hstring
=
fm
.
elidedText
(
hstring
,
Qt
::
ElideRight
,
headerTextBox
.
width
()
-
dayNumRect
.
width
()
-
5
);
p
.
drawText
(
headerTextBox
,
Qt
::
AlignLeft
|
Qt
::
AlignVCenter
,
hstring
);
p
.
drawText
(
headerTextBox
,
Qt
::
AlignLeft
|
Qt
::
AlignVCenter
,
hstring
);
}
p
.
setFont
(
QFont
(
QStringLiteral
(
"sans-serif"
),
10
,
QFont
::
Bold
));
p
.
setFont
(
QFont
(
QStringLiteral
(
"sans-serif"
),
10
,
QFont
::
Bold
));
p
.
drawText
(
headerTextBox
,
Qt
::
AlignRight
|
Qt
::
AlignVCenter
,
dayNumStr
);
}
const
KCalendarCore
::
Event
::
List
eventList
=
const
KCalendarCore
::
Event
::
List
eventList
=
mCalendar
->
events
(
qd
,
QTimeZone
::
systemTimeZone
(),
KCalendarCore
::
EventSortStartDate
,
KCalendarCore
::
SortDirectionAscending
);
mCalendar
->
events
(
qd
,
QTimeZone
::
systemTimeZone
(),
KCalendarCore
::
EventSortStartDate
,
KCalendarCore
::
SortDirectionAscending
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment