Skip to content

Commit c2341d6

Browse files
3gf8jv4dvlyswhut
andauthored
Disable rounded corners for lyric window (#2356)
* Disable rounded corners for lyric window Ensure that the lyric window looks the same on Windows 11 as it does on other systems. Ref: electron/electron#46468 * update --------- Co-authored-by: lyswhut <lyswhut@qq.com>
1 parent 03bba42 commit c2341d6

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { openDirInExplorer } from '@common/utils/electron'
1414

1515
export const initGlobalData = () => {
1616
const envParams = parseEnvParams()
17+
envParams.cmdParams.dt = !!envParams.cmdParams.dt
18+
1719
global.envParams = {
1820
cmdParams: envParams.cmdParams,
1921
deeplink: envParams.deeplink,

src/main/modules/userApi/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const createWindow = async(userApi: LX.UserApi.UserApiInfo) => {
7777
minimizable: false,
7878
maximizable: false,
7979
fullscreenable: false,
80+
roundedCorners: false,
8081
hasShadow: false,
8182
show: false,
8283
webPreferences: {

src/main/modules/winLyric/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export const createWindow = () => {
127127
minimizable: false,
128128
maximizable: false,
129129
fullscreenable: false,
130+
roundedCorners: false,
130131
show: false,
131132
alwaysOnTop: isAlwaysOnTop,
132133
skipTaskbar: !isShowTaskbar,

src/main/modules/winMain/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const createWindow = () => {
8787
resizable: false,
8888
maximizable: false,
8989
fullscreenable: true,
90-
roundedCorners: false,
90+
roundedCorners: global.envParams.cmdParams.dt,
9191
show: false,
9292
webPreferences: {
9393
session: ses,
@@ -109,7 +109,7 @@ export const createWindow = () => {
109109
browserWindow = new BrowserWindow(options)
110110

111111
const winURL = process.env.NODE_ENV !== 'production' ? 'http://localhost:9080' : `file://${path.join(encodePath(__dirname), 'index.html')}`
112-
void browserWindow.loadURL(winURL + `?os=${getPlatform()}&dt=${!!global.envParams.cmdParams.dt}&dark=${shouldUseDarkColors}&theme=${encodeURIComponent(JSON.stringify(theme))}`)
112+
void browserWindow.loadURL(winURL + `?os=${getPlatform()}&dt=${global.envParams.cmdParams.dt}&dark=${shouldUseDarkColors}&theme=${encodeURIComponent(JSON.stringify(theme))}`)
113113

114114
winEvent()
115115

0 commit comments

Comments
 (0)