mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
issues/819
This commit is contained in:
parent
03b452b419
commit
2fc2fb7698
@ -114,7 +114,7 @@ class rangeadjust(Mainw):
|
|||||||
|
|
||||||
|
|
||||||
class rangeselct(QMainWindow):
|
class rangeselct(QMainWindow):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent=None):
|
||||||
|
|
||||||
super(rangeselct, self).__init__(parent)
|
super(rangeselct, self).__init__(parent)
|
||||||
self.setWindowFlags(
|
self.setWindowFlags(
|
||||||
@ -225,10 +225,11 @@ class rangeselct(QMainWindow):
|
|||||||
screen_shot_ui = None
|
screen_shot_ui = None
|
||||||
|
|
||||||
|
|
||||||
def rangeselct_function(parent, callback, clickrelease, startauto):
|
def rangeselct_function(callback, clickrelease, startauto):
|
||||||
global screen_shot_ui
|
global screen_shot_ui
|
||||||
if screen_shot_ui is None:
|
if screen_shot_ui is None:
|
||||||
screen_shot_ui = rangeselct(parent)
|
screen_shot_ui = rangeselct()
|
||||||
|
# 可能是由于使用win32移动窗口,导致父翻译show/hide影响到他
|
||||||
screen_shot_ui.show()
|
screen_shot_ui.show()
|
||||||
screen_shot_ui.reset()
|
screen_shot_ui.reset()
|
||||||
screen_shot_ui.callback = callback
|
screen_shot_ui.callback = callback
|
||||||
|
@ -135,7 +135,7 @@ class AnkiWindow(QWidget):
|
|||||||
if globalconfig["ankiconnect"]["ocrcroped"]:
|
if globalconfig["ankiconnect"]["ocrcroped"]:
|
||||||
self.asyncocr(img)
|
self.asyncocr(img)
|
||||||
|
|
||||||
rangeselct_function(self, ocroncefunction, False, False)
|
rangeselct_function(ocroncefunction, False, False)
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
@ -348,7 +348,7 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
text = ocr_run(img)
|
text = ocr_run(img)
|
||||||
gobject.baseobject.textgetmethod(text, False)
|
gobject.baseobject.textgetmethod(text, False)
|
||||||
|
|
||||||
rangeselct_function(self, ocroncefunction, False, False)
|
rangeselct_function(ocroncefunction, False, False)
|
||||||
|
|
||||||
@threader
|
@threader
|
||||||
def simulate_key_enter(self):
|
def simulate_key_enter(self):
|
||||||
@ -900,7 +900,7 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
return
|
return
|
||||||
self.showhidestate = False
|
self.showhidestate = False
|
||||||
|
|
||||||
rangeselct_function(self, self.afterrange, auto, auto)
|
rangeselct_function(self.afterrange, auto, auto)
|
||||||
|
|
||||||
def afterrange(self, rect):
|
def afterrange(self, rect):
|
||||||
gobject.baseobject.textsource.newrangeadjustor()
|
gobject.baseobject.textsource.newrangeadjustor()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user