Skip to content

Commit

Permalink
Merge pull request #94 from SRVFI-Raws/main
Browse files Browse the repository at this point in the history
全平台统一红绿灯🚥
关注明透喵 关注明透谢谢喵
  • Loading branch information
DamnCrab authored Jul 27, 2023
2 parents 2b0f708 + d642030 commit 380a4ce
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 16 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"sass": "^1.64.1",
"systeminformation": "^5.18.7",
"typescript": "^5.1.6",
"vfonts": "^0.0.3",
"vite": "^4.4.7",
"vitest": "^0.33.0",
"vue": "^3.2.47",
Expand Down
30 changes: 26 additions & 4 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ function createWindow(): void {
minWidth: 670,
maxHeight: 670,
minHeight: 470,
// frame: process.platform !== 'darwin',
// titleBarStyle: 'hiddenInset',
frame: true,
frame: false,
show: false,
autoHideMenuBar: true,
icon: nativeImage.createFromPath(icon),
Expand All @@ -41,6 +39,26 @@ function createWindow(): void {

ipcMain.on('open-directory-dialog', openDirectory)

ipcMain.on('minimize', () => {
mainWindow.minimize()
})

ipcMain.on('maximize', () => {
if (mainWindow.isMaximized()) {
mainWindow.restore()
} else {
mainWindow.maximize()
}
})

ipcMain.on('close', () => {
if (process.platform !== 'darwin') {
app.quit()
} else {
app.hide()
}
})

mainWindow.on('ready-to-show', () => {
mainWindow.show()
})
Expand Down Expand Up @@ -72,7 +90,11 @@ function setTray(): void {
click: (): void => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
} else {
BrowserWindow.getAllWindows()[0].show()
}
}
},
{
Expand Down
13 changes: 3 additions & 10 deletions src/renderer/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useI18n } from 'vue-i18n'
import { getLanguage } from './utils'
import { switchCSSStyle } from './utils/DarkModeColor'
import { useGlobalSettingsStore } from './store/globalSettingsStore'
import TrafficLightsButtons from './components/TrafficLightsButtons.vue'
import MyProgress from './components/MyProgress.vue'
import BottomNavigation from './components/bottomNavigation.vue'
Expand Down Expand Up @@ -95,10 +96,11 @@ const themeOverrides = {

<template>
<n-config-provider :theme="getTheme" :theme-overrides="themeOverrides">
<n-global-style />
<n-notification-provider class="n-config-provider" placement="top">
<n-dialog-provider>
<!-- <div class="drag" />-->
<div class="background">
<traffic-lights-buttons />
<MyProgress />
<div class="view">
<router-view v-slot="{ Component }">
Expand All @@ -113,7 +115,6 @@ const themeOverrides = {
</div>
</n-dialog-provider>
</n-notification-provider>
<n-global-style />
</n-config-provider>
</template>

Expand Down Expand Up @@ -158,14 +159,6 @@ $buttom-bottom: 8px;
}
}
//.drag {
// width: 100%;
// height: 30px;
// position: fixed;
// background-color: $global-color;
// -webkit-app-region: drag;
//}
.fade-enter-active {
transition: opacity 0.6s ease-in-out;
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/components/MyProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ watchEffect(() => {
.control {
box-sizing: border-box;
width: 100%;
padding: 12px 40px 0 40px;
padding: 30px 40px 0 40px;
display: flex;
justify-content: space-between;
Expand All @@ -225,6 +225,6 @@ watchEffect(() => {
}
.n-divider {
margin: 30px 0 0 0 !important;
margin: 10px 0 0 0 !important;
}
</style>
Loading

0 comments on commit 380a4ce

Please sign in to comment.