mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-15 08:53:53 +08:00
.
This commit is contained in:
parent
c0b800111b
commit
08c2649427
@ -35,11 +35,18 @@ class transhist(closeashidewindow):
|
|||||||
)
|
)
|
||||||
textOutput.setUndoRedoEnabled(False)
|
textOutput.setUndoRedoEnabled(False)
|
||||||
textOutput.setReadOnly(True)
|
textOutput.setReadOnly(True)
|
||||||
|
|
||||||
self.textOutput = textOutput
|
self.textOutput = textOutput
|
||||||
|
self.setf()
|
||||||
self.setCentralWidget(self.textOutput)
|
self.setCentralWidget(self.textOutput)
|
||||||
|
def setf(self):
|
||||||
|
key = "histfont"
|
||||||
|
fontstring = globalconfig.get(key, "")
|
||||||
|
if fontstring:
|
||||||
|
_f = QFont()
|
||||||
|
_f.fromString(fontstring)
|
||||||
|
_style = "font-size:{}pt;".format(_f.pointSize())
|
||||||
|
_style += 'font-family:"{}";'.format(_f.family())
|
||||||
|
self.textOutput.setStyleSheet(_style)
|
||||||
def showmenu(self, tb, p):
|
def showmenu(self, tb, p):
|
||||||
menu = QMenu(self)
|
menu = QMenu(self)
|
||||||
qingkong = LAction("清空")
|
qingkong = LAction("清空")
|
||||||
@ -55,12 +62,14 @@ class transhist(closeashidewindow):
|
|||||||
hidetime.setCheckable(True)
|
hidetime.setCheckable(True)
|
||||||
hidetime.setChecked(not self.hidetime)
|
hidetime.setChecked(not self.hidetime)
|
||||||
scrolltoend = LAction("滚动到最后")
|
scrolltoend = LAction("滚动到最后")
|
||||||
|
font = LAction("字体")
|
||||||
if len(self.textOutput.textCursor().selectedText()):
|
if len(self.textOutput.textCursor().selectedText()):
|
||||||
menu.addAction(copy)
|
menu.addAction(copy)
|
||||||
menu.addSeparator()
|
menu.addSeparator()
|
||||||
menu.addAction(qingkong)
|
menu.addAction(qingkong)
|
||||||
menu.addAction(baocun)
|
menu.addAction(baocun)
|
||||||
menu.addAction(scrolltoend)
|
menu.addAction(scrolltoend)
|
||||||
|
menu.addAction(font)
|
||||||
menu.addSeparator()
|
menu.addSeparator()
|
||||||
menu.addAction(hideshowraw)
|
menu.addAction(hideshowraw)
|
||||||
menu.addAction(hideshowapi)
|
menu.addAction(hideshowapi)
|
||||||
@ -80,6 +89,16 @@ class transhist(closeashidewindow):
|
|||||||
elif action == hideshowraw:
|
elif action == hideshowraw:
|
||||||
self.hiderawflag = not self.hiderawflag
|
self.hiderawflag = not self.hiderawflag
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
elif action == font:
|
||||||
|
f = QFont()
|
||||||
|
cur = globalconfig.get("histfont")
|
||||||
|
if cur:
|
||||||
|
f.fromString(cur)
|
||||||
|
font, ok = QFontDialog.getFont(f, self)
|
||||||
|
if ok:
|
||||||
|
_s = font.toString()
|
||||||
|
globalconfig["histfont"] = _s
|
||||||
|
self.setf()
|
||||||
elif action == hidetime:
|
elif action == hidetime:
|
||||||
self.hidetime = not self.hidetime
|
self.hidetime = not self.hidetime
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 8ec34b620b26ba79e33e7004f2b9183c3b8077a4
|
Subproject commit fcd8313f123f0d9c26e91bf7dc97771ef15ea063
|
@ -5,21 +5,9 @@
|
|||||||
"file": "PyQtDarkTheme/dark.py",
|
"file": "PyQtDarkTheme/dark.py",
|
||||||
"name": "PyQtDarkTheme"
|
"name": "PyQtDarkTheme"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"file": "QDarkStyleSheet/dark.py",
|
|
||||||
"name": "QDarkStyleSheet"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"file": "QTWin11/dark.py",
|
"file": "QTWin11/dark.py",
|
||||||
"name": "QTWin11"
|
"name": "QTWin11"
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "QtVSCodeStyle/dark.py",
|
|
||||||
"name": "QtVSCodeStyle Dark"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "qt_material/dark.py",
|
|
||||||
"name": "qt-material"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"light": [
|
"light": [
|
||||||
@ -27,21 +15,9 @@
|
|||||||
"file": "PyQtDarkTheme/light.py",
|
"file": "PyQtDarkTheme/light.py",
|
||||||
"name": "PyQtDarkTheme"
|
"name": "PyQtDarkTheme"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"file": "QDarkStyleSheet/light.py",
|
|
||||||
"name": "QDarkStyleSheet"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"file": "QTWin11/light.py",
|
"file": "QTWin11/light.py",
|
||||||
"name": "QTWin11"
|
"name": "QTWin11"
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "QtVSCodeStyle/light.py",
|
|
||||||
"name": "QtVSCodeStyle Light"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"file": "qt_material/light.py",
|
|
||||||
"name": "qt-material"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user