Merge branch 'quattro' into unified-input-method-setup
This commit is contained in:
commit
101bb547bb
245 files changed
+19949
-375
No files matched your search
@@ -421,6 +421,19 @@ function popupExpired(entry, duration, now) {
|
||||
return (Number(now) - Number((entry || {}).timestamp || 0)) >= lifetime
|
||||
}
|
||||
|
||||
// How far a toast on a screen keeps from a top or right bar: the bar's
|
||||
// thickness on that screen (a notch floor can make a top bar thicker than its
|
||||
// configured size on one screen), plus the gap. A bar without per-screen
|
||||
// sizes counts its configured size; a hidden or missing one, the default size.
|
||||
function barClearance(bar, screenName, defaultBarSize, gapsOut) {
|
||||
var size = Number(defaultBarSize)
|
||||
if (bar && !bar.barHidden) {
|
||||
size = Number(typeof bar.barSizeFor === "function" ? bar.barSizeFor(screenName) : bar.barSize)
|
||||
size = isFinite(size) ? Math.max(0, size) : 0
|
||||
}
|
||||
return size + Number(gapsOut)
|
||||
}
|
||||
|
||||
function popupPlacement(barPosition, barClearance, gapsOut) {
|
||||
var position = String(barPosition || "top")
|
||||
var clearance = Number(barClearance)
|
||||
@@ -501,6 +514,7 @@ if (typeof module !== "undefined") {
|
||||
serializePopup: serializePopup,
|
||||
parsePopupFiles: parsePopupFiles,
|
||||
popupExpired: popupExpired,
|
||||
barClearance: barClearance,
|
||||
popupPlacement: popupPlacement
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user