From 1a71f96a91f61593d0c9caae3561110982723e5f Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 19 Nov 2017 00:56:00 +0100 Subject: [PATCH] Feature disabled: Auto ratio dont provide a stable solution --- src/html/settings.html | 6 ------ src/js/background.js | 19 +++++++++++-------- src/js/settings.js | 12 ------------ 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/src/html/settings.html b/src/html/settings.html index b18087b..ef49df6 100644 --- a/src/html/settings.html +++ b/src/html/settings.html @@ -69,12 +69,6 @@ - - Ratio Auto : - - - - Ratio (X/Y) : diff --git a/src/js/background.js b/src/js/background.js index 186ebfa..b782b4b 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -111,9 +111,8 @@ app.Settings.init = function(callback){ // Load settings and nodes margin: 10, rows: 4, columns: 5, - ratioAuto: true, - ratioX: 5, - ratioY: 4, + ratioX: 4, + ratioY: 3, backNode: true, backIcon: 'url(/img/back.png)', backIconMode: 3, @@ -203,12 +202,16 @@ app.Settings.init = function(callback){ // Load settings and nodes } if(data.version == 4){ // Upgrade Data Version if(!data.settings.grid.cells.snapshotDelay) data.settings.grid.cells.snapshotDelay = 2000; - if(!data.settings.grid.ratioX){ - data.settings.grid.ratioAuto = true; - data.settings.grid.ratioX = data.settings.grid.columns; - data.settings.grid.ratioY = data.settings.grid.rows; + if(data.settings.grid.ratioAuto == true || data.settings.grid.ratioAuto == false){ + delete data.settings.grid.ratioAuto; + data.settings.grid.ratioX = 4; + data.settings.grid.ratioY = 3; } - //app.Settings.save(); + if(!data.settings.grid.ratioX){ + data.settings.grid.ratioX = 4; + data.settings.grid.ratioY = 3; + } + //app.Settings.save(); } app.settings = data.settings; app.node = data.node; diff --git a/src/js/settings.js b/src/js/settings.js index ddae6a0..2a3c92b 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -28,7 +28,6 @@ app.init = function(){ BackgroundPreview.style.backgroundSize = '100% 100%'; GridRoot.value = app.settings.grid.root; GridRows.value = app.settings.grid.rows; - GridRatioAuto.checked = app.settings.grid.ratioAuto; GridRatioX.value = app.settings.grid.ratioX; GridRatioY.value = app.settings.grid.ratioY; GridMargins.value = app.settings.grid.margin; @@ -73,7 +72,6 @@ app.init = function(){ GridCellsTitleBackgroundColorHover.value = app.settings.grid.cells.titleBackgroundColorHover; GridCellsTitleBackgroundTransparentHover.checked = (app.settings.grid.cells.titleBackgroundColorHover == null); GridCellsSnapshotDelay.value = app.settings.grid.cells.snapshotDelay; - GridRatioAuto.onchange(); }); BtnOk.onclick = function(){ @@ -87,7 +85,6 @@ app.init = function(){ app.settings.grid.rows = +(GridRows.value); app.settings.grid.margin = +(GridMargins.value); app.settings.grid.columns = +(GridColumns.value); - app.settings.grid.ratioAuto = GridRatioAuto.checked; app.settings.grid.ratioX = GridRatioX.value; app.settings.grid.ratioY = GridRatioY.value; app.settings.grid.backNode = GridBackNode.checked; @@ -180,15 +177,6 @@ app.init = function(){ } } - GridRatioAuto.onchange = function(){ - if(GridRatioAuto.checked){ - GridRatioX.value = GridColumns.value; - GridRatioY.value = GridRows.value; - } - GridRatioX.disabled = GridRatioAuto.checked; - GridRatioY.disabled = GridRatioAuto.checked; - } - GridBackImageReset.onclick = function(){ GridBackImage = 'url(/img/back.png)'; GridBackPreview.style.backgroundImage = GridBackImage;