Skip to content

Commit 680de5a

Browse files
authored
feat(ui-tars): widget window displays a border on Windows systems (#594)
1 parent c4cb8a6 commit 680de5a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

apps/ui-tars/src/main/window/ScreenMarker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ class ScreenMarker {
158158
resizable: false,
159159
type: 'toolbar',
160160
visualEffectState: 'active', // macOS only
161-
backgroundColor: '#00000000', // 透明背景
162161
webPreferences: {
163162
preload: path.join(__dirname, '../preload/index.js'),
164163
sandbox: false,

apps/ui-tars/src/renderer/src/pages/widget/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import { api } from '@renderer/api';
2323
import './widget.css';
2424
import { StatusEnum } from '@ui-tars/sdk';
2525

26+
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform
27+
// chrome 93 support
28+
// @ts-ignore
29+
const isWin = navigator.userAgentData.platform === 'Windows';
30+
2631
interface Action {
2732
action: string;
2833
type: string;
@@ -139,7 +144,10 @@ const Widget = () => {
139144
}, []);
140145

141146
return (
142-
<div className="w-100 h-100 overflow-hidden p-4 bg-white/90 dark:bg-gray-800/90">
147+
<div
148+
className="w-100 h-100 overflow-hidden p-4 bg-white/90 dark:bg-gray-800/90 rounded-[10px] border-gray-300"
149+
style={{ borderWidth: isWin ? '1px' : '0' }}
150+
>
143151
<div className="flex draggable-area">
144152
{/* Logo */}
145153
<img src={logo} alt="logo" className="-ml-2 h-6 mr-auto" />

0 commit comments

Comments
 (0)