Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kalendar
Commits
83c3eda9
Commit
83c3eda9
authored
Feb 10, 2022
by
Claudio Cambra
Browse files
Week/threeday/day views now correctly start up with current time in view
parent
d8a1f315
Pipeline
#135561
passed with stage
in 1 minute and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/contents/ui/HourlyView.qml
View file @
83c3eda9
...
...
@@ -64,7 +64,7 @@ Kirigami.Page {
color
:
Kirigami
.
Theme
.
backgroundColor
}
function
setToDate
(
date
,
isInitialWeek
=
false
)
{
function
setToDate
(
date
,
isInitialWeek
=
false
,
animate
=
false
)
{
if
(
!
pathView
.
currentItem
)
{
return
;
}
...
...
@@ -99,7 +99,7 @@ Kirigami.Page {
selectedDate
=
date
;
if
(
isInitialWeek
)
{
pathView
.
currentItem
.
item
.
hourScrollView
.
setToCurrentTime
();
pathView
.
currentItem
.
item
.
hourScrollView
.
setToCurrentTime
(
animate
);
}
else
{
pathView
.
currentItem
.
item
.
hourScrollView
.
setPosition
(
position
);
}
...
...
@@ -122,7 +122,7 @@ Kirigami.Page {
readonly
property
Kirigami.Action
todayAction
:
Kirigami.Action
{
icon.name
:
"
go-jump-today
"
text
:
i18n
(
"
Now
"
)
onTriggered
:
setToDate
(
new
Date
(),
true
);
onTriggered
:
setToDate
(
new
Date
(),
true
,
true
);
}
actions
{
...
...
@@ -651,7 +651,7 @@ Kirigami.Page {
easing.type
:
Easing
.
InOutQuad
}
function
setToCurrentTime
()
{
function
setToCurrentTime
(
animate
=
false
)
{
if
(
currentTimeMarkerLoader
.
active
)
{
const
viewHeight
=
(
applicationWindow
().
height
-
applicationWindow
().
pageStack
.
globalToolBar
.
height
-
headerBottomSeparator
.
height
-
allDayHeader
.
height
-
headerTopSeparator
.
height
-
headingRow
.
height
-
Kirigami
.
Units
.
gridUnit
);
// Since we position with anchors, height is 0 -- must calc manually
...
...
@@ -661,8 +661,15 @@ Kirigami.Page {
yPos
=
Math
.
max
(
0.0
,
yPos
);
yPos
=
vScrollBar
.
size
?
Math
.
min
(
vScrollBar
.
size
,
yPos
)
:
Math
.
min
(
1.0
,
yPos
);
scrollAnimation
.
to
=
yPos
;
scrollAnimation
.
start
();
if
(
animate
)
{
scrollAnimation
.
to
=
yPos
;
if
(
scrollAnimation
.
running
)
{
scrollAnimation
.
stop
();
}
scrollAnimation
.
start
();
}
else
{
vScrollBar
.
position
=
yPos
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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