tests: handle setMaximize
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
1,
|
||||
"app1",
|
||||
"Application 1",
|
||||
new MockQmlRect(0, 0, 200, 200),
|
||||
new MockQmlRect(0, 0, 300, 200),
|
||||
);
|
||||
|
||||
workspaceMock.createWindow(kwinClient);
|
||||
@@ -23,6 +23,24 @@
|
||||
kwinClient.fullScreen = false;
|
||||
{
|
||||
const frame = kwinClient.frameGeometry;
|
||||
assert(frame.width === 200 && frame.height === 200);
|
||||
assert(frame.width === 300 && frame.height === 200);
|
||||
}
|
||||
|
||||
kwinClient.setMaximize(true, true);
|
||||
{
|
||||
const frame = kwinClient.frameGeometry;
|
||||
assert(frame.width === screenWidth && frame.height === screenHeight);
|
||||
}
|
||||
|
||||
kwinClient.setMaximize(true, false);
|
||||
{
|
||||
const frame = kwinClient.frameGeometry;
|
||||
assert(frame.width === 300 && frame.height === screenHeight);
|
||||
}
|
||||
|
||||
kwinClient.setMaximize(false, false);
|
||||
{
|
||||
const frame = kwinClient.frameGeometry;
|
||||
assert(frame.width === 300 && frame.height === 200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ class MockKwinClient {
|
||||
}
|
||||
|
||||
setMaximize(vertically: boolean, horizontally: boolean) {
|
||||
this.windowed = !(vertically || horizontally);
|
||||
|
||||
this.maximizedAboutToChange.fire(
|
||||
vertically ? (
|
||||
horizontally ? MaximizedMode.Maximized : MaximizedMode.Vertically
|
||||
@@ -59,6 +61,13 @@ class MockKwinClient {
|
||||
horizontally ? MaximizedMode.Horizontally : MaximizedMode.Unmaximized
|
||||
)
|
||||
);
|
||||
|
||||
this.frameGeometry = new MockQmlRect(
|
||||
horizontally ? 0 : this.windowedFrameGeometry.x,
|
||||
vertically ? 0 : this.windowedFrameGeometry.y,
|
||||
horizontally ? screenWidth : this.windowedFrameGeometry.width,
|
||||
vertically ? screenHeight : this.windowedFrameGeometry.height,
|
||||
);
|
||||
}
|
||||
|
||||
public get clientGeometry() {
|
||||
|
||||
Reference in New Issue
Block a user