This commit is contained in:
恍兮惚兮 2024-08-11 17:00:15 +08:00
parent db3a38cf2b
commit e475a2f22d
2 changed files with 22 additions and 31 deletions

View File

@ -17,6 +17,7 @@ from gui.usefulwidget import (
FocusDoubleSpin, FocusDoubleSpin,
LFocusCombo, LFocusCombo,
getsimplecombobox, getsimplecombobox,
getspinbox,
SplitLine, SplitLine,
) )
from gui.dynalang import ( from gui.dynalang import (
@ -558,21 +559,15 @@ class autoinitdialog(LDialog):
_.addWidget(lineW) _.addWidget(lineW)
_.addStretch() _.addStretch()
lineW = _ lineW = _
elif line["type"] == "spin": elif line["type"] in ["spin", "intspin"]:
lineW = FocusDoubleSpin() lineW = getspinbox(
lineW.setMinimum(line.get("min", 0)) line.get("min", 0),
lineW.setMaximum(line.get("max", 100)) line.get("max", 100),
lineW.setSingleStep(line.get("step", 0.1)) dd,
lineW.setValue(dd[key]) key,
lineW.valueChanged.connect(functools.partial(dd.__setitem__, key)) line["type"] == "spin",
line.get("step", 0.1),
elif line["type"] == "intspin": )
lineW = FocusSpin()
lineW.setMinimum(line.get("min", 0))
lineW.setMaximum(line.get("max", 100))
lineW.setSingleStep(line.get("step", 1))
lineW.setValue(dd[key])
lineW.valueChanged.connect(functools.partial(dd.__setitem__, key))
elif line["type"] == "split": elif line["type"] == "split":
lineW = SplitLine() lineW = SplitLine()
formLayout.addRow(lineW) formLayout.addRow(lineW)

View File

@ -115,6 +115,8 @@ def createinternalfontsettings(self, forml: LFormLayout, group, _type):
keyx = "shadowR" keyx = "shadowR"
widthline = __internal["argstype"].get(keyx, None) widthline = __internal["argstype"].get(keyx, None)
if widthline is not None: if widthline is not None:
__ = LLabel("x_字体大小_+")
__.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Preferred)
forml.addRow( forml.addRow(
name, name,
getboxlayout( getboxlayout(
@ -127,7 +129,7 @@ def createinternalfontsettings(self, forml: LFormLayout, group, _type):
True, True,
widthline.get("step", 0.1), widthline.get("step", 0.1),
), ),
LLabel("x_字体大小_+"), __,
getspinbox( getspinbox(
line.get("min", 0), line.get("min", 0),
line.get("max", 100), line.get("max", 100),
@ -157,21 +159,15 @@ def createinternalfontsettings(self, forml: LFormLayout, group, _type):
name="miaobian_color_button", name="miaobian_color_button",
parent=self, parent=self,
) )
elif _type == "spin": elif _type in ["spin", "intspin"]:
lineW = FocusDoubleSpin() lineW = getspinbox(
lineW.setMinimum(line.get("min", 0)) line.get("min", 0),
lineW.setMaximum(line.get("max", 100)) line.get("max", 100),
lineW.setSingleStep(line.get("step", 0.1)) dd,
lineW.setValue(dd[key]) key,
lineW.valueChanged.connect(functools.partial(dd.__setitem__, key)) _type == "spin",
line.get("step", 0.1),
elif _type == "intspin": )
lineW = FocusSpin()
lineW.setMinimum(line.get("min", 0))
lineW.setMaximum(line.get("max", 100))
lineW.setSingleStep(line.get("step", 1))
lineW.setValue(dd[key])
lineW.valueChanged.connect(functools.partial(dd.__setitem__, key))
elif _type == "switch": elif _type == "switch":
lineW = MySwitch(sign=dd[key]) lineW = MySwitch(sign=dd[key])
lineW.clicked.connect(functools.partial(dd.__setitem__, key)) lineW.clicked.connect(functools.partial(dd.__setitem__, key))