Skip to content

Commit

Permalink
fix:修复窗口置顶时,退出是看不到弹窗
Browse files Browse the repository at this point in the history
  • Loading branch information
pangxiaobin committed Aug 5, 2024
1 parent e9bb337 commit f7126bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,17 @@ def on_resized(width, height):
config.save("window.width", int(width))
config.save("window.height", int(height))

def on_closing():
# 防止窗口置顶,确认退出框不展示在最前面
time.sleep(0.01)
if window.on_top:
window.on_top = False

def bind(window):
window.events.closed += on_close
window.events.resized += on_resized
window.events.moved += on_moved
window.events.closing += on_closing

try:
webview.start(bind, window, debug=settings.DEBUG, http_server=True)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Layout/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</svg>
</label>

<div class="tooltip tooltip-bottom ml-4 text-xl " :data-tip="!windowPinned ? t('basicHeader.pin_window') : t('basicHeader.unpin_window')">
<div class="tooltip tooltip-left ml-4 text-xl " :data-tip="!windowPinned ? t('basicHeader.pin_window') : t('basicHeader.unpin_window')">
<i v-if="!windowPinned" class="fa-solid fa-arrow-up" @click="toggleWindowPin"></i>

<i v-else class="fa-solid fa-arrow-down" @click="toggleWindowPin"></i>
Expand Down

0 comments on commit f7126bf

Please sign in to comment.