This commit is contained in:
恍兮惚兮 2024-07-30 14:54:34 +08:00
parent e92d79e5b6
commit 23474a9348
2 changed files with 23 additions and 24 deletions

View File

@ -272,19 +272,22 @@ def setTab_update(self, basel):
grid2 = [
[
"自动更新",
(
D_getsimpleswitch(
globalconfig, "autoupdate", callback=versionchecktask.put
),
0,
),
],
[
"当前版本",
versionstring,
],
[
"",
"最新版本",
functools.partial(createversionlabel, self),
"",
],
[functools.partial(createdownloadprogress, self)],
[(functools.partial(createdownloadprogress, self), 0)],
]
shuominggrid = [
@ -329,8 +332,8 @@ def setTab_update(self, basel):
[
(
dict(
Stretch=False,
grid=grid2,
type="grid",
),
0,
"group",

View File

@ -1382,8 +1382,7 @@ def tabadd_lazy(tab, title, getrealwidgetfunction):
tab.addTab(q, title)
def makeforms(lay: LFormLayout, lis, args):
Stretch = args.get("Stretch", True)
def makeforms(lay: LFormLayout, lis):
for line in lis:
if len(line) == 0:
lay.addRow(QLabel())
@ -1395,7 +1394,7 @@ def makeforms(lay: LFormLayout, lis, args):
if isinstance(wid, (tuple, list)):
hb = QHBoxLayout()
hb.setContentsMargins(0, 0, 0, 0)
if Stretch:
needstretch = False
for w in wid:
if callable(w):
@ -1413,10 +1412,7 @@ def makeforms(lay: LFormLayout, lis, args):
elif isinstance(wid, str):
wid = QLabel(wid)
wid.setOpenExternalLinks(True)
if (
Stretch
and wid.sizePolicy().horizontalPolicy() == QSizePolicy.Policy.Fixed
):
if wid.sizePolicy().horizontalPolicy() == QSizePolicy.Policy.Fixed:
hb = QHBoxLayout()
hb.setContentsMargins(0, 0, 0, 0)
hb.addStretch()
@ -1460,7 +1456,7 @@ def makegroupingrid(args):
elif _type == "form":
lay = LFormLayout()
group.setLayout(lay)
makeforms(lay, lis, args)
makeforms(lay, lis)
if internallayoutname:
setattr(parent, internallayoutname, lay)
return group