From 9e0029aa489784fe24cd9b33d12a1ae2d8627eee Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Thu, 21 Oct 2021 02:42:12 +0300 Subject: [PATCH] refactor: remove unused floatAll function --- src/engine/index.ts | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/engine/index.ts b/src/engine/index.ts index 3d33a2e4..0dfea72a 100644 --- a/src/engine/index.ts +++ b/src/engine/index.ts @@ -138,15 +138,6 @@ export interface Engine { */ toggleFloat(window: EngineWindow): void; - /** - * Toggle float on all windows on the given surface. - * - * The behaviors of this operation depends on the number of floating - * windows: windows will be tiled if more than half are floating, and will - * be floated otherwise. - */ - floatAll(srf: DriverSurface): void; - /** * Change the layout of the current surface to the next. */ @@ -559,27 +550,6 @@ export class EngineImpl implements Engine { window.state = !window.tileable ? WindowState.Tiled : WindowState.Floating; } - public floatAll(srf: DriverSurface): void { - const windows = this.windows.getVisibleWindows(srf); - const numFloats = windows.reduce((count, window) => { - return window.state === WindowState.Floating ? count + 1 : count; - }, 0); - - if (numFloats < windows.length / 2) { - windows.forEach((window) => { - /* TODO: do not use arbitrary constants */ - window.floatGeometry = window.actualGeometry.gap(4, 4, 4, 4); - window.state = WindowState.Floating; - }); - this.controller.showNotification("Float All"); - } else { - windows.forEach((window) => { - window.state = WindowState.Tiled; - }); - this.controller.showNotification("Tile All"); - } - } - public setMaster(window: EngineWindow): void { this.windows.setMaster(window); }