fix: quick ask not show (#2315)
* fix: quick ask not show * fix: window resize does not work on windows 11
This commit is contained in:
parent
c8ea16e661
commit
bbfc686c33
@ -68,11 +68,7 @@ app
|
|||||||
} else {
|
} else {
|
||||||
app.on('second-instance', (_event, _commandLine, _workingDirectory) => {
|
app.on('second-instance', (_event, _commandLine, _workingDirectory) => {
|
||||||
// Someone tried to run a second instance, we should focus our window.
|
// Someone tried to run a second instance, we should focus our window.
|
||||||
if (windowManager.mainWindow) {
|
windowManager.showMainWindow()
|
||||||
if (windowManager.mainWindow.isMinimized())
|
|
||||||
windowManager.mainWindow.restore()
|
|
||||||
windowManager.mainWindow.focus()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
app.on('activate', () => {
|
app.on('activate', () => {
|
||||||
@ -107,7 +103,12 @@ function createMainWindow() {
|
|||||||
|
|
||||||
function registerGlobalShortcuts() {
|
function registerGlobalShortcuts() {
|
||||||
const ret = registerShortcut(quickAskHotKey, (selectedText: string) => {
|
const ret = registerShortcut(quickAskHotKey, (selectedText: string) => {
|
||||||
windowManager.showMainWindow()
|
if (!windowManager.isQuickAskWindowVisible()) {
|
||||||
|
windowManager.showQuickAskWindow()
|
||||||
|
windowManager.sendQuickAskSelectedText(selectedText)
|
||||||
|
} else {
|
||||||
|
windowManager.hideQuickAskWindow()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
|
|||||||
@ -101,6 +101,7 @@ class WindowManager {
|
|||||||
expandQuickAskWindow(heightOffset: number): void {
|
expandQuickAskWindow(heightOffset: number): void {
|
||||||
const width = quickAskWindowConfig.width!
|
const width = quickAskWindowConfig.width!
|
||||||
const height = quickAskWindowConfig.height! + heightOffset
|
const height = quickAskWindowConfig.height! + heightOffset
|
||||||
|
this._quickAskWindow?.setMinimumSize(width, height)
|
||||||
this._quickAskWindow?.setSize(width, height, true)
|
this._quickAskWindow?.setSize(width, height, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user