1
0
mirror of https://github.com/MatMoul/quickdial-webext.git synced 2024-12-23 07:26:11 +00:00

Feature disabled: Auto ratio dont provide a stable solution

This commit is contained in:
MatMoul 2017-11-19 00:56:00 +01:00
parent 45f7e60fb8
commit 1a71f96a91
3 changed files with 11 additions and 26 deletions

View File

@ -69,12 +69,6 @@
<input id="GridColumns" type="number" min="1">
</td>
</tr>
<tr>
<td><span>Ratio Auto :</span></td>
<td>
<input id="GridRatioAuto" type="checkbox">
</td>
</tr>
<tr>
<td><span>Ratio (X/Y) :</span></td>
<td>

View File

@ -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,10 +202,14 @@ 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.ratioAuto == true || data.settings.grid.ratioAuto == false){
delete data.settings.grid.ratioAuto;
data.settings.grid.ratioX = 4;
data.settings.grid.ratioY = 3;
}
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;
data.settings.grid.ratioX = 4;
data.settings.grid.ratioY = 3;
}
//app.Settings.save();
}

View File

@ -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;