mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
3dd1cb295b
commit
7010cdac42
@ -120,13 +120,26 @@ class saveposwindow(QMainWindow):
|
||||
super().__init__(parent, flags=flags)
|
||||
else:
|
||||
super().__init__(parent)
|
||||
d = QApplication.primaryScreen()
|
||||
|
||||
self.poslist = poslist
|
||||
if self.poslist:
|
||||
poslist[2] = max(0, min(poslist[2], d.size().width()))
|
||||
poslist[3] = max(0, min(poslist[3], d.size().height()))
|
||||
poslist[0] = min(max(poslist[0], 0), d.size().width() - poslist[2])
|
||||
poslist[1] = min(max(poslist[1], 0), d.size().height() - poslist[3])
|
||||
contains = False
|
||||
usescreen = QApplication.primaryScreen()
|
||||
for screen in QApplication.screens():
|
||||
if not screen.geometry().contains(QPoint(poslist[0], poslist[1])):
|
||||
continue
|
||||
contains = True
|
||||
usescreen = screen
|
||||
break
|
||||
poslist[2] = max(0, min(poslist[2], usescreen.size().width()))
|
||||
poslist[3] = max(0, min(poslist[3], usescreen.size().height()))
|
||||
if not contains:
|
||||
poslist[0] = min(
|
||||
max(poslist[0], 0), usescreen.size().width() - poslist[2]
|
||||
)
|
||||
poslist[1] = min(
|
||||
max(poslist[1], 0), usescreen.size().height() - poslist[3]
|
||||
)
|
||||
self.setGeometry(*poslist)
|
||||
|
||||
def __checked_savepos(self):
|
||||
|
@ -201,13 +201,13 @@
|
||||
ele.style.textAlign = "center"
|
||||
let tags = _splittags(tag)
|
||||
tags.forEach(tag => {
|
||||
let ruby = document.createElement('ruby')
|
||||
let mayberuby = []
|
||||
tag.forEach(word => {
|
||||
let eleori = regist_style_imp[style](styleargs, word.orig, { atcenter: true, fontFamily: fmori, fontSize: fsori, bold: boldori, color: color, lineHeight: line_height })
|
||||
|
||||
|
||||
if (isshow_fenci || isfenciclick) {
|
||||
let div = document.createElement('div')
|
||||
div.style.display='inline-block'
|
||||
div.id = _simpleuid()
|
||||
let style = document.createElement('style')
|
||||
if (isshow_fenci)
|
||||
@ -228,9 +228,9 @@
|
||||
div.appendChild(style)
|
||||
div.appendChild(eleori)
|
||||
|
||||
ruby.appendChild(div)
|
||||
mayberuby.push(div)
|
||||
} else
|
||||
ruby.appendChild(eleori)
|
||||
mayberuby.push(div)
|
||||
if (isshowhira) {
|
||||
let rt = document.createElement('rt')
|
||||
|
||||
@ -238,10 +238,22 @@
|
||||
rt.appendChild(regist_style_imp[style](styleargs, word.hira, { atcenter: true, fontFamily: fmkana, fontSize: fskana, bold: boldkana, color: kanacolor, lineHeight: 0 }))
|
||||
|
||||
}
|
||||
ruby.appendChild(rt)
|
||||
mayberuby.push(rt)
|
||||
}
|
||||
})
|
||||
ele.appendChild(ruby)
|
||||
if (isshowhira) {
|
||||
|
||||
let ruby = document.createElement('ruby')
|
||||
mayberuby.forEach(e => {
|
||||
ruby.appendChild(e)
|
||||
});
|
||||
ele.appendChild(ruby)
|
||||
}
|
||||
else {
|
||||
mayberuby.forEach(e => {
|
||||
ele.appendChild(e)
|
||||
});
|
||||
}
|
||||
ele.appendChild(document.createElement('br'))
|
||||
})
|
||||
safe_calllunaheightchange(document.getElementById(rootdivid).offsetHeight)
|
||||
|
Loading…
x
Reference in New Issue
Block a user