This commit is contained in:
恍兮惚兮 2024-06-18 13:59:28 +08:00
parent f71cce35cd
commit cb00a8f2b0
4 changed files with 10 additions and 4 deletions

View File

@ -11,6 +11,7 @@ from gui.usefulwidget import (
D_getcolorbutton,
D_getsimpleswitch,
selectcolor,
FocusFontCombo
)
@ -38,7 +39,7 @@ def __changeuibuttonstate(self, x):
def createtextfontcom(key):
font_comboBox = QFontComboBox()
font_comboBox = FocusFontCombo()
font_comboBox.currentTextChanged.connect(lambda x: globalconfig.__setitem__(key, x))
font_comboBox.setCurrentFont(QFont(globalconfig[key]))
return font_comboBox

View File

@ -10,6 +10,7 @@ from gui.usefulwidget import (
D_getcolorbutton,
getcolorbutton,
selectcolor,
FocusFontCombo
)
@ -82,7 +83,7 @@ def createhorizontal_slider_tool_label(self):
def createfontcombo():
sfont_comboBox = QFontComboBox()
sfont_comboBox = FocusFontCombo()
def callback(x):
globalconfig.__setitem__("settingfonttype", x)

View File

@ -25,7 +25,8 @@ from gui.usefulwidget import (
D_getsimpleswitch,
makesubtab_lazy,
makescrollgrid,
FocusCombo
FocusCombo,
FocusFontCombo
)
@ -269,7 +270,7 @@ def exportchspatch(self):
def creategamefont_comboBox():
gamefont_comboBox = QFontComboBox()
gamefont_comboBox = FocusFontCombo()
def callback(x):
globalconfig["embedded"].__setitem__("changefont_font", x)

View File

@ -27,6 +27,9 @@ class FocusCombo(QComboBox):
return super().wheelEvent(e)
class FocusFontCombo(QFontComboBox, FocusCombo):
pass
class FocusSpin(QSpinBox):
def __init__(self, parent: QWidget = None) -> None:
super().__init__(parent)