Skip to content

Commit 8683cb7

Browse files
once again
1 parent ed4a393 commit 8683cb7

File tree

3 files changed

+32
-33
lines changed

3 files changed

+32
-33
lines changed

library/Notifications/Widget/TimeGrid/BaseGrid.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,7 @@ final protected function yieldFixedEntries(Traversable $entries): Generator
427427
}
428428

429429
if ($entry instanceof FutureEntry) {
430-
// (no. of days * - 2) - 1, example: 7 days (week) = -15
431-
$colStart = (($this->getNoOfVisuallyConnectedHours() / 24) * - 2) - 1;
432-
//$colStart = ($this->getNoOfVisuallyConnectedHours() / 24 + 1) * - 1;
430+
$colStart = 1;
433431
$colEnd = $gridBorderAt;
434432
} else {
435433
$actualStart = Util::roundToNearestThirtyMinute($entry->getStart());

library/Notifications/Widget/Timeline/FutureEntry.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ class FutureEntry extends Entry
1414
{
1515
public function getColor(int $transparency): string
1616
{
17-
return sprintf('~"hsl(%d %d%% 50%% / %d%%)"', 166, 90, $transparency);
17+
return sprintf('~"hsl(166 90%% 50%% / %d%%)"', $transparency);
1818
}
1919

2020
protected function assembleContainer(BaseHtmlElement $container): void
2121
{
22-
$container
23-
->addAttributes(new Attributes(['class' => 'future']))
24-
->addHtml(
25-
new HtmlElement(
26-
'div',
27-
Attributes::create([
28-
'class' => 'badgeX',
29-
'title' => $this->translate('rotation starts in the future')
30-
]),
31-
new Icon('angle-right')
32-
)
22+
$futureBadge = new HtmlElement(
23+
'div',
24+
new Attributes([
25+
'title' => $this->translate('Rotation starts in the future'),
26+
$container->getAttributes()->get('class')
27+
]),
28+
new Icon('angle-right')
3329
);
30+
31+
$container
32+
->setAttribute('class' , 'future-entry') // override the default class
33+
->addHtml($futureBadge);
3434
}
3535
}

public/css/timeline.less

+19-18
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,34 @@
4444
}
4545
}
4646

47-
.overlay .entry {
48-
margin-top: 1em;
49-
margin-bottom: 1em;
50-
51-
.title {
52-
height: 100%;
53-
flex-wrap: nowrap;
54-
align-items: baseline;
55-
padding: .15em .5em;
56-
57-
.name {
58-
.text-ellipsis();
47+
.overlay {
48+
.entry {
49+
margin-top: 1em;
50+
margin-bottom: 1em;
51+
52+
.title {
53+
height: 100%;
54+
flex-wrap: nowrap;
55+
align-items: baseline;
56+
padding: .15em .5em;
57+
58+
.name {
59+
.text-ellipsis();
60+
}
5961
}
6062
}
6163

62-
&.future {
64+
.future-entry {
6365
display: flex;
6466
justify-content: end;
65-
// overflow: visible;
6667

67-
.badgeX {
68+
.entry {
6869
display: flex;
6970
align-items: center;
7071
justify-content: center;
7172

7273
position: relative;
73-
padding-left: 6px; // 4px before + 1px border + 2px after + 1px border
74+
padding-left: 6px; // 2px before + 1px border + 2px after + 1px border
7475

7576
width: 2em;
7677
flex-shrink: 0;
@@ -84,12 +85,12 @@
8485
border-right: transparent;
8586
height: ~"calc(100% + 2px)"; // border top and bottom
8687
width: 100%;
87-
left: 4px; // 1px border + 3px distance
88+
left: 2px;
8889
.rounded-corners(0.25em);
8990
}
9091

9192
&:after {
92-
left: 7px; // 4px before + 1px border + 2px after
93+
left: 5px; // 2px before + 1px border + 2px after
9394
}
9495
}
9596
}

0 commit comments

Comments
 (0)