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 EventViews
Commits
d3d4f80f
Commit
d3d4f80f
authored
Oct 03, 2021
by
Glen Ditchfield
🐛
Browse files
Add changes ignored by the git merge
parent
8f4b4fad
Pipeline
#84498
passed with stage
in 10 minutes and 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/month/monthscene.cpp
View file @
d3d4f80f
...
...
@@ -217,6 +217,15 @@ void MonthGraphicsView::drawBackground(QPainter *p, const QRectF &rect)
const
QList
<
QDate
>
workDays
=
CalendarSupport
::
workDays
(
mMonthView
->
actualStartDateTime
().
date
(),
mMonthView
->
actualEndDateTime
().
date
());
QRect
todayRect
;
QRect
selectedRect
;
QColor
holidayBg
;
QColor
workdayBg
;
if
(
mMonthView
->
preferences
()
->
useSystemColor
())
{
workdayBg
=
palette
().
color
(
QPalette
::
Base
);
holidayBg
=
palette
().
color
(
QPalette
::
AlternateBase
);
}
else
{
workdayBg
=
mMonthView
->
preferences
()
->
monthGridWorkHoursBackgroundColor
();
holidayBg
=
mMonthView
->
preferences
()
->
monthGridBackgroundColor
();
}
for
(
QDate
d
=
start
;
d
<=
end
;
d
=
d
.
addDays
(
1
))
{
const
MonthCell
*
const
cell
=
mScene
->
mMonthCellMap
.
value
(
d
);
...
...
@@ -227,36 +236,18 @@ void MonthGraphicsView::drawBackground(QPainter *p, const QRectF &rect)
return
;
}
MonthCell
*
cell
=
mScene
->
mMonthCellMap
[
d
];
const
QRect
cellRect
(
mScene
->
cellHorizontalPos
(
cell
),
mScene
->
cellVerticalPos
(
cell
),
columnWidth
,
rowHeight
);
QColor
color
;
if
(
!
mMonthView
->
preferences
()
->
useSystemColor
())
{
if
(
workDays
.
contains
(
d
))
{
color
=
mMonthView
->
preferences
()
->
monthGridWorkHoursBackgroundColor
();
}
else
{
color
=
mMonthView
->
preferences
()
->
monthGridBackgroundColor
();
}
}
else
{
if
(
workDays
.
contains
(
d
))
{
color
=
palette
().
color
(
QPalette
::
Base
);
}
else
{
color
=
palette
().
color
(
QPalette
::
AlternateBase
);
}
}
if
(
cell
==
mScene
->
selectedCell
())
{
selectedRect
=
cellRect
;
}
if
(
cell
->
date
()
==
QDate
::
current
Date
()
)
{
if
(
cell
->
date
()
==
today
Date
)
{
todayRect
=
cellRect
;
}
// Draw cell
p
->
setPen
(
mMonthView
->
preferences
()
->
monthGridBackgroundColor
().
darker
(
150
));
p
->
setBrush
(
color
);
p
->
setBrush
(
workDays
.
contains
(
d
)
?
workdayBg
:
holidayBg
);
p
->
drawRect
(
cellRect
);
if
(
mMonthView
->
isBusyDay
(
d
))
{
QColor
busyColor
=
mMonthView
->
preferences
()
->
viewBgBusyColor
();
busyColor
.
setAlpha
(
EventViews
::
BUSY_BACKGROUND_ALPHA
);
...
...
@@ -307,23 +298,8 @@ void MonthGraphicsView::drawBackground(QPainter *p, const QRectF &rect)
p
->
setPen
(
Qt
::
NoPen
);
p
->
drawRect
(
QRect
(
cellHeaderX
,
cellHeaderY
,
cellHeaderWidth
,
cellHeaderHeight
));
// Draw cell header
int
cellHeaderX
=
mScene
->
cellHorizontalPos
(
cell
)
+
1
;
int
cellHeaderY
=
mScene
->
cellVerticalPos
(
cell
)
+
1
;
int
cellHeaderWidth
=
columnWidth
-
2
;
int
cellHeaderHeight
=
cell
->
topMargin
()
-
2
;
QLinearGradient
bgGradient
(
QPointF
(
cellHeaderX
,
cellHeaderY
),
QPointF
(
cellHeaderX
+
cellHeaderWidth
,
cellHeaderY
+
cellHeaderHeight
));
const
auto
brush
=
KColorScheme
(
QPalette
::
Normal
,
KColorScheme
::
ColorSet
::
Header
).
background
(
KColorScheme
::
BackgroundRole
::
NormalBackground
);
p
->
setBrush
(
brush
);
bgGradient
.
setColorAt
(
1
,
brush
.
color
());
p
->
setPen
(
Qt
::
NoPen
);
p
->
drawRect
(
QRect
(
cellHeaderX
,
cellHeaderY
,
cellHeaderWidth
,
cellHeaderHeight
));
if
(
cell
->
date
()
==
QDate
::
currentDate
())
{
font
.
setBold
(
true
);
}
else
{
font
.
setBold
(
false
);
}
QFont
font
=
p
->
font
();
font
.
setBold
(
cell
->
date
()
==
todayDate
);
p
->
setFont
(
font
);
if
(
d
.
month
()
==
mMonthView
->
currentMonth
())
{
...
...
Write
Preview
Supports
Markdown
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