--- a/src/eric7/Preferences/ConfigurationPages/EditorCalltipsPage.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Preferences/ConfigurationPages/EditorCalltipsPage.py Wed Jul 13 14:55:47 2022 +0200 @@ -19,6 +19,7 @@ """ Class implementing the Editor Calltips configuration page. """ + def __init__(self): """ Constructor @@ -26,63 +27,67 @@ super().__init__() self.setupUi(self) self.setObjectName("EditorCalltipsPage") - + self.positionComboBox.addItem( - self.tr("Below Text"), - QsciScintilla.CallTipsPosition.CallTipsBelowText) + self.tr("Below Text"), QsciScintilla.CallTipsPosition.CallTipsBelowText + ) self.positionComboBox.addItem( - self.tr("Above Text"), - QsciScintilla.CallTipsPosition.CallTipsAboveText) - + self.tr("Above Text"), QsciScintilla.CallTipsPosition.CallTipsAboveText + ) + # set initial values - self.ctEnabledCheckBox.setChecked( - Preferences.getEditor("CallTipsEnabled")) - - self.ctVisibleSlider.setValue( - Preferences.getEditor("CallTipsVisible")) - - self.initColour("CallTipsBackground", self.calltipsBackgroundButton, - Preferences.getEditorColour) - self.initColour("CallTipsForeground", self.calltipsForegroundButton, - Preferences.getEditorColour) - self.initColour("CallTipsHighlight", self.calltipsHighlightButton, - Preferences.getEditorColour) - + self.ctEnabledCheckBox.setChecked(Preferences.getEditor("CallTipsEnabled")) + + self.ctVisibleSlider.setValue(Preferences.getEditor("CallTipsVisible")) + + self.initColour( + "CallTipsBackground", + self.calltipsBackgroundButton, + Preferences.getEditorColour, + ) + self.initColour( + "CallTipsForeground", + self.calltipsForegroundButton, + Preferences.getEditorColour, + ) + self.initColour( + "CallTipsHighlight", + self.calltipsHighlightButton, + Preferences.getEditorColour, + ) + self.ctScintillaCheckBox.setChecked( - Preferences.getEditor("CallTipsScintillaOnFail")) - + Preferences.getEditor("CallTipsScintillaOnFail") + ) + self.positionComboBox.setCurrentIndex( - self.positionComboBox.findData( - Preferences.getEditor("CallTipsPosition"))) - + self.positionComboBox.findData(Preferences.getEditor("CallTipsPosition")) + ) + def save(self): """ Public slot to save the EditorCalltips configuration. """ - Preferences.setEditor( - "CallTipsEnabled", - self.ctEnabledCheckBox.isChecked()) - + Preferences.setEditor("CallTipsEnabled", self.ctEnabledCheckBox.isChecked()) + + Preferences.setEditor("CallTipsVisible", self.ctVisibleSlider.value()) + + self.saveColours(Preferences.setEditorColour) + Preferences.setEditor( - "CallTipsVisible", - self.ctVisibleSlider.value()) - - self.saveColours(Preferences.setEditorColour) - - Preferences.setEditor( - "CallTipsScintillaOnFail", - self.ctScintillaCheckBox.isChecked()) - + "CallTipsScintillaOnFail", self.ctScintillaCheckBox.isChecked() + ) + Preferences.setEditor( "CallTipsPosition", - self.positionComboBox.itemData( - self.positionComboBox.currentIndex())) + self.positionComboBox.itemData(self.positionComboBox.currentIndex()), + ) def create(dlg): """ Module function to create the configuration page. - + @param dlg reference to the configuration dialog @return reference to the instantiated page (ConfigurationPageBase) """