Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
EastArctica committed Jan 16, 2025
1 parent 744e991 commit 693efd7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
19 changes: 12 additions & 7 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,30 @@ class BrowserWindow extends electron.BrowserWindow {
let lastLastBounds = {
width: primaryDisplaySize.width * 0.75,
height: primaryDisplaySize.height * 0.75,
x: primaryDisplaySize.width / 2 - primaryDisplaySize.width * 0.75 / 2,
y: primaryDisplaySize.height / 2 - primaryDisplaySize.height * 0.75 / 2,
x: primaryDisplaySize.width / 2 - (primaryDisplaySize.width * 0.75) / 2,
y: primaryDisplaySize.height / 2 - (primaryDisplaySize.height * 0.75) / 2,
};
let lastResize = Date.now();
this.on('resize', () => {
this.on("resize", () => {
const bounds = this.getBounds();
lastLastBounds = lastBounds;
lastBounds = bounds;
lastResize = Date.now();
});

this.on('maximize', () => {
this.on("maximize", () => {
// Get the display at the center of the window
const screenBounds = this.getBounds();
const windowDisplay = electron.screen.getDisplayNearestPoint({ x: screenBounds.x + screenBounds.width / 2, y: screenBounds.y + screenBounds.height / 2 });
const windowDisplay = electron.screen.getDisplayNearestPoint({
x: screenBounds.x + screenBounds.width / 2,
y: screenBounds.y + screenBounds.height / 2,
});
const workAreaSize = windowDisplay.workArea;

const isSizeMaximized = lastBounds.width === workAreaSize.width && lastBounds.height === workAreaSize.height;
const isPositionMaximized = (lastBounds.x === workAreaSize.x + 1 && lastBounds.y === workAreaSize.y + 1);
const isSizeMaximized =
lastBounds.width === workAreaSize.width && lastBounds.height === workAreaSize.height;
const isPositionMaximized =
lastBounds.x === workAreaSize.x + 1 && lastBounds.y === workAreaSize.y + 1;

// if we haven't resized in the last few ms, we probably didn't actually maximize and should instead unmaximize
if (lastResize < Date.now() - 10 || (isSizeMaximized && isPositionMaximized)) {
Expand Down
18 changes: 9 additions & 9 deletions src/renderer/modules/components/ColorPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ const Positions = {
} as const;

interface ColorPickerProps {
className?: string,
defaultColor?: number,
customColor?: number,
colors: number[],
value?: number,
disabled?: boolean,
className?: string;
defaultColor?: number;
customColor?: number;
colors: number[];
value?: number;
disabled?: boolean;
onChange?: (value: number, name: string) => void;
renderDefaultButton: (props: object) => React.ReactElement,
renderCustomButton: (props: object) => React.ReactElement,
colorContainerClassName?: string
renderDefaultButton: (props: object) => React.ReactElement;
renderCustomButton: (props: object) => React.ReactElement;
colorContainerClassName?: string;
customPickerPosition?: (typeof Positions)[keyof typeof Positions];
}

Expand Down
6 changes: 3 additions & 3 deletions src/renderer/modules/components/ColorPickerCustomButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type React from "react";
import components from "../common/components";

interface ColorPickerCustomButtonProps {
color?: number,
value?: number,
disabled?: boolean,
color?: number;
value?: number;
disabled?: boolean;
onChange?: (value: number, name: string) => void;
}

Expand Down
6 changes: 3 additions & 3 deletions src/renderer/modules/components/ColorPickerDefaultButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type React from "react";
import components from "../common/components";

interface ColorPickerDefaultButtonProps {
customColor?: number,
value?: number,
disabled?: boolean,
customColor?: number;
value?: number;
disabled?: boolean;
"aria-label"?: string;
}

Expand Down

0 comments on commit 693efd7

Please sign in to comment.