src/eric7/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py

branch
eric7
changeset 10428
a071d4065202
parent 10373
093dcebe5ecb
child 10439
21c28b0f9e41
equal deleted inserted replaced
10427:3733e2b23cf7 10428:a071d4065202
49 def __init__(self, lexers): 49 def __init__(self, lexers):
50 """ 50 """
51 Constructor 51 Constructor
52 52
53 @param lexers reference to the lexers dictionary 53 @param lexers reference to the lexers dictionary
54 @type dict
54 """ 55 """
55 super().__init__() 56 super().__init__()
56 self.setupUi(self) 57 self.setupUi(self)
57 self.setObjectName("EditorHighlightingStylesPage") 58 self.setObjectName("EditorHighlightingStylesPage")
58 59
333 def __changeFont(self, doAll, familyOnly, sizeOnly): 334 def __changeFont(self, doAll, familyOnly, sizeOnly):
334 """ 335 """
335 Private slot to change the highlighter font. 336 Private slot to change the highlighter font.
336 337
337 @param doAll flag indicating to change the font for all styles 338 @param doAll flag indicating to change the font for all styles
338 (boolean) 339 @type bool
339 @param familyOnly flag indicating to set the font family only (boolean) 340 @param familyOnly flag indicating to set the font family only
340 @param sizeOnly flag indicating to set the font size only (boolean 341 @type bool
342 @param sizeOnly flag indicating to set the font size only
343 @type bool
341 """ 344 """
342 345
343 def setFont(font, style, substyle, familyOnly, sizeOnly): 346 def setFont(font, style, substyle, familyOnly, sizeOnly):
344 """ 347 """
345 Local function to set the font. 348 Local function to set the font.
412 415
413 def __fontButtonMenuTriggered(self, act): 416 def __fontButtonMenuTriggered(self, act):
414 """ 417 """
415 Private slot used to select the font of the selected style and lexer. 418 Private slot used to select the font of the selected style and lexer.
416 419
417 @param act reference to the triggering action (QAction) 420 @param act reference to the triggering action
421 @type QAction
418 """ 422 """
419 if act is None: 423 if act is None:
420 return 424 return
421 425
422 familyOnly = act.data() in [self.FAMILYANDSIZE, self.FAMILYONLY] 426 familyOnly = act.data() in [self.FAMILYANDSIZE, self.FAMILYONLY]
425 429
426 def __allFontsButtonMenuTriggered(self, act): 430 def __allFontsButtonMenuTriggered(self, act):
427 """ 431 """
428 Private slot used to change the font of all styles of a selected lexer. 432 Private slot used to change the font of all styles of a selected lexer.
429 433
430 @param act reference to the triggering action (QAction) 434 @param act reference to the triggering action
435 @type QAction
431 """ 436 """
432 if act is None: 437 if act is None:
433 return 438 return
434 439
435 familyOnly = act.data() in [self.FAMILYANDSIZE, self.FAMILYONLY] 440 familyOnly = act.data() in [self.FAMILYANDSIZE, self.FAMILYONLY]
440 def on_eolfillCheckBox_clicked(self, on): 445 def on_eolfillCheckBox_clicked(self, on):
441 """ 446 """
442 Private method used to set the eolfill for the selected style and 447 Private method used to set the eolfill for the selected style and
443 lexer. 448 lexer.
444 449
445 @param on flag indicating enabled or disabled state (boolean) 450 @param on flag indicating enabled or disabled state
451 @type bool
446 """ 452 """
447 style, substyle = self.__currentStyles() 453 style, substyle = self.__currentStyles()
448 checkState = Qt.CheckState.Checked if on else Qt.CheckState.Unchecked 454 checkState = Qt.CheckState.Checked if on else Qt.CheckState.Unchecked
449 for selItem in self.styleElementList.selectedItems(): 455 for selItem in self.styleElementList.selectedItems():
450 style, substyle = self.__stylesForItem(selItem) 456 style, substyle = self.__stylesForItem(selItem)
728 Public method to save the current state of the widget. 734 Public method to save the current state of the widget.
729 735
730 @return list containing the index of the selected lexer language 736 @return list containing the index of the selected lexer language
731 and a tuple containing the index of the parent selected lexer 737 and a tuple containing the index of the parent selected lexer
732 entry and the index of the selected entry 738 entry and the index of the selected entry
733 @rtype list of int and tuple of (int, int) 739 @rtype list of [int, tuple of (int, int)]
734 """ 740 """
735 itm = self.styleElementList.currentItem() 741 itm = self.styleElementList.currentItem()
736 if itm: 742 if itm:
737 parent = itm.parent() 743 parent = itm.parent()
738 if parent is None: 744 if parent is None:
754 def setState(self, state): 760 def setState(self, state):
755 """ 761 """
756 Public method to set the state of the widget. 762 Public method to set the state of the widget.
757 763
758 @param state state data generated by saveState 764 @param state state data generated by saveState
765 @type list of [int, tuple of (int, int)]
759 """ 766 """
760 if state: 767 if state:
761 self.lexerLanguageComboBox.setCurrentIndex(state[0]) 768 self.lexerLanguageComboBox.setCurrentIndex(state[0])
762 self.on_lexerLanguageComboBox_activated( 769 self.on_lexerLanguageComboBox_activated(
763 self.lexerLanguageComboBox.currentIndex() 770 self.lexerLanguageComboBox.currentIndex()
897 def create(dlg): 904 def create(dlg):
898 """ 905 """
899 Module function to create the configuration page. 906 Module function to create the configuration page.
900 907
901 @param dlg reference to the configuration dialog 908 @param dlg reference to the configuration dialog
902 @return reference to the instantiated page (ConfigurationPageBase) 909 @type ConfigurationDialog
910 @return reference to the instantiated page
911 @rtype ConfigurationPageBase
903 """ 912 """
904 page = EditorHighlightingStylesPage(dlg.getLexers()) 913 page = EditorHighlightingStylesPage(dlg.getLexers())
905 return page 914 return page

eric ide

mercurial