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

View File

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

View File

@ -186,10 +186,13 @@ def transferMsTTSData(rate, content, voice):
# Extract binary data
try:
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:]
except:
pass
audio_stream += response
else:
break
ws.close()