Skip to content
Snippets Groups Projects
Commit 521c385e authored by Torge Kummerow's avatar Torge Kummerow
Browse files

Fixed refactoring bugs

parent fefd6bed
No related branches found
No related tags found
No related merge requests found
...@@ -74,19 +74,32 @@ var Grid = { ...@@ -74,19 +74,32 @@ var Grid = {
updateToCurrentScreen : function () { updateToCurrentScreen : function () {
var screenBounds = BQT.getActiveScreenBounds(); var screenBounds = BQT.getActiveScreenBounds();
this.oneThirdX = screenBounds.width/3; print("Screen bounds: "+screenBounds.x+"/"+screenBounds.y+"/"+screenBounds.width+"/"+screenBounds.height);
this.halfX = screenBounds.width/2;
this.twoThirdX = screenBounds.width/3*2;
this.halfY = screenBounds.height/2; this.oneThirdX = Math.floor(screenBounds.width/3);
this.halfX = Math.floor(screenBounds.width/2);
this.twoThirdX = Math.floor(screenBounds.width/3*2);
this.oneThirdW = screenBounds.width/3; this.halfY = Math.floor(screenBounds.height/2);
this.halfW = screenBounds.width/2;
this.twoThirdW = screenBounds.width/3*2; this.oneThirdW = Math.floor(screenBounds.width/3);
this.halfW = Math.floor(screenBounds.width/2);
this.twoThirdW = Math.floor(screenBounds.width/3*2);
this.fullW = screenBounds.width; this.fullW = screenBounds.width;
this.halfH = screenBounds.height/2; this.halfH = Math.floor(screenBounds.height/2);
this.fullH = screenBounds.height; this.fullH = screenBounds.height;
print("Grid params: ");
print("oneThirdX: "+this.oneThirdX);
print("halfX: "+this.halfX);
print("halfY: "+this.halfY);
print("oneThirdW: "+this.oneThirdW);
print("halfW: "+this.halfW);
print("twoThirdW: "+this.twoThirdW);
print("fullW: "+this.fullW);
print("halfH: "+this.halfH);
print("fullH: "+this.fullH);
} }
}; };
...@@ -156,6 +169,8 @@ var BQT = { ...@@ -156,6 +169,8 @@ var BQT = {
print("getMode called"); print("getMode called");
var windowBounds = this.getActiveWindowBounds(); var windowBounds = this.getActiveWindowBounds();
print("Window bounds: "+windowBounds.x+"/"+windowBounds.y+"/"+windowBounds.height+"/"+windowBounds.width);
//Getting possible modes due to the windows' X position //Getting possible modes due to the windows' X position
print("Determining current mode"); print("Determining current mode");
...@@ -375,20 +390,22 @@ var BQT = { ...@@ -375,20 +390,22 @@ var BQT = {
case MODES.RIGHT_HALF : x=Grid.halfX; y=0; w=Grid.halfW; h=Grid.fullH; break; case MODES.RIGHT_HALF : x=Grid.halfX; y=0; w=Grid.halfW; h=Grid.fullH; break;
case MODES.RIGHT_TWO_THIRD : x=Grid.oneThirdX; y=0; w=Grid.twoThirdW; h=Grid.fullH; break; case MODES.RIGHT_TWO_THIRD : x=Grid.oneThirdX; y=0; w=Grid.twoThirdW; h=Grid.fullH; break;
case MODES.DOWN_LEFT_ONE_THIRD : x=0; y=halfY; w=Grid.oneThirdW; h=Grid.halfH; break; case MODES.DOWN_LEFT_ONE_THIRD : x=0; y=Grid.halfY; w=Grid.oneThirdW; h=Grid.halfH; break;
case MODES.DOWN_LEFT_HALF : x=0; y=halfY; w=Grid.halfW; h=Grid.halfH; break; case MODES.DOWN_LEFT_HALF : x=0; y=Grid.halfY; w=Grid.halfW; h=Grid.halfH; break;
case MODES.DOWN_LEFT_TWO_THIRD : x=0; y=halfY; w=Grid.twoThirdW; h=Grid.halfH; break; case MODES.DOWN_LEFT_TWO_THIRD : x=0; y=Grid.halfY; w=Grid.twoThirdW; h=Grid.halfH; break;
case MODES.DOWN_CENTER_CENTER : x=Grid.oneThirdX; y=halfY; w=Grid.oneThirdW; h=Grid.halfH; break; case MODES.DOWN_CENTER_CENTER : x=Grid.oneThirdX; y=Grid.halfY; w=Grid.oneThirdW; h=Grid.halfH; break;
case MODES.DOWN_CENTER_FULL : x=0; y=halfY; w=Grid.fullW; h=Grid.halfH; break; case MODES.DOWN_CENTER_FULL : x=0; y=Grid.halfY; w=Grid.fullW; h=Grid.halfH; break;
case MODES.DOWN_RIGHT_ONE_THIRD : x=Grid.twoThirdX; y=halfY; w=Grid.oneThirdW; h=Grid.halfH; break; case MODES.DOWN_RIGHT_ONE_THIRD : x=Grid.twoThirdX; y=Grid.halfY; w=Grid.oneThirdW; h=Grid.halfH; break;
case MODES.DOWN_RIGHT_HALF : x=Grid.halfX; y=halfY; w=Grid.halfW; h=Grid.halfH; break; case MODES.DOWN_RIGHT_HALF : x=Grid.halfX; y=Grid.halfY; w=Grid.halfW; h=Grid.halfH; break;
case MODES.DOWN_RIGHT_TWO_THIRD : x=Grid.oneThirdX; y=halfY; w=Grid.twoThirdW; h=Grid.halfH; break; case MODES.DOWN_RIGHT_TWO_THIRD : x=Grid.oneThirdX; y=Grid.halfY; w=Grid.twoThirdW; h=Grid.halfH; break;
default: default: break;
} }
print("New bounds: "+x+"/"+y+"/"+w+"/"+h);
//Calulating the new window frame geometry relative to the active screen //Calulating the new window frame geometry relative to the active screen
var screenBounds = BQT.getActiveScreenBounds(); var screenBounds = BQT.getActiveScreenBounds();
var newFrameGeometry = { var newFrameGeometry = {
...@@ -398,6 +415,8 @@ var BQT = { ...@@ -398,6 +415,8 @@ var BQT = {
height: h height: h
} }
//Setting the new window geomety //Setting the new window geomety
workspace.activeClient.frameGeometry = newFrameGeometry; workspace.activeClient.frameGeometry = newFrameGeometry;
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment