mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
6195945858
commit
beb189b590
@ -44,7 +44,7 @@ from gui.usefulwidget import (
|
|||||||
)
|
)
|
||||||
from PyQt5.QtCore import QPoint, QRect, QSize, Qt, pyqtSignal
|
from PyQt5.QtCore import QPoint, QRect, QSize, Qt, pyqtSignal
|
||||||
import os
|
import os
|
||||||
from myutils.hwnd import showintab, getScreenRate
|
from myutils.hwnd import showintab
|
||||||
from PyQt5.QtGui import QStandardItem, QStandardItemModel
|
from PyQt5.QtGui import QStandardItem, QStandardItemModel
|
||||||
from PyQt5.QtCore import Qt, QSize
|
from PyQt5.QtCore import Qt, QSize
|
||||||
from myutils.config import savehook_new_list, savehook_new_data
|
from myutils.config import savehook_new_list, savehook_new_data
|
||||||
@ -363,7 +363,7 @@ class browserdialog(QDialog):
|
|||||||
if self._resizable == False:
|
if self._resizable == False:
|
||||||
return
|
return
|
||||||
self.nettab.resize(a0.size().width(), self.nettab.height())
|
self.nettab.resize(a0.size().width(), self.nettab.height())
|
||||||
rate = getScreenRate()
|
rate = QApplication.instance().devicePixelRatio()
|
||||||
rect = (
|
rect = (
|
||||||
0,
|
0,
|
||||||
int(rate * self.nettab.height()),
|
int(rate * self.nettab.height()),
|
||||||
|
@ -103,7 +103,7 @@ def getscreenp(): # 一些游戏全屏时会修改分辨率,但不会修改
|
|||||||
|
|
||||||
def hwndscalerate(hwnd):
|
def hwndscalerate(hwnd):
|
||||||
dpi = windows.GetDpiForWindow(hwnd)
|
dpi = windows.GetDpiForWindow(hwnd)
|
||||||
rate = getScreenRate() * 96 / dpi
|
rate = QApplication.instance().devicePixelRatio() * 96 / dpi
|
||||||
return rate
|
return rate
|
||||||
|
|
||||||
|
|
||||||
@ -243,19 +243,6 @@ def getExeIcon(name, icon=True, cache=False):
|
|||||||
return pixmap
|
return pixmap
|
||||||
|
|
||||||
|
|
||||||
__rate = 0
|
|
||||||
|
|
||||||
|
|
||||||
def getScreenRate():
|
|
||||||
global __rate
|
|
||||||
if __rate == 0:
|
|
||||||
hDC = windows.GetDC(0)
|
|
||||||
dpiX = windows.GetDeviceCaps(hDC, windows.LOGPIXELSX) / 96.0
|
|
||||||
windows.ReleaseDC(None, hDC)
|
|
||||||
__rate = round(dpiX, 2)
|
|
||||||
return __rate
|
|
||||||
|
|
||||||
|
|
||||||
def injectdll(injectpids, injecter, dll):
|
def injectdll(injectpids, injecter, dll):
|
||||||
pid = " ".join([str(_) for _ in injectpids])
|
pid = " ".join([str(_) for _ in injectpids])
|
||||||
if any(map(testprivilege, injectpids)) == False:
|
if any(map(testprivilege, injectpids)) == False:
|
||||||
|
@ -8,7 +8,9 @@ import ctypes
|
|||||||
import time
|
import time
|
||||||
import ctypes.wintypes
|
import ctypes.wintypes
|
||||||
import time
|
import time
|
||||||
from myutils.hwnd import getScreenRate
|
from PyQt5.QtWidgets import (
|
||||||
|
QApplication,
|
||||||
|
)
|
||||||
from traceback import print_exc
|
from traceback import print_exc
|
||||||
from myutils.config import (
|
from myutils.config import (
|
||||||
globalconfig,
|
globalconfig,
|
||||||
@ -17,7 +19,7 @@ from myutils.config import (
|
|||||||
savehook_new_data,
|
savehook_new_data,
|
||||||
getdefaultsavehook,
|
getdefaultsavehook,
|
||||||
)
|
)
|
||||||
import threading, queue
|
import threading
|
||||||
import re, heapq
|
import re, heapq
|
||||||
from myutils.vndb import searchforidimage
|
from myutils.vndb import searchforidimage
|
||||||
|
|
||||||
@ -410,7 +412,7 @@ def minmaxmoveobservefunc(self):
|
|||||||
elif event == windows.EVENT_SYSTEM_MOVESIZEEND: #
|
elif event == windows.EVENT_SYSTEM_MOVESIZEEND: #
|
||||||
if globalconfig["movefollow"]:
|
if globalconfig["movefollow"]:
|
||||||
if self.lastpos:
|
if self.lastpos:
|
||||||
rate = getScreenRate()
|
rate = QApplication.instance().devicePixelRatio()
|
||||||
self.hookfollowsignal.emit(
|
self.hookfollowsignal.emit(
|
||||||
5,
|
5,
|
||||||
(
|
(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user