-
-
Notifications
You must be signed in to change notification settings - Fork 530
Expand file tree
/
Copy pathappIcon.js
More file actions
58 lines (53 loc) · 1.73 KB
/
appIcon.js
File metadata and controls
58 lines (53 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class AppIcon {
constructor ({
platform,
paused,
monochrome,
inverted,
darkMode,
timeToBreakInTray,
timeToBreak,
reference
}) {
this.platform = platform
this.paused = paused
this.monochrome = monochrome
this.inverted = inverted
this.darkMode = darkMode
this.timeToBreakInTray = timeToBreakInTray
this.timeToBreak = timeToBreak
this.reference = reference
}
get trayIconFileName () {
const pausedString = this.paused ? 'Paused' : ''
const invertedMonochromeString = this.inverted ? 'Inverted' : ''
const darkModeString = this.darkMode ? 'Dark' : ''
const timeToBreakInTrayString = (this.paused || this.reference === 'finishMicrobreak' ||
this.reference === 'finishBreak' || !this.timeToBreakInTray || !Number.isInteger(this.timeToBreak) || this.timeToBreak < 0)
? ''
: `Number${this.timeToBreak}`
if (this.monochrome) {
if (this.platform === 'darwin') {
return `trayMacMonochrome${pausedString}${timeToBreakInTrayString}Template.png`
} else {
return `trayMonochrome${invertedMonochromeString}${pausedString}${timeToBreakInTrayString}.png`
}
} else {
if (this.platform === 'darwin') {
return `trayMac${pausedString}${darkModeString}${timeToBreakInTrayString}.png`
} else {
return `tray${pausedString}${darkModeString}${timeToBreakInTrayString}.png`
}
}
}
get windowIconFileName () {
const invertedMonochromeString = this.inverted ? 'Inverted' : ''
const darkModeString = this.darkMode ? 'Dark' : ''
if (this.monochrome) {
return `trayMonochrome${invertedMonochromeString}.png`
} else {
return `tray${darkModeString}.png`
}
}
}
export default AppIcon