mirror of
https://github.com/Bismuth-Forge/bismuth.git
synced 2024-09-17 11:37:10 +03:00
refactor: merge WindowLayoutClass into WindowLayout
This commit is contained in:
parent
f31342f95b
commit
e8b876d4e7
@ -17,7 +17,6 @@ import QuarterLayout from "./engine/layout/quarter_layout";
|
||||
import CascadeLayout from "./engine/layout/cascade_layout";
|
||||
|
||||
import { WindowsLayout } from "./engine/layout";
|
||||
import { WindowsLayoutClass } from "./engine/layout";
|
||||
|
||||
export interface Config {
|
||||
//#region Layout
|
||||
@ -154,7 +153,7 @@ export class ConfigImpl implements Config {
|
||||
["enableQuarterLayout", false, QuarterLayout],
|
||||
["enableFloatingLayout", false, FloatingLayout],
|
||||
["enableCascadeLayout", false, CascadeLayout], // TODO: add config
|
||||
] as Array<[string, boolean, WindowsLayoutClass]>
|
||||
] as Array<[string, boolean, any]>
|
||||
).forEach(([configKey, defaultValue, layoutClass]) => {
|
||||
// For some reason if we put the curly brackets here script breaks
|
||||
// This will be dealt with, when this facility will be refactored out
|
||||
|
@ -10,25 +10,21 @@ import { Controller } from "../../controller";
|
||||
import { Action } from "../../controller/action";
|
||||
|
||||
import { Rect, RectDelta } from "../../util/rect";
|
||||
import { Config } from "../../config";
|
||||
|
||||
export interface WindowsLayoutClass {
|
||||
readonly id: string;
|
||||
new (config: Config): WindowsLayout;
|
||||
}
|
||||
|
||||
export interface WindowsLayout {
|
||||
export abstract class WindowsLayout {
|
||||
/* read-only */
|
||||
|
||||
static readonly id: string;
|
||||
|
||||
/**
|
||||
* Human-readable name of the layout.
|
||||
*/
|
||||
readonly name: string;
|
||||
abstract readonly name: string;
|
||||
|
||||
/**
|
||||
* The icon name of the layout.
|
||||
*/
|
||||
readonly icon: string;
|
||||
abstract readonly icon: string;
|
||||
|
||||
/**
|
||||
* A string that can be used to show layout specific properties in the pop-up,
|
||||
@ -47,8 +43,14 @@ export interface WindowsLayout {
|
||||
basis: EngineWindow,
|
||||
delta: RectDelta
|
||||
): void;
|
||||
apply(controller: Controller, tileables: EngineWindow[], area: Rect): void;
|
||||
|
||||
abstract apply(
|
||||
controller: Controller,
|
||||
tileables: EngineWindow[],
|
||||
area: Rect
|
||||
): void;
|
||||
|
||||
executeAction?(engine: Engine, action: Action): void;
|
||||
|
||||
toString(): string;
|
||||
abstract toString(): string;
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import MonocleLayout from "./layout/monocle_layout";
|
||||
import FloatingLayout from "./layout/floating_layout";
|
||||
|
||||
import { WindowsLayout } from "./layout";
|
||||
|
Loading…
Reference in New Issue
Block a user