Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/logic.js
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 44 | if (batteryData["Is Power Supply"] && batteryData["Capacity"] != "" && typeof batteryData["Capacity"] == "number") { | |||
---|---|---|---|---|---|
45 | data.push({label: i18n("Battery Health:") }) | 45 | data.push({label: i18n("Battery Health:") }) | ||
46 | data.push({value: i18nc("Placeholder is battery health percentage", "%1%", batteryData["Capacity"]) }) | 46 | data.push({value: i18nc("Placeholder is battery health percentage", "%1%", batteryData["Capacity"]) }) | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | return data | 49 | return data | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | function updateBrightness(rootItem, source) { | 52 | function updateBrightness(rootItem, source) { | ||
53 | if (rootItem.updateScreenBrightnessJob || rootItem.updateKeyboardBrightnessJob) | ||||
broulik: Wouldn't that cause subsequent calls to fail if the previous hasn't finished yet? Wouldn't that… | |||||
apol: No, it will be called eventually, which is all that matters. | |||||
54 | return; | ||||
55 | | ||||
53 | if (!source.data["PowerDevil"]) { | 56 | if (!source.data["PowerDevil"]) { | ||
54 | return; | 57 | return; | ||
55 | } | 58 | } | ||
56 | 59 | | |||
57 | // we don't want passive brightness change send setBrightness call | 60 | // we don't want passive brightness change send setBrightness call | ||
58 | rootItem.disableBrightnessUpdate = true; | 61 | rootItem.disableBrightnessUpdate = true; | ||
59 | 62 | | |||
60 | if (typeof source.data["PowerDevil"]["Screen Brightness"] === 'number') { | 63 | if (typeof source.data["PowerDevil"]["Screen Brightness"] === 'number') { | ||
Show All 23 Lines |
Wouldn't that cause subsequent calls to fail if the previous hasn't finished yet? Wouldn't that be annoying if you drag the slider quickly?