提交 1c51b652 authored 作者: caicai's avatar caicai

显示所有应用

上级 87f609d4
......@@ -6,11 +6,29 @@ class AppEvents {
this.windowManager = appManager.windowManager
app.on('activate', () => {
console.log('\n app activate!', new Date().getTime() )
if (this.windowManager.mainWindow.win === null) {
console.log('Main window is null!')
}
})
app.on('browser-window-blur', () => {
console.log('\n app browser-window-blur!', new Date().getTime() )
})
app.on('browser-window-focus', () => {
console.log('app browser-window-focus!', new Date().getTime() )
})
app.on('continue-activit', () => {
console.log('\n app continue-activit!', new Date().getTime() )
})
app.on('did-become-active', () => {
console.log('\n app did-become-active!', new Date().getTime() )
})
/* 在Electron加载前需要进行初始化
Before electron app is ready, we should initial */
app.on('ready', async () => {
......
......@@ -108,7 +108,6 @@ class IpcEvents {
// 获取app列表
ipcMain.on("getApps", (e, data) => {
let apps = this.store.get("apps");
// console.log(apps)
this.store.set("currentMode", "modeJianYue");
e.sender.send("appsList", apps)
})
......@@ -140,7 +139,7 @@ class IpcEvents {
this.store.set("apps", apps);
e.sender.send("base64Info", {url:src,index});
} catch (error) {
console.error(error)
}
})
......
......@@ -11,7 +11,7 @@ import { protocol } from 'electron'
//热加载
try {
require('electron-reloader')(module);
// require('electron-reloader')(module);
} catch {}
// Scheme must be registered before the app is ready
......
......@@ -40,7 +40,7 @@ class SoftList {
const iconPaths = stdout.toString().split('\n').filter(path => path && path.trim() !== '');
return iconPaths;
} catch (error) {
// console.error(`命令执行失败: ${error}`);
console.error(`命令执行失败: ${error}`);
return null;
}
}
......@@ -50,6 +50,7 @@ class SoftList {
let locolorIcon = '';
let hiMax = 0;
let loMax = 0;
if(!iconList) return icon;
iconList.forEach(v => {
if(v && typeof v =='string' && v.indexOf('/hicolor/')>0) {
let str = v.replace('/usr/share/icons/hicolor/','')
......@@ -150,7 +151,7 @@ class SoftList {
this.store.set('apps', newApps);
this.mainWindow.win.webContents.send("appsList", newApps);
} catch (error) {
// console.error(error)
console.error(error)
}
});
}
......@@ -283,7 +284,7 @@ class SoftList {
src = `data:image/png;base64,${imageBase64}`;
src = src.replace(/[\r\n]/g, '');
} catch (error) {
console.error( error )
}
return src;
}
......
......@@ -15,7 +15,7 @@ export default {
display: flex;
flex-wrap: wrap;
margin-top: 24px;
padding: 30px 40px 18px;
padding: 30px 20px 18px;
background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0.5) 100%);
box-shadow: 0px 4px 4px 0px rgba(10,78,141,0.1);
border-radius: 20px 20px 20px 20px;
......
......@@ -12,8 +12,8 @@
:data-appname="appItem.name"
class="app_item"
@click="tapApp(appItem)">
<img :src="appItem.icon" alt="" class="img" v-if="appItem.icon && appItem.icon.indexOf('.png') == -1">
<span class="app_name">{{ appItem.name }}</span>
<img :src="appItem.icon" alt="" class="img" v-if="appItem.icon && appItem.icon.indexOf('.png') == -1">
<span class="app_name">{{ appItem.name }}</span>
</div>
</div>
<div v-if="mode === 'modeJianYue'" class="group1_wrap">
......@@ -149,6 +149,7 @@ export default {
}
}
.app_item {
position: relative;
margin: 0 4px;
flex-shrink: 0;
width: 36px;
......@@ -159,10 +160,15 @@ export default {
align-items: center;
justify-content: center;
font-size: 10px;
overflow: hidden;
// overflow: hidden;
text-align: left;
cursor: pointer;
flex-wrap: wrap;
&:hover {
.app_name {
display: block;
}
}
}
.img {
flex-shrink: 0;
......@@ -170,8 +176,18 @@ export default {
// width: 36px;
}
.app_name {
display: none;
position: absolute;
top: -10px;
left: -20px;
border-radius: 4px;
padding:4px;
width: max-content;
background-color: #333;
word-break: normal;
font-size: 14px;
color: #fff;
z-index: 99;
}
.yun_img {
width: 58px;
......
......@@ -42,6 +42,7 @@ import {
Tabs,
TabPane,
Tree,
Tooltip,
Upload,
Dialog,
Breadcrumb,
......@@ -76,6 +77,7 @@ Vue.use(RouterTab);
Vue.use(ace);
Vue.use(componentsInstall)
Vue.use(Tooltip);
Vue.use(Button);
Vue.use(Col);
Vue.use(Drawer);
......
......@@ -178,6 +178,7 @@ export default {
this.appList.forEach((item, index) => {
// console.log(item.icon)
if (item.icon && item.icon.indexOf("data:image/png") == -1) {
// console.log('getBase64', index)
this.ipcRenderer.send("getBase64", { imagePath: item.icon, index });
}
});
......@@ -186,7 +187,7 @@ export default {
this.ipcRenderer.on("appsList_update", (event, list) => {
console.log("刷新app列表", list);
// this.appList = list;
this.appList = list;
// this.getPinyin();
});
......
......@@ -71,21 +71,21 @@ export default {
methods: {
getAppList() {
//获取app列表
console.log('getAppList')
console.log('getAppList 2')
this.ipcRenderer.send("getApps");
},
ipcOn() {
// 获取到app列表
this.ipcRenderer.on("appsList", (event, list) => {
console.log("获取到app列表", list);
console.log("获取到app列表 2", list);
this.listObj.lastest = list;
this.appList = list;
this.appList.forEach((item, index) => {
// console.log(item.icon)
if (item.icon && item.icon.indexOf("data:image/png") == -1) {
this.ipcRenderer.send("getBase64", { imagePath: item.icon, index });
}
});
// this.appList.forEach((item, index) => {
// // console.log(item.icon)
// if (item.icon && item.icon.indexOf("data:image/png") == -1) {
// this.ipcRenderer.send("getBase64", { imagePath: item.icon, index });
// }
// });
// this.getPinyin();
});
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论