feat: souport windows

This commit is contained in:
muwoo 2021-12-21 18:03:58 +08:00
parent 571ff12730
commit 3ba4be2e4a
6 changed files with 23 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "rubick",
"version": "2.0.1-beta.4",
"version": "2.0.1-beta.5",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -17,6 +17,8 @@ export default function getCopyFiles(): Array<any> | null {
return null;
}
} else if (commonConst.windows()) {
const filePath = clipboard.readBuffer('FileNameW').toString('ucs2').replace(RegExp(String.fromCharCode(0), 'g'), '');
fileInfo = [filePath];
// todo
} else {
if (!commonConst.linux()) return null;

View File

@ -3,6 +3,10 @@ import path from "path";
import commonConst from "../../common/utils/commonConst";
import { PLUGIN_INSTALL_DIR as baseDir } from "@/common/constans/main";
const getRelativePath = (indexPath) => {
return commonConst.windows() ? indexPath.replace("file://", "") : indexPath.replace("file:", "");
}
const getPreloadPath = (plugin, pluginIndexPath) => {
const { name, preload, tplPath, indexPath } = plugin;
if (!preload) return;

View File

@ -31,6 +31,7 @@ const API: any = {
currentPlugin: API.currentPlugin,
})})`
);
window.show();
},
removePlugin(e, window) {
API.currentPlugin = null;

View File

@ -1,5 +1,6 @@
<template>
<div id="components-layout">
<div v-if="commonConst.windows()" class="drag-bar"></div>
<div :class="!commonConst.windows() && 'drag'" id="components-layout">
<div class="rubick-select">
<Search
:currentPlugin="currentPlugin"
@ -33,6 +34,7 @@ import Result from "./components/result.vue";
import Search from "./components/search.vue";
import getWindowHeight from "../common/utils/getWindowHeight";
import createPluginManager from "./plugins-manager";
import commonConst from "@/common/utils/commonConst";
const {
initPlugins,
@ -100,12 +102,23 @@ const choosePlugin = () => {
</script>
<style lang="less">
.drag-bar {
-webkit-app-region: drag;
width: 100%;
height: 20px;
position: fixed;
z-index: 1;
top: 0;
left: 0;
}
#components-layout {
height: 100vh;
overflow: hidden;
-webkit-app-region: drag;
::-webkit-scrollbar {
width: 0;
}
}
.drag {
-webkit-app-region: drag;
}
</style>