Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
feat: add a shortcut for the reverse rotation action
Browse files Browse the repository at this point in the history
  • Loading branch information
ikajdan authored and Mikhail Zolotukhin committed Nov 8, 2021
1 parent 83d9efd commit a027e54
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ package](https://aur.archlinux.org/packages/kwin-bismuth) with your favorite
AUR helper.

#### Gentoo

Updated ebuilds provided in [viperML-overlay](https://github.com/viperML/viperML-overlay/).

#### Other distributions
Expand Down Expand Up @@ -123,4 +124,5 @@ You can configure Bismuth in the System Settings > Window Management > Window Ti
| Set Quarter Layout | _None_ |
| | |
| Rotate | Meta + R |
| Rotate (Reverse) | _None_ |
| Rotate Part | Meta + Shift + R |
10 changes: 10 additions & 0 deletions src/kwinscript/controller/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,16 @@ export class Rotate extends ActionImpl implements Action {
}
}

export class RotateReverse extends ActionImpl implements Action {
constructor(protected engine: Engine, protected log: Log) {
super(engine, "rotate_reverse", "Rotate (Reverse)", "", log);
}

public executeWithoutLayoutOverride(): void {
this.engine.showNotification("Rotation Not Applicable");
}
}

export class RotatePart extends ActionImpl implements Action {
constructor(protected engine: Engine, protected log: Log) {
super(engine, "rotate_part", "Rotate Part", "Meta+Shift+R", log);
Expand Down
1 change: 1 addition & 0 deletions src/kwinscript/controller/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ export class ControllerImpl implements Controller {
new Action.ToggleQuarterLayout(this.engine, this.log),

new Action.Rotate(this.engine, this.log),
new Action.RotateReverse(this.engine, this.log),
new Action.RotatePart(this.engine, this.log),
];

Expand Down
3 changes: 3 additions & 0 deletions src/kwinscript/engine/layout/tile_layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
IncreaseLayoutMasterAreaSize,
IncreaseMasterAreaWindowCount,
Rotate,
RotateReverse,
RotatePart,
} from "../../controller/action";

Expand Down Expand Up @@ -132,6 +133,8 @@ export default class TileLayout implements WindowsLayout {
engine.showLayoutNotification();
} else if (action instanceof Rotate) {
this.parts.rotate(90);
} else if (action instanceof RotateReverse) {
this.parts.rotate(-90);
} else if (action instanceof RotatePart) {
this.parts.inner.primary.rotate(90);
} else {
Expand Down

0 comments on commit a027e54

Please sign in to comment.