mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-02 11:08:13 -05: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
|
||||
})
|
||||
|
||||
ipcMain.on('toggleMainWindowAlwaysOnTop', () => {
|
||||
const mainWindow = windowManager.get(IWindowList.SETTING_WINDOW)!
|
||||
const isAlwaysOnTop = mainWindow.isAlwaysOnTop()
|
||||
mainWindow.setAlwaysOnTop(!isAlwaysOnTop)
|
||||
})
|
||||
|
||||
ipcMain.on('openSettingWindow', () => {
|
||||
windowManager.get(IWindowList.SETTING_WINDOW)!.show()
|
||||
if (windowManager.has(IWindowList.MINI_WINDOW)) {
|
||||
|
@ -10,6 +10,15 @@
|
||||
v-if="os !== 'darwin'"
|
||||
class="handle-bar"
|
||||
>
|
||||
<el-icon
|
||||
class="minus"
|
||||
:color="isAlwaysOnTop ? '#409EFF' : '#fff'"
|
||||
size="20"
|
||||
style="margin-right: 10px;"
|
||||
@click="setAlwaysOnTop"
|
||||
>
|
||||
<ArrowUpBold />
|
||||
</el-icon>
|
||||
<el-icon
|
||||
class="minus"
|
||||
color="#fff"
|
||||
@ -17,7 +26,7 @@
|
||||
style="margin-right: 10px;"
|
||||
@click="minimizeWindow"
|
||||
>
|
||||
<Minus />
|
||||
<SemiSelect />
|
||||
</el-icon>
|
||||
<el-icon
|
||||
class="plus"
|
||||
@ -26,7 +35,7 @@
|
||||
style="margin-right: 10px;"
|
||||
@click="openMiniWindow"
|
||||
>
|
||||
<CirclePlus />
|
||||
<ArrowDownBold />
|
||||
</el-icon>
|
||||
<el-icon
|
||||
class="close"
|
||||
@ -34,7 +43,7 @@
|
||||
size="20"
|
||||
@click="closeWindow"
|
||||
>
|
||||
<Close />
|
||||
<CloseBold />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
@ -232,11 +241,12 @@ import {
|
||||
Menu,
|
||||
Share,
|
||||
InfoFilled,
|
||||
Minus,
|
||||
CirclePlus,
|
||||
Close,
|
||||
SemiSelect,
|
||||
ArrowDownBold,
|
||||
CloseBold,
|
||||
PieChart,
|
||||
Link
|
||||
Link,
|
||||
ArrowUpBold
|
||||
} from '@element-plus/icons-vue'
|
||||
import { ElMessage as $message, ElMessageBox } from 'element-plus'
|
||||
import { T as $T } from '@/i18n/index'
|
||||
@ -273,6 +283,7 @@ const picBed: Ref<IPicBedType[]> = ref([])
|
||||
const qrcodeVisible = ref(false)
|
||||
const picBedConfigString = 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)
|
||||
|
||||
@ -367,6 +378,11 @@ function getPicBeds (event: IpcRendererEvent, picBeds: IPicBedType[]) {
|
||||
picBed.value = picBeds
|
||||
}
|
||||
|
||||
function setAlwaysOnTop () {
|
||||
isAlwaysOnTop.value = !isAlwaysOnTop.value
|
||||
sendToMain('toggleMainWindowAlwaysOnTop', isAlwaysOnTop.value)
|
||||
}
|
||||
|
||||
onBeforeRouteUpdate(async (to) => {
|
||||
if (to.params.type) {
|
||||
defaultActive.value = `${routerConfig.UPLOADER_CONFIG_PAGE}-${to.params.type}`
|
||||
|
Loading…
Reference in New Issue
Block a user