Skip to content

Commit 697537c

Browse files
authored
Merge pull request #1703 from hovancik/tray-icons-prefs
Adds new icon styles preference for tray
2 parents 753b2a3 + 1a6be66 commit 697537c

File tree

2,070 files changed

+597
-219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,070 files changed

+597
-219
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions

README.md

Lines changed: 1 addition & 4 deletions

app/breaksPlanner.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ class BreaksPlanner extends EventEmitter {
272272
}
273273

274274
get timeToNextBreak () {
275+
if (!this.scheduler) return null
275276
if (this.scheduler.reference === 'startMicrobreak' || this.scheduler.reference === 'startBreak') {
276277
return this.scheduler.timeLeft
277278
}
@@ -287,6 +288,34 @@ class BreaksPlanner extends EventEmitter {
287288
}
288289
return null
289290
}
291+
292+
get _progressInterval () {
293+
if (!this.scheduler) return null
294+
const { reference, delay } = this.scheduler
295+
296+
if (reference === 'startMicrobreak' || reference === 'startBreak') {
297+
return delay
298+
}
299+
300+
if (reference === 'startBreakNotification') {
301+
return delay + this.settings.get('breakNotificationInterval')
302+
}
303+
304+
if (reference === 'startMicrobreakNotification') {
305+
return delay + this.settings.get('microbreakNotificationInterval')
306+
}
307+
308+
return null
309+
}
310+
311+
get progressPercentage () {
312+
const total = this._progressInterval
313+
const remaining = this.timeToNextBreak
314+
if (total === null || total <= 0 || remaining === null) return 0
315+
316+
const progress = 1 - (remaining / total)
317+
return Math.max(0, Math.min(100, Math.round(progress * 100)))
318+
}
290319
}
291320

292321
export default BreaksPlanner

app/contributor-preferences.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -483,23 +483,20 @@
483483
</select>
484484
</div>
485485
</div>
486+
486487
<div>
487488
<hr>
488489
</div>
489-
<div>
490-
<span data-i18next="contributorPreferences.timeToBreakInTray"></span>
491-
</div>
492-
<div>
493-
<input type="checkbox" value="timeToBreakInTray" id="showTimeToBreakInTray">
494-
<label data-i18next="contributorPreferences.showTimeToBreakInTray" for="showTimeToBreakInTray"></label>
495-
</div>
496490
<div>
497491
<span data-i18next="contributorPreferences.showTrayIcon"></span>
498492
</div>
499493
<div>
500494
<input type="checkbox" value="showTrayIcon" id="toShowTrayIcon">
501495
<label data-i18next="contributorPreferences.toShowTrayIcon" for="toShowTrayIcon"></label>
502496
</div>
497+
<div>
498+
<hr>
499+
</div>
503500
<div>
504501
<span data-i18next="contributorPreferences.currentTimeInBreaks"></span>
505502
</div>

app/css/contributor.css

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,15 @@ body[dir=rtl] .contributor-preferences > :nth-child(61) {
174174
text-align: left;
175175
}
176176

177-
.contributor-preferences > :nth-child(63) {
178-
grid-column: 1/2;
179-
grid-row: 49/50;
180-
padding: 0 16px;
181-
text-align: right;
182-
}
183177

184-
body[dir=rtl] .contributor-preferences > :nth-child(63) {
185-
text-align: left;
178+
.contributor-preferences > :nth-child(64) {
179+
grid-column: 1/2;
180+
grid-row: 50/51;
181+
padding: 0 16px;
182+
text-align: right;
186183
}
187184

188-
.contributor-preferences > :nth-child(65) {
189-
grid-column: 1/2;
190-
grid-row: 50/51;
191-
padding: 0 16px;
192-
text-align: right;
185+
body[dir=rtl] .contributor-preferences > :nth-child(64) {
186+
text-align: left;
193187
}
194188

195-
body[dir=rtl] .contributor-preferences > :nth-child(65) {
196-
text-align: left;
197-
}

app/css/preferences.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ body[dir=rtl] .theme > :nth-child(10) {
171171

172172
.theme > :nth-child(17) {
173173
grid-column: 1/2;
174-
grid-row: 14/17;
174+
grid-row: 15/18;
175175
padding: 0 16px;
176176
text-align: right;
177177
}
639 Bytes
484 Bytes
1.17 KB
1.16 KB

0 commit comments

Comments
 (0)