generated from moonlight-mod/sample-extension
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump prettier to 120 columns, update types, platformStyles: fix popou…
…ts not getting framed
- Loading branch information
1 parent
034f6cd
commit 23855d9
Showing
12 changed files
with
55 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"printWidth": 80, | ||
"printWidth": 120, | ||
"trailingComma": "none", | ||
"tabWidth": 2, | ||
"singleQuote": false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
import { BrowserWindowConstructorOptions } from "electron"; | ||
import { PlatformStyle } from "./types"; | ||
|
||
moonlightHost.events.on( | ||
"window-options", | ||
(options: BrowserWindowConstructorOptions) => { | ||
const style = | ||
moonlightHost.getConfigOption<PlatformStyle>("platformStyles", "style") ?? | ||
"default"; | ||
const useFrame = style === "linux"; | ||
moonlightHost.events.on("window-options", (options: BrowserWindowConstructorOptions) => { | ||
const style = moonlightHost.getConfigOption<PlatformStyle>("platformStyles", "style") ?? "default"; | ||
const useFrame = style === "linux"; | ||
|
||
const isPopout = | ||
options.center && options.width === 300 && options.height === 350; | ||
const isPopout = options.center && options.width === 300 && options.height === 350; | ||
|
||
if (!isPopout) { | ||
if (style !== "default") { | ||
options.frame = useFrame; | ||
} | ||
if (!isPopout) { | ||
if (style !== "default") { | ||
options.frame = useFrame; | ||
} | ||
} | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Dispatcher from "@moonlight-mod/wp/discord/Dispatcher"; | ||
import { PlatformStyle } from "../types"; | ||
|
||
Dispatcher.addInterceptor((data) => { | ||
if (data.type == "POPOUT_WINDOW_OPEN") { | ||
const style = moonlight.getConfigOption<PlatformStyle>("platformStyles", "style") ?? "default"; | ||
|
||
if (style === "linux") data.features.frame = true; | ||
} | ||
|
||
return false; | ||
}); |