Skip to content

Commit

Permalink
add backhome button (queryMatchWindow)
Browse files Browse the repository at this point in the history
  • Loading branch information
Java-S12138 committed Aug 17, 2022
1 parent 805e938 commit c2a2b7c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 11 deletions.
28 changes: 23 additions & 5 deletions frankElectron/queryMatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,28 @@ export const queryMatchIpc = async (mainWindow,userHeader) => {
})
// 关闭游戏历史窗口
ipcMain.on('query-match-close', () => {
for (const currentWindow of BrowserWindow.getAllWindows()) {
if (currentWindow.title === 'QueryMatch'){
currentWindow.close()
}
}
closeWin(false)
})
// 关闭查询游戏窗口, 回到主页
ipcMain.on('query-match-back-home',() => {
closeWin(true)
})
}

const closeWin = (showMain) => {
let queryMatchWin
let mainWin
for (const currentWindow of BrowserWindow.getAllWindows()) {
if (currentWindow.title === 'QueryMatch'){
queryMatchWin = currentWindow
}else if (currentWindow.title === 'Frank'){
mainWin = currentWindow
}
}
if (showMain){
queryMatchWin.close()
mainWin.show()
}else {
queryMatchWin.close()
}
}
35 changes: 29 additions & 6 deletions src/render/components/queryMatch/dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<header class="frankTitle">
<n-space class="frankTitle" v-mouse-drag="handldDrge" >
<header class="frankTitle" v-mouse-drag="handldDrge">
<n-space class="frankTitle" >
<img src="../../assets/icon/app-icon.png" draggable="false" alt="" width="40" @click="handleMin">
<img src="../../assets/icon/Frank.png" draggable="false" style="margin-top: 4px">
<n-space class="rightCorner">
Expand All @@ -17,6 +17,18 @@
最小化
</n-popover>

<n-popconfirm @positive-click="backHome" :show-icon="false"
negative-text="取消" positive-text="确认">
<template #trigger>
<n-button text circle color="black" style="margin-right: 2px">
<n-icon size="24">
<smart-home/>
</n-icon>
</n-button>
</template>
是否回到软件主页
</n-popconfirm>

<n-popconfirm @positive-click="handleClose" :show-icon="false"
negative-text="取消" positive-text="确认">
<template #trigger>
Expand All @@ -30,21 +42,23 @@
</n-popconfirm>
</n-space>
</n-space>
<n-space style="margin-top: -8px">
<n-space style="margin-right: 64px">
<n-space class="rightSpace">
<n-space style="margin-right: 65px">
<n-input style="width: 153px;" size="small" v-model:value="searchName" @keydown.enter="searchSummonerInfo" placeholder="仅支持当前大区玩家"/>
<n-button type="success" size="small" @click="searchSummonerInfo" >搜索</n-button>
</n-space>
<n-pagination :on-update-page="changePage(page)"
v-model:page="page" :page-count="20" :page-slot="7" />

</n-space>

</header>
</template>

<script setup>
import {NIcon, NSpace, NButton, NPopover,NPopconfirm,
NInput,NPagination,useMessage} from 'naive-ui'
import {ChevronsDownLeft,CircleX} from '@vicons/tabler'
import {ChevronsDownLeft,CircleX,SmartHome} from '@vicons/tabler'
import {ipcRenderer} from 'electron'
import {ref} from "vue";
import {appConfig} from "@/utils/main/config";
Expand Down Expand Up @@ -102,6 +116,12 @@ const handleMin = () => {
const handleClose = () => {
ipcRenderer.send('query-match-close')
}
const backHome = () => {
ipcRenderer.send('query-match-back-home')
}
</script>

Expand All @@ -114,11 +134,14 @@ header {
.rightCorner {
padding-top: 8px;
margin-left: 45px;
margin-left: 8px;
}
.frankTitle {
align-items: center
}
.rightSpace {
margin-top: -8px;align-items: center
}
</style>

0 comments on commit c2a2b7c

Please sign in to comment.