mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
focus
This commit is contained in:
parent
f71cce35cd
commit
cb00a8f2b0
@ -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
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user