mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 03:27:43 +01:00
feat: add a border to the main window in Windows 10 (#343)
* feat: add a border to the main window in Windows 10 * refactor: remove unused code * refactor: add dark themed borders
This commit is contained in:
@@ -60,6 +60,7 @@
|
||||
"tauri-plugin-fs-pro-api": "^2.3.1",
|
||||
"tauri-plugin-macos-permissions-api": "^2.2.0",
|
||||
"tauri-plugin-screenshots-api": "^2.1.0",
|
||||
"tauri-plugin-windows-version-api": "^2.0.0",
|
||||
"use-debounce": "^10.0.4",
|
||||
"uuid": "^11.1.0",
|
||||
"wavesurfer.js": "^7.9.3",
|
||||
|
||||
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -134,6 +134,9 @@ importers:
|
||||
tauri-plugin-screenshots-api:
|
||||
specifier: ^2.1.0
|
||||
version: 2.1.0
|
||||
tauri-plugin-windows-version-api:
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0
|
||||
use-debounce:
|
||||
specifier: ^10.0.4
|
||||
version: 10.0.4(react@18.3.1)
|
||||
@@ -3314,6 +3317,9 @@ packages:
|
||||
tauri-plugin-screenshots-api@2.1.0:
|
||||
resolution: {integrity: sha512-lknHlq7truhBCO4lVlHBWkk/YYrKXNef0mveUftHC3U0LBI/GTNzOFbyZk+VhHAcztTB5BPpZA0TSbuLd9zgQA==}
|
||||
|
||||
tauri-plugin-windows-version-api@2.0.0:
|
||||
resolution: {integrity: sha512-tty5n4ASYbXpnsD5ws2iTcTTpDCrSbzRTVp5Bo3UTpYGqlN1gBn2Zk8s3oO4w7VIM5WtJhDM9Jr/UgoTk7tFJQ==}
|
||||
|
||||
thenify-all@1.6.0:
|
||||
resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}
|
||||
engines: {node: '>=0.8'}
|
||||
@@ -7013,6 +7019,10 @@ snapshots:
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.4.0
|
||||
|
||||
tauri-plugin-windows-version-api@2.0.0:
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.4.0
|
||||
|
||||
thenify-all@1.6.0:
|
||||
dependencies:
|
||||
thenify: 3.3.1
|
||||
|
||||
14
src-tauri/Cargo.lock
generated
14
src-tauri/Cargo.lock
generated
@@ -773,6 +773,7 @@ dependencies = [
|
||||
"tauri-plugin-store",
|
||||
"tauri-plugin-updater",
|
||||
"tauri-plugin-websocket",
|
||||
"tauri-plugin-windows-version",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
@@ -6134,6 +6135,19 @@ dependencies = [
|
||||
"tokio-tungstenite 0.26.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-windows-version"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "76a116b1451af25fab5649f53bc6d8192bb65238b5817c94ea4f5a55bc6725a8"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 2.0.12",
|
||||
"windows-version",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.5.0"
|
||||
|
||||
@@ -69,6 +69,7 @@ http = "1.1.0"
|
||||
tungstenite = "0.24.0"
|
||||
env_logger = "0.11.5"
|
||||
tokio-util = "0.7.14"
|
||||
tauri-plugin-windows-version = "2"
|
||||
|
||||
[target."cfg(target_os = \"macos\")".dependencies]
|
||||
tauri-nspanel = { git = "https://github.com/ahkohd/tauri-nspanel", branch = "v2" }
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
"screenshots:default",
|
||||
"core:window:allow-set-theme",
|
||||
"process:default",
|
||||
"updater:default"
|
||||
"updater:default",
|
||||
"windows-version:default"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -82,7 +82,8 @@ pub fn run() {
|
||||
.plugin(tauri_plugin_macos_permissions::init())
|
||||
.plugin(tauri_plugin_screenshots::init())
|
||||
.plugin(tauri_plugin_process::init())
|
||||
.plugin(tauri_plugin_updater::Builder::new().build());
|
||||
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||
.plugin(tauri_plugin_windows_version::init());
|
||||
|
||||
// Conditional compilation for macOS
|
||||
#[cfg(target_os = "macos")]
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
use tauri::{App, WebviewWindow};
|
||||
|
||||
pub fn platform(_app: &mut App, _main_window: WebviewWindow, _settings_window: WebviewWindow) {}
|
||||
pub fn platform(_app: &mut App, _main_window: WebviewWindow, _settings_window: WebviewWindow) {}
|
||||
|
||||
@@ -5,8 +5,10 @@ import {
|
||||
useReducer,
|
||||
Suspense,
|
||||
memo,
|
||||
useState,
|
||||
} from "react";
|
||||
import clsx from "clsx";
|
||||
import { isWindows10 } from "tauri-plugin-windows-version-api";
|
||||
|
||||
import Search from "@/components/Search/Search";
|
||||
import InputBox from "@/components/Search/InputBox";
|
||||
@@ -22,19 +24,20 @@ import { useStartupStore } from "@/stores/startupStore";
|
||||
import { DataSource } from "@/types/commands";
|
||||
import { useThemeStore } from "@/stores/themeStore";
|
||||
import { Get } from "@/api/axiosRequest";
|
||||
import { useMount } from "ahooks";
|
||||
|
||||
interface SearchChatProps {
|
||||
isTauri?: boolean;
|
||||
hasModules?: string[];
|
||||
defaultModule?: "search" | "chat";
|
||||
|
||||
|
||||
hasFeature?: string[];
|
||||
showChatHistory?: boolean;
|
||||
|
||||
|
||||
theme?: "auto" | "light" | "dark";
|
||||
searchPlaceholder?: string;
|
||||
chatPlaceholder?: string;
|
||||
|
||||
|
||||
hideCoco?: () => void;
|
||||
setIsPinned?: (value: boolean) => void;
|
||||
querySearch: (input: string) => Promise<any>;
|
||||
@@ -74,6 +77,7 @@ function SearchChat({
|
||||
isDeepThinkActive,
|
||||
isTyping,
|
||||
} = state;
|
||||
const [isWin10, setIsWin10] = useState(false);
|
||||
|
||||
useWindowEvents();
|
||||
|
||||
@@ -84,6 +88,12 @@ function SearchChat({
|
||||
|
||||
const setTheme = useThemeStore((state) => state.setTheme);
|
||||
|
||||
useMount(async () => {
|
||||
const isWin10 = await isWindows10();
|
||||
|
||||
setIsWin10(isWin10);
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
let mounted = true;
|
||||
|
||||
@@ -325,6 +335,7 @@ function SearchChat({
|
||||
"w-screen h-screen": isTauri,
|
||||
"rounded-xl": !isWin,
|
||||
"border border-[#E6E6E6] dark:border-[#272626]": isLinux,
|
||||
"border-t border-t-[#999] dark:border-t-[#333]": isWin10,
|
||||
}
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user