Skip to content

Commit a853b59

Browse files
author
baiqing
committed
chore: release 1.2.4 mac titlebar polish
1 parent 0378dd1 commit a853b59

6 files changed

Lines changed: 17 additions & 11 deletions

File tree

openless-all/app/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openless-all/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "openless-app",
33
"private": true,
4-
"version": "1.2.3",
4+
"version": "1.2.4",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

openless-all/app/src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openless-all/app/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openless"
3-
version = "1.2.3"
3+
version = "1.2.4"
44
description = "OpenLess — local voice input that types where your cursor is"
55
authors = ["OpenLess"]
66
edition = "2021"

openless-all/app/src-tauri/tauri.conf.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "OpenLess",
4-
"version": "1.2.3",
4+
"version": "1.2.4",
55
"identifier": "com.openless.app",
66
"build": {
77
"beforeDevCommand": "npm run dev",
@@ -26,6 +26,10 @@
2626
"shadow": true,
2727
"hiddenTitle": true,
2828
"titleBarStyle": "Overlay",
29+
"trafficLightPosition": {
30+
"x": 12,
31+
"y": 12
32+
},
2933
"visible": true
3034
},
3135
{

openless-all/app/src/components/WindowChrome.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export function detectOS(): OS {
2424
return 'mac';
2525
}
2626

27+
const MAC_TITLEBAR_HEIGHT = 36;
28+
const MAC_TRAFFIC_LIGHT_RESERVED_WIDTH = 76;
29+
2730
interface WindowChromeProps {
2831
os?: OS;
2932
title?: string;
@@ -54,18 +57,17 @@ export function WindowChrome({ os = 'mac', title = 'OpenLess', children, height
5457
}}
5558
>
5659
{os === 'win' && <WinTitleBar title={title} />}
57-
{/* macOS:窗口装饰由系统画三色按钮(titleBarStyle: Overlay),
58-
这里只放一条不可见的拖动条覆盖在按钮高度上方,让用户能从顶端拖动整个窗口。
59-
注意 left 留出 80px 给系统的 close/min/max,否则鼠标按下落在按钮上无法触发 close。 */}
60+
{/* macOS:窗口装饰由系统画三色按钮(titleBarStyle: Overlay + trafficLightPosition),
61+
顶部拖动区按标准标题栏高度铺开,并避开系统按钮热区。 */}
6062
{os === 'mac' && (
6163
<div
6264
data-tauri-drag-region
6365
style={{
6466
position: 'absolute',
6567
top: 0,
66-
left: 80,
68+
left: MAC_TRAFFIC_LIGHT_RESERVED_WIDTH,
6769
right: 0,
68-
height: 28,
70+
height: MAC_TITLEBAR_HEIGHT,
6971
zIndex: 50,
7072
}}
7173
/>

0 commit comments

Comments
 (0)