mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:43:44 +08:00
fix: clipboard doesn't work and set_shadow
method is not supported in Linux (#1030)
This commit is contained in:
parent
ae6530585a
commit
b8599a0642
@ -193,11 +193,11 @@ pub fn create_window(app_handle: &AppHandle) {
|
|||||||
}
|
}
|
||||||
Ok(center)
|
Ok(center)
|
||||||
})();
|
})();
|
||||||
|
|
||||||
if center.unwrap_or(true) {
|
if center.unwrap_or(true) {
|
||||||
trace_err!(win.center(), "set win center");
|
trace_err!(win.center(), "set win center");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "linux"))]
|
||||||
trace_err!(set_shadow(&win, true), "set win shadow");
|
trace_err!(set_shadow(&win, true), "set win shadow");
|
||||||
if is_maximized {
|
if is_maximized {
|
||||||
trace_err!(win.maximize(), "set win maximize");
|
trace_err!(win.maximize(), "set win maximize");
|
||||||
|
@ -52,6 +52,7 @@ import { atomThemeMode } from "@/services/states";
|
|||||||
import { BaseStyledTextField } from "@/components/base/base-styled-text-field";
|
import { BaseStyledTextField } from "@/components/base/base-styled-text-field";
|
||||||
import { listen } from "@tauri-apps/api/event";
|
import { listen } from "@tauri-apps/api/event";
|
||||||
import { readTextFile } from "@tauri-apps/api/fs";
|
import { readTextFile } from "@tauri-apps/api/fs";
|
||||||
|
import { readText } from "@tauri-apps/api/clipboard";
|
||||||
|
|
||||||
const ProfilePage = () => {
|
const ProfilePage = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -267,7 +268,7 @@ const ProfilePage = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onCopyLink = async () => {
|
const onCopyLink = async () => {
|
||||||
const text = await navigator.clipboard.readText();
|
const text = await readText();
|
||||||
if (text) setUrl(text);
|
if (text) setUrl(text);
|
||||||
};
|
};
|
||||||
const [mode] = useRecoilState(atomThemeMode);
|
const [mode] = useRecoilState(atomThemeMode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user