mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
.
This commit is contained in:
parent
e92d79e5b6
commit
23474a9348
@ -272,19 +272,22 @@ def setTab_update(self, basel):
|
||||
grid2 = [
|
||||
[
|
||||
"自动更新",
|
||||
D_getsimpleswitch(
|
||||
globalconfig, "autoupdate", callback=versionchecktask.put
|
||||
(
|
||||
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",
|
||||
|
@ -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,17 +1394,17 @@ 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):
|
||||
w = w()
|
||||
if w.sizePolicy().horizontalPolicy() == QSizePolicy.Policy.Fixed:
|
||||
needstretch = True
|
||||
hb.addWidget(w)
|
||||
if needstretch:
|
||||
hb.insertStretch(0)
|
||||
hb.addStretch()
|
||||
|
||||
needstretch = False
|
||||
for w in wid:
|
||||
if callable(w):
|
||||
w = w()
|
||||
if w.sizePolicy().horizontalPolicy() == QSizePolicy.Policy.Fixed:
|
||||
needstretch = True
|
||||
hb.addWidget(w)
|
||||
if needstretch:
|
||||
hb.insertStretch(0)
|
||||
hb.addStretch()
|
||||
wid = hb
|
||||
else:
|
||||
if callable(wid):
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user