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_getcolorbutton,
D_getsimpleswitch, D_getsimpleswitch,
selectcolor, selectcolor,
FocusFontCombo
) )
@ -38,7 +39,7 @@ def __changeuibuttonstate(self, x):
def createtextfontcom(key): def createtextfontcom(key):
font_comboBox = QFontComboBox() font_comboBox = FocusFontCombo()
font_comboBox.currentTextChanged.connect(lambda x: globalconfig.__setitem__(key, x)) font_comboBox.currentTextChanged.connect(lambda x: globalconfig.__setitem__(key, x))
font_comboBox.setCurrentFont(QFont(globalconfig[key])) font_comboBox.setCurrentFont(QFont(globalconfig[key]))
return font_comboBox return font_comboBox

View File

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

View File

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

View File

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