mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-08 21:38:13 -05:00
🐛 Fix: mini window drag bug
This commit is contained in:
parent
ea20d3b971
commit
34b3656605
@ -26,7 +26,8 @@ import {
|
|||||||
OPEN_USER_STORE_FILE,
|
OPEN_USER_STORE_FILE,
|
||||||
OPEN_URL,
|
OPEN_URL,
|
||||||
RELOAD_APP,
|
RELOAD_APP,
|
||||||
SHOW_PLUGIN_PAGE_MENU
|
SHOW_PLUGIN_PAGE_MENU,
|
||||||
|
SET_MINI_WINDOW_POS
|
||||||
} from '#/events/constants'
|
} from '#/events/constants'
|
||||||
import {
|
import {
|
||||||
uploadClipboardFiles,
|
uploadClipboardFiles,
|
||||||
@ -212,6 +213,10 @@ export default {
|
|||||||
app.relaunch()
|
app.relaunch()
|
||||||
app.exit(0)
|
app.exit(0)
|
||||||
})
|
})
|
||||||
|
ipcMain.on(SET_MINI_WINDOW_POS, (evt: IpcMainEvent, pos: IMiniWindowPos) => {
|
||||||
|
const window = BrowserWindow.getFocusedWindow()
|
||||||
|
window?.setBounds(pos)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
dispose () {}
|
dispose () {}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ import {
|
|||||||
ipcRenderer,
|
ipcRenderer,
|
||||||
IpcRendererEvent
|
IpcRendererEvent
|
||||||
} from 'electron'
|
} from 'electron'
|
||||||
import { SHOW_MINI_PAGE_MENU } from '~/universal/events/constants'
|
import { SHOW_MINI_PAGE_MENU, SET_MINI_WINDOW_POS } from '~/universal/events/constants'
|
||||||
@Component({
|
@Component({
|
||||||
name: 'mini-page',
|
name: 'mini-page',
|
||||||
mixins: [mixin]
|
mixins: [mixin]
|
||||||
@ -118,9 +118,14 @@ export default class extends Vue {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
if (this.dragging) {
|
if (this.dragging) {
|
||||||
// const xLoc = e.screenX - this.wX
|
const xLoc = e.screenX - this.wX
|
||||||
// const yLoc = e.screenY - this.wY
|
const yLoc = e.screenY - this.wY
|
||||||
// FIXME: drag
|
ipcRenderer.send(SET_MINI_WINDOW_POS, {
|
||||||
|
x: xLoc,
|
||||||
|
y: yLoc,
|
||||||
|
width: 64,
|
||||||
|
height: 64
|
||||||
|
})
|
||||||
// remote.BrowserWindow.getFocusedWindow()!.setBounds({
|
// remote.BrowserWindow.getFocusedWindow()!.setBounds({
|
||||||
// x: xLoc,
|
// x: xLoc,
|
||||||
// y: yLoc,
|
// y: yLoc,
|
||||||
|
@ -27,3 +27,4 @@ export const PICGO_CONFIG_PLUGIN = 'PICGO_CONFIG_PLUGIN'
|
|||||||
export const PICGO_HANDLE_PLUGIN_ING = 'PICGO_HANDLE_PLUGIN_ING'
|
export const PICGO_HANDLE_PLUGIN_ING = 'PICGO_HANDLE_PLUGIN_ING'
|
||||||
export const PICGO_TOGGLE_PLUGIN = 'PICGO_TOGGLE_PLUGIN'
|
export const PICGO_TOGGLE_PLUGIN = 'PICGO_TOGGLE_PLUGIN'
|
||||||
export const PASTE_TEXT = 'PASTE_TEXT'
|
export const PASTE_TEXT = 'PASTE_TEXT'
|
||||||
|
export const SET_MINI_WINDOW_POS = 'SET_MINI_WINDOW_POS'
|
||||||
|
7
src/universal/types/types.d.ts
vendored
7
src/universal/types/types.d.ts
vendored
@ -326,3 +326,10 @@ interface IStringKeyMap {
|
|||||||
type ILogArgvType = string | number
|
type ILogArgvType = string | number
|
||||||
|
|
||||||
type ILogArgvTypeWithError = ILogArgvType | Error
|
type ILogArgvTypeWithError = ILogArgvType | Error
|
||||||
|
|
||||||
|
interface IMiniWindowPos {
|
||||||
|
x: number,
|
||||||
|
y: number,
|
||||||
|
height: number,
|
||||||
|
width: number
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user