This commit is contained in:
恍兮惚兮 2024-06-08 16:43:01 +08:00
parent 5db4b4185d
commit a14ca9ca30
3 changed files with 8 additions and 18 deletions

View File

@ -48,7 +48,7 @@ class dialog_selecticon(QDialog):
self.close() self.close()
def doadjust(): def doadjust(_):
gobject.baseobject.translation_ui.enterfunction(delay=3) gobject.baseobject.translation_ui.enterfunction(delay=3)
gobject.baseobject.translation_ui.adjustbuttons() gobject.baseobject.translation_ui.adjustbuttons()
@ -77,7 +77,7 @@ def changerank(item, up, sortlist, savelist, savelay):
savelist[idx2 + headoffset], savelist[idx2 + headoffset],
savelist[idx + headoffset], savelist[idx + headoffset],
) )
doadjust() doadjust(None)
def createbuttonwidget(self, lay): def createbuttonwidget(self, lay):
@ -112,7 +112,7 @@ def createbuttonwidget(self, lay):
D_getsimpleswitch( D_getsimpleswitch(
globalconfig["toolbutton"]["buttons"][k], globalconfig["toolbutton"]["buttons"][k],
"use", "use",
callback=lambda _: doadjust(), callback=doadjust,
), ),
button_up, button_up,
button_down, button_down,
@ -120,7 +120,7 @@ def createbuttonwidget(self, lay):
_TRL(["居左", "居右", "居中"]), _TRL(["居左", "居右", "居中"]),
globalconfig["toolbutton"]["buttons"][k], globalconfig["toolbutton"]["buttons"][k],
"align", "align",
callback=lambda _: doadjust(), callback=doadjust,
fixedsize=True, fixedsize=True,
), ),
D_getcolorbutton( D_getcolorbutton(

View File

@ -202,7 +202,7 @@ def createbtnthemedark(self):
return self.btnthemedark return self.btnthemedark
def checkthemesettingvisandapply(self, _dark): def checkthemesettingvisandapply(self, _dark, _):
checkthemesettingvisandapply_1(self, _dark) checkthemesettingvisandapply_1(self, _dark)
maybesetstyle(_dark) maybesetstyle(_dark)
@ -319,7 +319,7 @@ def uisetting(self):
_TRL(["明亮", "黑暗", "跟随系统"]), _TRL(["明亮", "黑暗", "跟随系统"]),
globalconfig, globalconfig,
"darklight", "darklight",
gobject.baseobject.setcommonstylesheet, lambda _: gobject.baseobject.setcommonstylesheet(),
), ),
5, 5,
), ),

View File

@ -369,12 +369,7 @@ def callbackwrap(d, k, call, _):
d[k] = _ d[k] = _
if call: if call:
try: try:
sig = inspect.signature(call) call(_)
np = len(sig.parameters)
if np >= 1:
call(_)
elif np == 0:
call()
except: except:
print_exc() print_exc()
@ -383,12 +378,7 @@ def comboboxcallbackwrap(internallist, d, k, call, _):
d[k] = internallist[_] d[k] = internallist[_]
if call: if call:
try: try:
sig = inspect.signature(call) call(_)
np = len(sig.parameters)
if np >= 1:
call(_)
elif np == 0:
call()
except: except:
print_exc() print_exc()