This commit is contained in:
恍兮惚兮 2024-05-25 00:42:49 +08:00
parent f9a0bc6b6c
commit 82bf1feaa6
3 changed files with 10 additions and 7 deletions

View File

@ -506,11 +506,11 @@ class Textbrowser(QLabel):
tl1.x() + 1, tl1.x() + 1,
tl1.y(), tl1.y(),
tailx - tl1.x() - 2, tailx - tl1.x() - 2,
heigth, int(heigth),
) )
xx = int(guesswidth1 - (tailx - tl1.x())) xx = int(guesswidth1 - (tailx - tl1.x()))
guesslinehead = None guesslinehead = None
pos2 = tl3.x() + 1 - xx, tl3.y(), xx - 2, heigth pos2 = tl3.x() + 1 - xx, tl3.y(), xx - 2, int(heigth)
if ( if (
globalconfig["usesearchword"] globalconfig["usesearchword"]
or globalconfig["usecopyword"] or globalconfig["usecopyword"]
@ -559,7 +559,7 @@ class Textbrowser(QLabel):
tl1.x() + 1, tl1.x() + 1,
tl1.y(), tl1.y(),
tl2.x() - tl1.x() - 2, tl2.x() - tl1.x() - 2,
heigth, int(heigth),
) )
if ( if (
globalconfig["usesearchword"] globalconfig["usesearchword"]

View File

@ -954,7 +954,7 @@ class QUnFrameWindow(resizableframeless):
wh = globalconfig["buttonsize"] * 1.5 wh = globalconfig["buttonsize"] * 1.5
height = self.height() - wh height = self.height() - wh
self.translate_text.resize(self.width(), height) self.translate_text.resize(self.width(), int(height))
self.adjustbuttons() self.adjustbuttons()
self._TitleLabel.setFixedWidth(self.width()) self._TitleLabel.setFixedWidth(self.width())
@ -1000,7 +1000,7 @@ class QUnFrameWindow(resizableframeless):
sumwidth += button.width() sumwidth += button.width()
leftstart = leftmax + (rightmax - leftmax - sumwidth) / 2 leftstart = leftmax + (rightmax - leftmax - sumwidth) / 2
for button in center: for button in center:
button.move(leftstart, 0) button.move(int(leftstart), 0)
leftstart += button.width() leftstart += button.width()
def callwrap(self, call, _): def callwrap(self, call, _):

View File

@ -186,10 +186,13 @@ def transferMsTTSData(rate, content, voice):
# Extract binary data # Extract binary data
try: try:
needle = b"Path:audio\r\n" needle = b"Path:audio\r\n"
start_ind = response.find(needle) + len(needle) idx = response.find(needle)
if idx == -1:
raise
start_ind = idx + len(needle)
audio_stream += response[start_ind:] audio_stream += response[start_ind:]
except: except:
pass audio_stream += response
else: else:
break break
ws.close() ws.close()