mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-03-15 17:28:13 -04:00
✨ Feature: add always on top icon on main page
This commit is contained in:
parent
62ffc78481
commit
8f512fe488
@ -205,6 +205,12 @@ export default {
|
|||||||
return dataResult + bakResult + manageResult + manageBakResult
|
return dataResult + bakResult + manageResult + manageBakResult
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ipcMain.on('toggleMainWindowAlwaysOnTop', () => {
|
||||||
|
const mainWindow = windowManager.get(IWindowList.SETTING_WINDOW)!
|
||||||
|
const isAlwaysOnTop = mainWindow.isAlwaysOnTop()
|
||||||
|
mainWindow.setAlwaysOnTop(!isAlwaysOnTop)
|
||||||
|
})
|
||||||
|
|
||||||
ipcMain.on('openSettingWindow', () => {
|
ipcMain.on('openSettingWindow', () => {
|
||||||
windowManager.get(IWindowList.SETTING_WINDOW)!.show()
|
windowManager.get(IWindowList.SETTING_WINDOW)!.show()
|
||||||
if (windowManager.has(IWindowList.MINI_WINDOW)) {
|
if (windowManager.has(IWindowList.MINI_WINDOW)) {
|
||||||
|
@ -10,6 +10,15 @@
|
|||||||
v-if="os !== 'darwin'"
|
v-if="os !== 'darwin'"
|
||||||
class="handle-bar"
|
class="handle-bar"
|
||||||
>
|
>
|
||||||
|
<el-icon
|
||||||
|
class="minus"
|
||||||
|
:color="isAlwaysOnTop ? '#409EFF' : '#fff'"
|
||||||
|
size="20"
|
||||||
|
style="margin-right: 10px;"
|
||||||
|
@click="setAlwaysOnTop"
|
||||||
|
>
|
||||||
|
<ArrowUpBold />
|
||||||
|
</el-icon>
|
||||||
<el-icon
|
<el-icon
|
||||||
class="minus"
|
class="minus"
|
||||||
color="#fff"
|
color="#fff"
|
||||||
@ -17,7 +26,7 @@
|
|||||||
style="margin-right: 10px;"
|
style="margin-right: 10px;"
|
||||||
@click="minimizeWindow"
|
@click="minimizeWindow"
|
||||||
>
|
>
|
||||||
<Minus />
|
<SemiSelect />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-icon
|
<el-icon
|
||||||
class="plus"
|
class="plus"
|
||||||
@ -26,7 +35,7 @@
|
|||||||
style="margin-right: 10px;"
|
style="margin-right: 10px;"
|
||||||
@click="openMiniWindow"
|
@click="openMiniWindow"
|
||||||
>
|
>
|
||||||
<CirclePlus />
|
<ArrowDownBold />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-icon
|
<el-icon
|
||||||
class="close"
|
class="close"
|
||||||
@ -34,7 +43,7 @@
|
|||||||
size="20"
|
size="20"
|
||||||
@click="closeWindow"
|
@click="closeWindow"
|
||||||
>
|
>
|
||||||
<Close />
|
<CloseBold />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -232,11 +241,12 @@ import {
|
|||||||
Menu,
|
Menu,
|
||||||
Share,
|
Share,
|
||||||
InfoFilled,
|
InfoFilled,
|
||||||
Minus,
|
SemiSelect,
|
||||||
CirclePlus,
|
ArrowDownBold,
|
||||||
Close,
|
CloseBold,
|
||||||
PieChart,
|
PieChart,
|
||||||
Link
|
Link,
|
||||||
|
ArrowUpBold
|
||||||
} from '@element-plus/icons-vue'
|
} from '@element-plus/icons-vue'
|
||||||
import { ElMessage as $message, ElMessageBox } from 'element-plus'
|
import { ElMessage as $message, ElMessageBox } from 'element-plus'
|
||||||
import { T as $T } from '@/i18n/index'
|
import { T as $T } from '@/i18n/index'
|
||||||
@ -273,6 +283,7 @@ const picBed: Ref<IPicBedType[]> = ref([])
|
|||||||
const qrcodeVisible = ref(false)
|
const qrcodeVisible = ref(false)
|
||||||
const picBedConfigString = ref('')
|
const picBedConfigString = ref('')
|
||||||
const choosedPicBedForQRCode: Ref<string[]> = ref([])
|
const choosedPicBedForQRCode: Ref<string[]> = ref([])
|
||||||
|
const isAlwaysOnTop = ref(false)
|
||||||
|
|
||||||
const keepAlivePages = $router.getRoutes().filter(item => item.meta.keepAlive).map(item => item.name as string)
|
const keepAlivePages = $router.getRoutes().filter(item => item.meta.keepAlive).map(item => item.name as string)
|
||||||
|
|
||||||
@ -367,6 +378,11 @@ function getPicBeds (event: IpcRendererEvent, picBeds: IPicBedType[]) {
|
|||||||
picBed.value = picBeds
|
picBed.value = picBeds
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setAlwaysOnTop () {
|
||||||
|
isAlwaysOnTop.value = !isAlwaysOnTop.value
|
||||||
|
sendToMain('toggleMainWindowAlwaysOnTop', isAlwaysOnTop.value)
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeRouteUpdate(async (to) => {
|
onBeforeRouteUpdate(async (to) => {
|
||||||
if (to.params.type) {
|
if (to.params.type) {
|
||||||
defaultActive.value = `${routerConfig.UPLOADER_CONFIG_PAGE}-${to.params.type}`
|
defaultActive.value = `${routerConfig.UPLOADER_CONFIG_PAGE}-${to.params.type}`
|
||||||
|
Loading…
Reference in New Issue
Block a user