mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04: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
|
||||
import os
|
||||
from myutils.hwnd import showintab, getScreenRate
|
||||
from myutils.hwnd import showintab
|
||||
from PyQt5.QtGui import QStandardItem, QStandardItemModel
|
||||
from PyQt5.QtCore import Qt, QSize
|
||||
from myutils.config import savehook_new_list, savehook_new_data
|
||||
@ -363,7 +363,7 @@ class browserdialog(QDialog):
|
||||
if self._resizable == False:
|
||||
return
|
||||
self.nettab.resize(a0.size().width(), self.nettab.height())
|
||||
rate = getScreenRate()
|
||||
rate = QApplication.instance().devicePixelRatio()
|
||||
rect = (
|
||||
0,
|
||||
int(rate * self.nettab.height()),
|
||||
|
@ -103,7 +103,7 @@ def getscreenp(): # 一些游戏全屏时会修改分辨率,但不会修改
|
||||
|
||||
def hwndscalerate(hwnd):
|
||||
dpi = windows.GetDpiForWindow(hwnd)
|
||||
rate = getScreenRate() * 96 / dpi
|
||||
rate = QApplication.instance().devicePixelRatio() * 96 / dpi
|
||||
return rate
|
||||
|
||||
|
||||
@ -243,19 +243,6 @@ def getExeIcon(name, icon=True, cache=False):
|
||||
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):
|
||||
pid = " ".join([str(_) for _ in injectpids])
|
||||
if any(map(testprivilege, injectpids)) == False:
|
||||
|
@ -8,7 +8,9 @@ import ctypes
|
||||
import time
|
||||
import ctypes.wintypes
|
||||
import time
|
||||
from myutils.hwnd import getScreenRate
|
||||
from PyQt5.QtWidgets import (
|
||||
QApplication,
|
||||
)
|
||||
from traceback import print_exc
|
||||
from myutils.config import (
|
||||
globalconfig,
|
||||
@ -17,7 +19,7 @@ from myutils.config import (
|
||||
savehook_new_data,
|
||||
getdefaultsavehook,
|
||||
)
|
||||
import threading, queue
|
||||
import threading
|
||||
import re, heapq
|
||||
from myutils.vndb import searchforidimage
|
||||
|
||||
@ -410,7 +412,7 @@ def minmaxmoveobservefunc(self):
|
||||
elif event == windows.EVENT_SYSTEM_MOVESIZEEND: #
|
||||
if globalconfig["movefollow"]:
|
||||
if self.lastpos:
|
||||
rate = getScreenRate()
|
||||
rate = QApplication.instance().devicePixelRatio()
|
||||
self.hookfollowsignal.emit(
|
||||
5,
|
||||
(
|
||||
|
Loading…
x
Reference in New Issue
Block a user