Changeset View
Changeset View
Standalone View
Standalone View
src/kcm/package/contents/code/icon.js
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | Copyright 2014-2015 Harald Sitter <sitter@kde.org> | 2 | Copyright 2014-2015 Harald Sitter <sitter@kde.org> | ||
3 | Copyright 2019 Sefa Eyeoglu <contact@scrumplex.net> | | |||
4 | 3 | | |||
5 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Lesser General Public | 5 | modify it under the terms of the GNU Lesser General Public | ||
7 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either | ||
8 | version 2.1 of the License, or (at your option) version 3, or any | 7 | version 2.1 of the License, or (at your option) version 3, or any | ||
9 | later version accepted by the membership of KDE e.V. (or its | 8 | later version accepted by the membership of KDE e.V. (or its | ||
10 | successor approved by the membership of KDE e.V.), which shall | 9 | successor approved by the membership of KDE e.V.), which shall | ||
11 | act as a proxy defined in Section 6 of version 3 of the license. | 10 | act as a proxy defined in Section 6 of version 3 of the license. | ||
Show All 19 Lines | 29 | } else if (percent <= 0.25) { | |||
31 | icon = prefix + "-low"; | 30 | icon = prefix + "-low"; | ||
32 | } else if (percent <= 0.75) { | 31 | } else if (percent <= 0.75) { | ||
33 | icon = prefix + "-medium"; | 32 | icon = prefix + "-medium"; | ||
34 | } else { | 33 | } else { | ||
35 | icon = prefix + "-high"; | 34 | icon = prefix + "-high"; | ||
36 | } | 35 | } | ||
37 | return icon; | 36 | return icon; | ||
38 | } | 37 | } | ||
38 | | ||||
39 | function formFactorIcon(formFactor) { | ||||
40 | switch(formFactor) { | ||||
41 | case "internal": | ||||
42 | return "audio-card"; | ||||
43 | case "speaker": | ||||
44 | return "audio-speakers-symbolic"; | ||||
45 | case "phone": | ||||
46 | return "phone"; | ||||
47 | case "handset": | ||||
48 | return "phone"; | ||||
49 | case "tv": | ||||
50 | return "video-television"; | ||||
51 | case "webcam": | ||||
52 | return "camera-web"; | ||||
53 | case "microphone": | ||||
54 | return "audio-input-microphone"; | ||||
55 | case "headset": | ||||
56 | return "audio-headset"; | ||||
57 | case "headphone": | ||||
58 | return "audio-headphones"; | ||||
59 | case "hands-free": | ||||
60 | return "hands-free"; | ||||
61 | case "car": | ||||
62 | return "car"; | ||||
63 | case "hifi": | ||||
64 | return "hifi"; | ||||
65 | case "computer": | ||||
66 | return "computer"; | ||||
67 | case "portable": | ||||
68 | return "portable"; | ||||
69 | } | ||||
70 | return ""; | ||||
71 | } |