mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-21 00:18:11 +00:00
refactor: 统一 webTab 背景色设置逻辑
- 移除 createWebTabView 中冗余的深色/浅色主题背景色判断分支 - 统一使用 utils.getDefaultBackgroundColor() 获取默认背景色 - 移除 did-stop-loading 事件中不必要的背景色重置逻辑
This commit is contained in:
parent
a34b0c88d5
commit
ce5bb5f187
9
electron/lib/web-tab-manager.js
vendored
9
electron/lib/web-tab-manager.js
vendored
@ -680,12 +680,8 @@ function createWebTabView(windowId, args) {
|
|||||||
|
|
||||||
if (args.backgroundColor) {
|
if (args.backgroundColor) {
|
||||||
browserView.setBackgroundColor(args.backgroundColor)
|
browserView.setBackgroundColor(args.backgroundColor)
|
||||||
} else if (isWindowMode) {
|
|
||||||
browserView.setBackgroundColor(utils.getDefaultBackgroundColor())
|
|
||||||
} else if (nativeTheme.shouldUseDarkColors) {
|
|
||||||
browserView.setBackgroundColor('#575757')
|
|
||||||
} else {
|
} else {
|
||||||
browserView.setBackgroundColor('#FFFFFF')
|
browserView.setBackgroundColor(utils.getDefaultBackgroundColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
browserView.setBounds({
|
browserView.setBounds({
|
||||||
@ -852,9 +848,6 @@ function createWebTabView(windowId, args) {
|
|||||||
})
|
})
|
||||||
browserView.webContents.on('did-stop-loading', _ => {
|
browserView.webContents.on('did-stop-loading', _ => {
|
||||||
stopLoading()
|
stopLoading()
|
||||||
if (nativeTheme.shouldUseDarkColors) {
|
|
||||||
browserView.setBackgroundColor('#FFFFFF')
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
browserView.webContents.on('before-input-event', (event, input) => {
|
browserView.webContents.on('before-input-event', (event, input) => {
|
||||||
// 使用动态窗口ID,支持标签在窗口间转移
|
// 使用动态窗口ID,支持标签在窗口间转移
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user