chore: release 1.2.4 mac titlebar polish
This commit is contained in:
1 parent
0378dd15ce
commit
a853b592a1
6 files changed
+17
-11
No files matched your search
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "openless-app",
|
||||
"version": "1.2.2",
|
||||
"version": "1.2.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "openless-app",
|
||||
"version": "1.2.2",
|
||||
"version": "1.2.4",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.1.1",
|
||||
"@tauri-apps/plugin-shell": "^2.0.1",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "openless-app",
|
||||
"private": true,
|
||||
"version": "1.2.3",
|
||||
"version": "1.2.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
Generated
+1
-1
@@ -3250,7 +3250,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "openless"
|
||||
version = "1.2.3"
|
||||
version = "1.2.4"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arboard",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "openless"
|
||||
version = "1.2.3"
|
||||
version = "1.2.4"
|
||||
description = "OpenLess — local voice input that types where your cursor is"
|
||||
authors = ["OpenLess"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "OpenLess",
|
||||
"version": "1.2.3",
|
||||
"version": "1.2.4",
|
||||
"identifier": "com.openless.app",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
@@ -26,6 +26,10 @@
|
||||
"shadow": true,
|
||||
"hiddenTitle": true,
|
||||
"titleBarStyle": "Overlay",
|
||||
"trafficLightPosition": {
|
||||
"x": 12,
|
||||
"y": 12
|
||||
},
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
|
||||
@@ -24,6 +24,9 @@ export function detectOS(): OS {
|
||||
return 'mac';
|
||||
}
|
||||
|
||||
const MAC_TITLEBAR_HEIGHT = 36;
|
||||
const MAC_TRAFFIC_LIGHT_RESERVED_WIDTH = 76;
|
||||
|
||||
interface WindowChromeProps {
|
||||
os?: OS;
|
||||
title?: string;
|
||||
@@ -54,18 +57,17 @@ export function WindowChrome({ os = 'mac', title = 'OpenLess', children, height
|
||||
}}
|
||||
>
|
||||
{os === 'win' && <WinTitleBar title={title} />}
|
||||
{/* macOS:窗口装饰由系统画三色按钮(titleBarStyle: Overlay),
|
||||
这里只放一条不可见的拖动条覆盖在按钮高度上方,让用户能从顶端拖动整个窗口。
|
||||
注意 left 留出 80px 给系统的 close/min/max,否则鼠标按下落在按钮上无法触发 close。 */}
|
||||
{/* macOS:窗口装饰由系统画三色按钮(titleBarStyle: Overlay + trafficLightPosition),
|
||||
顶部拖动区按标准标题栏高度铺开,并避开系统按钮热区。 */}
|
||||
{os === 'mac' && (
|
||||
<div
|
||||
data-tauri-drag-region
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 80,
|
||||
left: MAC_TRAFFIC_LIGHT_RESERVED_WIDTH,
|
||||
right: 0,
|
||||
height: 28,
|
||||
height: MAC_TITLEBAR_HEIGHT,
|
||||
zIndex: 50,
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user