This commit is contained in:
恍兮惚兮 2024-08-10 03:23:49 +08:00
parent 8bea7ec7d9
commit f2e25875c8
25 changed files with 103 additions and 106 deletions

View File

@ -432,15 +432,24 @@ def mainuisetting(self):
name="keepontopbutton", name="keepontopbutton",
), ),
"", "",
"",
"",
"",
"",
],
[
"自动调整高度", "自动调整高度",
D_getsimpleswitch(globalconfig, "adaptive_height"), D_getsimpleswitch(globalconfig, "adaptive_height"),
"", "",
],
[
"任务栏中显示", "任务栏中显示",
D_getsimpleswitch( D_getsimpleswitch(
globalconfig, globalconfig,
"showintab", "showintab",
callback=lambda _: gobject.baseobject.setshowintab(), callback=lambda _: gobject.baseobject.setshowintab(),
), ),
"",
], ],
[ [
"鼠标穿透窗口", "鼠标穿透窗口",
@ -452,6 +461,10 @@ def mainuisetting(self):
name="mousetransbutton", name="mousetransbutton",
), ),
"", "",
"增强效果",
D_getsimpleswitch(globalconfig, "mousetransparent_ex"),
],
[
"自动隐藏窗口", "自动隐藏窗口",
D_getsimpleswitch(globalconfig, "autodisappear"), D_getsimpleswitch(globalconfig, "autodisappear"),
"", "",

View File

@ -29,7 +29,7 @@ from gui.setting_about import doupdate
from gui.dialog_memory import dialog_memory from gui.dialog_memory import dialog_memory
from gui.textbrowser import Textbrowser from gui.textbrowser import Textbrowser
from gui.rangeselect import rangeselct_function from gui.rangeselect import rangeselct_function
from gui.usefulwidget import resizableframeless, isinrect, getQMessageBox, LIconLabel from gui.usefulwidget import resizableframeless, getQMessageBox, LIconLabel
from gui.edittext import edittrans from gui.edittext import edittrans
from gui.dialog_savedgame import browserdialog, dialog_savedgame_integrated from gui.dialog_savedgame import browserdialog, dialog_savedgame_integrated
from gui.dynalang import LDialog from gui.dynalang import LDialog
@ -993,15 +993,15 @@ class QUnFrameWindow(resizableframeless):
hwnd = int(self.winid) hwnd = int(self.winid)
while globalconfig["mousetransparent"]: while globalconfig["mousetransparent"]:
cursor_pos = self.mapFromGlobal(QCursor.pos()) cursor_pos = self.mapFromGlobal(QCursor.pos())
if isinrect( usegeo = self.titlebar.geometry()
cursor_pos, btn: QWidget = self.titlebar.buttons["mousetransbutton"]
[ if (
self.titlebar.x(), globalconfig["mousetransparent_ex"]
self.titlebar.x() + self.titlebar.width(), and (not btn.isVisible())
self.titlebar.y(), and (btn.reflayout is not None)
self.titlebar.y() + self.titlebar.height(),
],
): ):
usegeo = btn.geometry()
if usegeo.contains(cursor_pos):
windows.SetWindowLong( windows.SetWindowLong(
hwnd, hwnd,
@ -1127,7 +1127,6 @@ class QUnFrameWindow(resizableframeless):
self.set_color_transparency() self.set_color_transparency()
def checkisentered(self): def checkisentered(self):
onlychecktitle = globalconfig["mousetransparent"]
hwnd = windows.GetForegroundWindow() hwnd = windows.GetForegroundWindow()
hwndpid = windows.GetWindowThreadProcessId(hwnd) hwndpid = windows.GetWindowThreadProcessId(hwnd)
ismyprocbutnotmainuiforeground = hwndpid == os.getpid() and hwnd != int( ismyprocbutnotmainuiforeground = hwndpid == os.getpid() and hwnd != int(
@ -1135,11 +1134,20 @@ class QUnFrameWindow(resizableframeless):
) )
onlychecktitle = ( onlychecktitle = (
globalconfig["toolviswhenenter"] globalconfig["toolviswhenenter"]
or onlychecktitle or globalconfig["mousetransparent"]
or ismyprocbutnotmainuiforeground or ismyprocbutnotmainuiforeground
) )
if onlychecktitle: if onlychecktitle:
return self.titlebar.geometry().contains(self.mapFromGlobal(QCursor.pos())) usegeo = self.titlebar.geometry()
btn: QWidget = self.titlebar.buttons["mousetransbutton"]
if (
globalconfig["mousetransparent"]
and globalconfig["mousetransparent_ex"]
and (not btn.isVisible())
and (btn.reflayout is not None)
):
usegeo = btn.geometry()
return usegeo.contains(self.mapFromGlobal(QCursor.pos()))
else: else:
return self.geometry().contains(QCursor.pos()) return self.geometry().contains(QCursor.pos())

View File

@ -320,12 +320,6 @@ def getQMessageBox(
cancelcallback() cancelcallback()
def isinrect(pos, rect):
x, y = pos.x(), pos.y()
x1, x2, y1, y2 = rect
return x >= x1 and x <= x2 and y <= y2 and y >= y1
def makerect(_): def makerect(_):
x, y, w, h = _ x, y, w, h = _
return [x, x + w, y, y + h] return [x, x + w, y, y + h]
@ -651,58 +645,18 @@ class resizableframeless(saveposwindow):
self._corner_drag_youshang = False self._corner_drag_youshang = False
def resizeEvent(self, e): def resizeEvent(self, e):
pad = self._padding
w = self.width()
h = self.height()
if self._move_drag == False: if self._move_drag == False:
self._right_rect = [ self._right_rect = QRect(w - pad, pad, 2 * pad, h)
self.width() - self._padding, self._left_rect = QRect(-pad, pad, 2 * pad, h)
self.width() + self._padding, self._bottom_rect = QRect(pad, h - pad, w, 2 * pad)
self._padding, self._top_rect = QRect(pad, -pad, w, 2 * pad)
self.height() - self._padding, self._corner_youxia = QRect(w - pad, h - pad, 2 * pad, 2 * pad)
] self._corner_zuoxia = QRect(-pad, h - pad, 2 * pad, 2 * pad)
self._left_rect = [ self._corner_youshang = QRect(w - pad, -pad, 2 * pad, 2 * pad)
-self._padding, self._corner_zuoshang = QRect(-pad, -pad, 2 * pad, 2 * pad)
self._padding,
self._padding,
self.height() - self._padding,
]
self._bottom_rect = [
self._padding,
self.width() - self._padding,
self.height() - self._padding,
self.height() + self._padding,
]
self._top_rect = [
self._padding,
self.width() - self._padding,
-self._padding,
self._padding,
]
self._corner_youxia = [
self.width() - self._padding,
self.width() + self._padding,
self.height() - self._padding,
self.height() + self._padding,
]
self._corner_zuoxia = [
-self._padding,
self._padding,
self.height() - self._padding,
self.height() + self._padding,
]
self._corner_youshang = [
self.width() - self._padding,
self.width() + self._padding,
-self._padding,
self._padding,
]
self._corner_zuoshang = [
-self._padding,
self._padding,
-self._padding,
self._padding,
]
super().resizeEvent(e) super().resizeEvent(e)
def mousePressEvent(self, event: QMouseEvent): def mousePressEvent(self, event: QMouseEvent):
@ -714,21 +668,22 @@ class resizableframeless(saveposwindow):
self.startx = gpos.x() self.startx = gpos.x()
self.starth = self.height() self.starth = self.height()
self.startw = self.width() self.startw = self.width()
if isinrect(event.pos(), self._corner_youxia): pos = event.pos()
if self._corner_youxia.contains(pos):
self._corner_drag_youxia = True self._corner_drag_youxia = True
elif isinrect(event.pos(), self._right_rect): elif self._right_rect.contains(pos):
self._right_drag = True self._right_drag = True
elif isinrect(event.pos(), self._left_rect): elif self._left_rect.contains(pos):
self._left_drag = True self._left_drag = True
elif isinrect(event.pos(), self._top_rect): elif self._top_rect.contains(pos):
self._top_drag = True self._top_drag = True
elif isinrect(event.pos(), self._bottom_rect): elif self._bottom_rect.contains(pos):
self._bottom_drag = True self._bottom_drag = True
elif isinrect(event.pos(), self._corner_zuoxia): elif self._corner_zuoxia.contains(pos):
self._corner_drag_zuoxia = True self._corner_drag_zuoxia = True
elif isinrect(event.pos(), self._corner_youshang): elif self._corner_youshang.contains(pos):
self._corner_drag_youshang = True self._corner_drag_youshang = True
elif isinrect(event.pos(), self._corner_zuoshang): elif self._corner_zuoshang.contains(pos):
self._corner_drag_zuoshang = True self._corner_drag_zuoshang = True
else: else:
self._move_drag = True self._move_drag = True
@ -742,21 +697,21 @@ class resizableframeless(saveposwindow):
pos = event.pos() pos = event.pos()
gpos = QCursor.pos() gpos = QCursor.pos()
if isinrect(pos, self._corner_youxia): if self._corner_youxia.contains(pos):
self.setCursor(Qt.CursorShape.SizeFDiagCursor) self.setCursor(Qt.CursorShape.SizeFDiagCursor)
elif isinrect(pos, self._corner_zuoshang): elif self._corner_zuoshang.contains(pos):
self.setCursor(Qt.CursorShape.SizeFDiagCursor) self.setCursor(Qt.CursorShape.SizeFDiagCursor)
elif isinrect(pos, self._corner_zuoxia): elif self._corner_zuoxia.contains(pos):
self.setCursor(Qt.CursorShape.SizeBDiagCursor) self.setCursor(Qt.CursorShape.SizeBDiagCursor)
elif isinrect(pos, self._corner_youshang): elif self._corner_youshang.contains(pos):
self.setCursor(Qt.CursorShape.SizeBDiagCursor) self.setCursor(Qt.CursorShape.SizeBDiagCursor)
elif isinrect(pos, self._bottom_rect): elif self._bottom_rect.contains(pos):
self.setCursor(Qt.CursorShape.SizeVerCursor) self.setCursor(Qt.CursorShape.SizeVerCursor)
elif isinrect(pos, self._top_rect): elif self._top_rect.contains(pos):
self.setCursor(Qt.CursorShape.SizeVerCursor) self.setCursor(Qt.CursorShape.SizeVerCursor)
elif isinrect(pos, self._right_rect): elif self._right_rect.contains(pos):
self.setCursor(Qt.CursorShape.SizeHorCursor) self.setCursor(Qt.CursorShape.SizeHorCursor)
elif isinrect(pos, self._left_rect): elif self._left_rect.contains(pos):
self.setCursor(Qt.CursorShape.SizeHorCursor) self.setCursor(Qt.CursorShape.SizeHorCursor)
else: else:
self.setCursor(Qt.CursorShape.ArrowCursor) self.setCursor(Qt.CursorShape.ArrowCursor)

View File

@ -838,6 +838,7 @@
}, },
"disappear_delay_tool": 1, "disappear_delay_tool": 1,
"mousetransparent": false, "mousetransparent": false,
"mousetransparent_ex": false,
"adaptive_height": true, "adaptive_height": true,
"backtransparent": false, "backtransparent": false,
"showtranexception": true, "showtranexception": true,

View File

@ -853,5 +853,6 @@
"字符串替换": "سلسلة استبدال", "字符串替换": "سلسلة استبدال",
"转义": "هروب", "转义": "هروب",
"游戏已存在,是否重复添加?": "اللعبة موجودة بالفعل ، هل تريد تكرار ذلك ؟", "游戏已存在,是否重复添加?": "اللعبة موجودة بالفعل ، هل تريد تكرار ذلك ؟",
"点击消息后退出并开始更新": "انقر على رسالة الخروج والبدء في تحديث" "点击消息后退出并开始更新": "انقر على رسالة الخروج والبدء في تحديث",
"增强效果": "تعزيز تأثير"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "字串取代", "字符串替换": "字串取代",
"转义": "跳脫", "转义": "跳脫",
"游戏已存在,是否重复添加?": "遊戲已存在,是否重複新增?", "游戏已存在,是否重复添加?": "遊戲已存在,是否重複新增?",
"点击消息后退出并开始更新": "點擊消息後退出並開始更新" "点击消息后退出并开始更新": "點擊消息後退出並開始更新",
"增强效果": "增强效果"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Náhrada řetězce", "字符串替换": "Náhrada řetězce",
"转义": "Útěk", "转义": "Útěk",
"游戏已存在,是否重复添加?": "Hra již existuje, chtěli byste ji znovu přidat?", "游戏已存在,是否重复添加?": "Hra již existuje, chtěli byste ji znovu přidat?",
"点击消息后退出并开始更新": "Klikněte na zprávu pro ukončení a spuštění aktualizace" "点击消息后退出并开始更新": "Klikněte na zprávu pro ukončení a spuštění aktualizace",
"增强效果": "Zvýšený efekt"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Zeichenfolgenersatz", "字符串替换": "Zeichenfolgenersatz",
"转义": "Flucht", "转义": "Flucht",
"游戏已存在,是否重复添加?": "Das Spiel existiert bereits, möchtest du es noch einmal hinzufügen?", "游戏已存在,是否重复添加?": "Das Spiel existiert bereits, möchtest du es noch einmal hinzufügen?",
"点击消息后退出并开始更新": "Klicken Sie auf die Nachricht, um zu beenden und mit der Aktualisierung zu beginnen" "点击消息后退出并开始更新": "Klicken Sie auf die Nachricht, um zu beenden und mit der Aktualisierung zu beginnen",
"增强效果": "Verstärkte Wirkung"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "String replacement", "字符串替换": "String replacement",
"转义": "Escaping", "转义": "Escaping",
"游戏已存在,是否重复添加?": "The game already exists, would you like to add it again?", "游戏已存在,是否重复添加?": "The game already exists, would you like to add it again?",
"点击消息后退出并开始更新": "Click on the message to exit and start updating" "点击消息后退出并开始更新": "Click on the message to exit and start updating",
"增强效果": "Enhanced effect"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Reemplazo de cadenas", "字符串替换": "Reemplazo de cadenas",
"转义": "Transliteración", "转义": "Transliteración",
"游戏已存在,是否重复添加?": "¿El juego ya existe, ¿ se repite la adición?", "游戏已存在,是否重复添加?": "¿El juego ya existe, ¿ se repite la adición?",
"点击消息后退出并开始更新": "Haga clic en el mensaje para salir y comenzar la actualización" "点击消息后退出并开始更新": "Haga clic en el mensaje para salir y comenzar la actualización",
"增强效果": "Mejorar el efecto"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Remplacement de chaîne", "字符串替换": "Remplacement de chaîne",
"转义": "échappement", "转义": "échappement",
"游戏已存在,是否重复添加?": "Le jeu existe déjà, y a - t - il des ajouts répétés?", "游戏已存在,是否重复添加?": "Le jeu existe déjà, y a - t - il des ajouts répétés?",
"点击消息后退出并开始更新": "Quitter et commencer la mise à jour après avoir cliqué sur le message" "点击消息后退出并开始更新": "Quitter et commencer la mise à jour après avoir cliqué sur le message",
"增强效果": "Effet amélioré"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Sostituzione stringa", "字符串替换": "Sostituzione stringa",
"转义": "Scappare", "转义": "Scappare",
"游戏已存在,是否重复添加?": "Il gioco esiste già, vuoi aggiungerlo di nuovo?", "游戏已存在,是否重复添加?": "Il gioco esiste già, vuoi aggiungerlo di nuovo?",
"点击消息后退出并开始更新": "Clicca sul messaggio per uscire e iniziare l'aggiornamento" "点击消息后退出并开始更新": "Clicca sul messaggio per uscire e iniziare l'aggiornamento",
"增强效果": "Effetto potenziato"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "文字列置換", "字符串替换": "文字列置換",
"转义": "エスケープ", "转义": "エスケープ",
"游戏已存在,是否重复添加?": "ゲームは既に存在します。追加を繰り返しますか?", "游戏已存在,是否重复添加?": "ゲームは既に存在します。追加を繰り返しますか?",
"点击消息后退出并开始更新": "メッセージをクリックして終了し、更新を開始" "点击消息后退出并开始更新": "メッセージをクリックして終了し、更新を開始",
"增强效果": "きょうかこうか"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "문자열 대체", "字符串替换": "문자열 대체",
"转义": "전의", "转义": "전의",
"游戏已存在,是否重复添加?": "게임이 이미 존재합니다. 다시 추가하시겠습니까?", "游戏已存在,是否重复添加?": "게임이 이미 존재합니다. 다시 추가하시겠습니까?",
"点击消息后退出并开始更新": "메시지 클릭 후 종료 및 업데이트 시작" "点击消息后退出并开始更新": "메시지 클릭 후 종료 및 업데이트 시작",
"增强效果": "향상된 효과"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Vervanging van tekenreeks", "字符串替换": "Vervanging van tekenreeks",
"转义": "Ontsnappen", "转义": "Ontsnappen",
"游戏已存在,是否重复添加?": "Het spel bestaat al, wil je het opnieuw toevoegen?", "游戏已存在,是否重复添加?": "Het spel bestaat al, wil je het opnieuw toevoegen?",
"点击消息后退出并开始更新": "Klik op het bericht om te sluiten en te beginnen met updaten" "点击消息后退出并开始更新": "Klik op het bericht om te sluiten en te beginnen met updaten",
"增强效果": "Verbeterd effect"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Zastąpienie ciągu", "字符串替换": "Zastąpienie ciągu",
"转义": "Ucieczka", "转义": "Ucieczka",
"游戏已存在,是否重复添加?": "Gra już istnieje, chcesz dodać ją ponownie?", "游戏已存在,是否重复添加?": "Gra już istnieje, chcesz dodać ją ponownie?",
"点击消息后退出并开始更新": "Kliknij na wiadomość, aby wyjść i rozpocząć aktualizację" "点击消息后退出并开始更新": "Kliknij na wiadomość, aby wyjść i rozpocząć aktualizację",
"增强效果": "Wzmocniony efekt"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Substituição de strings", "字符串替换": "Substituição de strings",
"转义": "Escapar", "转义": "Escapar",
"游戏已存在,是否重复添加?": "O jogo já existe, você gostaria de adicioná-lo novamente?", "游戏已存在,是否重复添加?": "O jogo já existe, você gostaria de adicioná-lo novamente?",
"点击消息后退出并开始更新": "Clique na mensagem para sair e iniciar a atualização" "点击消息后退出并开始更新": "Clique na mensagem para sair e iniciar a atualização",
"增强效果": "Efeito melhorado"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Замена строки", "字符串替换": "Замена строки",
"转义": "Транслитерация", "转义": "Транслитерация",
"游戏已存在,是否重复添加?": "Игра уже существует, добавляется ли повторно?", "游戏已存在,是否重复添加?": "Игра уже существует, добавляется ли повторно?",
"点击消息后退出并开始更新": "Выйти после нажатия на сообщение и начать обновление" "点击消息后退出并开始更新": "Выйти после нажатия на сообщение и начать обновление",
"增强效果": "Усиление эффекта"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Strängersättning", "字符串替换": "Strängersättning",
"转义": "Flykt", "转义": "Flykt",
"游戏已存在,是否重复添加?": "Spelet finns redan, vill du lägga till det igen?", "游戏已存在,是否重复添加?": "Spelet finns redan, vill du lägga till det igen?",
"点击消息后退出并开始更新": "Klicka på meddelandet för att avsluta och börja uppdatera" "点击消息后退出并开始更新": "Klicka på meddelandet för att avsluta och börja uppdatera",
"增强效果": "Förbättrad effekt"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "การแทนที่สตริง", "字符串替换": "การแทนที่สตริง",
"转义": "แปลความหมาย", "转义": "แปลความหมาย",
"游戏已存在,是否重复添加?": "มีเกมอยู่แล้วคุณต้องการเพิ่มซ้ำหรือไม่?", "游戏已存在,是否重复添加?": "มีเกมอยู่แล้วคุณต้องการเพิ่มซ้ำหรือไม่?",
"点击消息后退出并开始更新": "ออกจากข้อความและเริ่มต้นการปรับปรุง" "点击消息后退出并开始更新": "ออกจากข้อความและเริ่มต้นการปรับปรุง",
"增强效果": "เพิ่มประสิทธิภาพ"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "String Replacement", "字符串替换": "String Replacement",
"转义": "Kaçmak", "转义": "Kaçmak",
"游戏已存在,是否重复添加?": "Oyun zaten var, tekrar eklemek ister misiniz?", "游戏已存在,是否重复添加?": "Oyun zaten var, tekrar eklemek ister misiniz?",
"点击消息后退出并开始更新": ıkmak ve güncellenmeye başlamak için mesajı tıklayın" "点击消息后退出并开始更新": ıkmak ve güncellenmeye başlamak için mesajı tıklayın",
"增强效果": "Yükselmiş etki"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Заміна рядків", "字符串替换": "Заміна рядків",
"转义": "Бег", "转义": "Бег",
"游戏已存在,是否重复添加?": "Гра вже існує, бажаєте додати її знову?", "游戏已存在,是否重复添加?": "Гра вже існує, бажаєте додати її знову?",
"点击消息后退出并开始更新": "Натисніть повідомлення для виходу і запуску оновлення" "点击消息后退出并开始更新": "Натисніть повідомлення для виходу і запуску оновлення",
"增强效果": "Покращений ефект"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "Thay thế chuỗi", "字符串替换": "Thay thế chuỗi",
"转义": "Thoát", "转义": "Thoát",
"游戏已存在,是否重复添加?": "Trò chơi đã tồn tại, có được thêm nhiều lần không?", "游戏已存在,是否重复添加?": "Trò chơi đã tồn tại, có được thêm nhiều lần không?",
"点击消息后退出并开始更新": "Thoát sau khi nhấp vào tin nhắn và bắt đầu cập nhật" "点击消息后退出并开始更新": "Thoát sau khi nhấp vào tin nhắn và bắt đầu cập nhật",
"增强效果": "Hiệu ứng nâng cao"
} }

View File

@ -853,5 +853,6 @@
"字符串替换": "", "字符串替换": "",
"转义": "", "转义": "",
"游戏已存在,是否重复添加?": "", "游戏已存在,是否重复添加?": "",
"点击消息后退出并开始更新": "" "点击消息后退出并开始更新": "",
"增强效果": ""
} }

View File

@ -29,7 +29,7 @@ include(generate_product_version)
set(VERSION_MAJOR 5) set(VERSION_MAJOR 5)
set(VERSION_MINOR 23) set(VERSION_MINOR 23)
set(VERSION_PATCH 7) set(VERSION_PATCH 8)
add_library(pch pch.cpp) add_library(pch pch.cpp)
target_precompile_headers(pch PUBLIC pch.h) target_precompile_headers(pch PUBLIC pch.h)