Wallpaper rework
- removed swww to the code is easier to maintain - basic multi monitor wallpaper support
This commit is contained in:
parent
3cc8c8fb03
commit
e79c163dd9
12 changed files with 330 additions and 552 deletions
|
|
@ -11,7 +11,7 @@ Singleton {
|
|||
function scale(aScreen) {
|
||||
try {
|
||||
if (aScreen !== undefined && aScreen.name !== undefined) {
|
||||
return scaleByName(aScreen.name)
|
||||
return getMonitorScale(aScreen.name)
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
|
|
@ -20,21 +20,46 @@ Singleton {
|
|||
return 1.0
|
||||
}
|
||||
|
||||
function scaleByName(aScreenName) {
|
||||
// -------------------------------------------
|
||||
function getMonitorScale(aScreenName) {
|
||||
try {
|
||||
if (Settings.data.monitorsScaling !== undefined) {
|
||||
if (Settings.data.monitorsScaling[aScreenName] !== undefined) {
|
||||
return Settings.data.monitorsScaling[aScreenName]
|
||||
var monitors = Settings.data.ui.monitorsScaling
|
||||
if (monitors !== undefined) {
|
||||
for (var i = 0; i < monitors.length; i++) {
|
||||
if (monitors[i].name !== undefined && monitors[i].name === aScreenName) {
|
||||
return monitors[i].scale
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
//Logger.warn(e)
|
||||
}
|
||||
|
||||
return 1.0
|
||||
}
|
||||
|
||||
// -------------------------------------------
|
||||
function setMonitorScale(aScreenName, scale) {
|
||||
try {
|
||||
var monitors = Settings.data.ui.monitorsScaling
|
||||
if (monitors !== undefined) {
|
||||
for (var i = 0; i < monitors.length; i++) {
|
||||
if (monitors[i].name !== undefined && monitors[i].name === aScreenName) {
|
||||
monitors[i].scale = scale
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
monitors.push({
|
||||
"name": aScreenName,
|
||||
"scale": scale
|
||||
})
|
||||
} catch (e) {
|
||||
|
||||
//Logger.warn(e)
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------
|
||||
// Dynamic scaling based on resolution
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue