This commit is contained in:
恍兮惚兮 2024-08-02 22:55:30 +08:00
parent 7657b13c5f
commit c99880272a
3 changed files with 20 additions and 6 deletions

View File

@ -17,6 +17,7 @@ from gui.usefulwidget import (
FocusDoubleSpin, FocusDoubleSpin,
LFocusCombo, LFocusCombo,
getsimplecombobox, getsimplecombobox,
SplitLine,
) )
from gui.dynalang import ( from gui.dynalang import (
LFormLayout, LFormLayout,
@ -335,6 +336,7 @@ class noundictconfigdialog2(LDialog):
self.button.setFocus() self.button.setFocus()
self.apply() self.apply()
def autoinitdialog_items(dic): def autoinitdialog_items(dic):
items = [] items = []
for arg in dic["args"]: for arg in dic["args"]:
@ -505,9 +507,7 @@ class autoinitdialog(LDialog):
lineW.setValue(dd[key]) lineW.setValue(dd[key])
lineW.valueChanged.connect(functools.partial(dd.__setitem__, key)) lineW.valueChanged.connect(functools.partial(dd.__setitem__, key))
elif line["type"] == "split": elif line["type"] == "split":
lineW = QLabel() lineW = SplitLine()
lineW.setStyleSheet("background-color: gray;")
lineW.setFixedHeight(2)
formLayout.addRow(lineW) formLayout.addRow(lineW)
continue continue
refswitch = line.get("refswitch", None) refswitch = line.get("refswitch", None)

View File

@ -25,6 +25,7 @@ from gui.usefulwidget import (
LFocusCombo, LFocusCombo,
FocusDoubleSpin, FocusDoubleSpin,
FocusSpin, FocusSpin,
SplitLine,
) )
from gui.dynalang import LPushButton, LFormLayout from gui.dynalang import LPushButton, LFormLayout
@ -247,18 +248,24 @@ def resetgroudswitchcallback(self, group):
goodfontgroupswitch = LFocusCombo() goodfontgroupswitch = LFocusCombo()
self.seletengeinecombo.lastindex = self.seletengeinecombo.currentIndex() self.seletengeinecombo.lastindex = self.seletengeinecombo.currentIndex()
if group == "webview" or group == "QWebEngine": if group == "webview" or group == "QWebEngine":
_btn = LPushButton("额外的html") _btn = LPushButton("编辑")
_btn.clicked.connect(lambda: extrahtml(self)) _btn.clicked.connect(lambda: extrahtml(self))
switch = getsimpleswitch( switch = getsimpleswitch(
globalconfig, globalconfig,
"useextrahtml", "useextrahtml",
callback=lambda x: [ callback=lambda x: [
gobject.baseobject.translation_ui.translate_text.textbrowser.loadextra(0), gobject.baseobject.translation_ui.translate_text.textbrowser.loadextra(
0
),
_btn.setEnabled(x), _btn.setEnabled(x),
], ],
) )
_btn.setEnabled(globalconfig["useextrahtml"]) _btn.setEnabled(globalconfig["useextrahtml"])
self.goodfontsettingsformlayout.addRow(getboxlayout([_btn, switch])) self.goodfontsettingsformlayout.addRow(
"额外的html",
getboxlayout([switch, _btn]),
)
self.goodfontsettingsformlayout.addRow(SplitLine())
if group == "QWebEngine": if group == "QWebEngine":
group = "webview" group = "webview"
__form = LFormLayout() __form = LFormLayout()

View File

@ -2015,3 +2015,10 @@ class LIconLabel(LLabel):
QIcon.Mode.Normal, QIcon.Mode.Normal,
QIcon.State.On, QIcon.State.On,
) )
class SplitLine(QFrame):
def __init__(self, *argc):
super().__init__(*argc)
self.setStyleSheet("background-color: gray;")
self.setFixedHeight(2)