Another little enhancement to the highlighter style config page to show the eol-fill status in the style list.

Sun, 24 Nov 2013 17:10:51 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 24 Nov 2013 17:10:51 +0100
changeset 3107
5b496e690984
parent 3105
80850df745a3
child 3108
30521d7d3101

Another little enhancement to the highlighter style config page to show the eol-fill status in the style list.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.html file | annotate | diff | comparison | revisions
Preferences/ConfigurationPages/EditorHighlightingStylesPage.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Sun Nov 24 16:44:16 2013 +0100
+++ b/APIs/Python3/eric5.api	Sun Nov 24 17:10:51 2013 +0100
@@ -5816,7 +5816,7 @@
 eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.EditorHighlightingStylesPage.on_allEolFillButton_clicked?4()
 eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.EditorHighlightingStylesPage.on_backgroundButton_clicked?4()
 eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.EditorHighlightingStylesPage.on_defaultButton_clicked?4()
-eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.EditorHighlightingStylesPage.on_eolfillCheckBox_toggled?4(b)
+eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.EditorHighlightingStylesPage.on_eolfillCheckBox_toggled?4(on)
 eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.EditorHighlightingStylesPage.on_exportAllButton_clicked?4()
 eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.EditorHighlightingStylesPage.on_exportCurrentButton_clicked?4()
 eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.EditorHighlightingStylesPage.on_foregroundButton_clicked?4()
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Source/eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.html	Sun Nov 24 16:44:16 2013 +0100
+++ b/Documentation/Source/eric5.Preferences.ConfigurationPages.EditorHighlightingStylesPage.html	Sun Nov 24 17:10:51 2013 +0100
@@ -256,14 +256,14 @@
         Private method to set the current style to its default values.
 </p><a NAME="EditorHighlightingStylesPage.on_eolfillCheckBox_toggled" ID="EditorHighlightingStylesPage.on_eolfillCheckBox_toggled"></a>
 <h4>EditorHighlightingStylesPage.on_eolfillCheckBox_toggled</h4>
-<b>on_eolfillCheckBox_toggled</b>(<i>b</i>)
+<b>on_eolfillCheckBox_toggled</b>(<i>on</i>)
 <p>
         Private method used to set the eolfill for the selected style and
         lexer.
 </p><dl>
-<dt><i>b</i></dt>
+<dt><i>on</i></dt>
 <dd>
-Flag indicating enabled or disabled state.
+flag indicating enabled or disabled state (boolean)
 </dd>
 </dl><a NAME="EditorHighlightingStylesPage.on_exportAllButton_clicked" ID="EditorHighlightingStylesPage.on_exportAllButton_clicked"></a>
 <h4>EditorHighlightingStylesPage.on_exportAllButton_clicked</h4>
--- a/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py	Sun Nov 24 16:44:16 2013 +0100
+++ b/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py	Sun Nov 24 17:10:51 2013 +0100
@@ -7,7 +7,7 @@
 Module implementing the Editor Highlighting Styles configuration page.
 """
 
-from PyQt4.QtCore import pyqtSlot, QFileInfo, QFile, QIODevice
+from PyQt4.QtCore import pyqtSlot, Qt, QFileInfo, QFile, QIODevice
 from PyQt4.QtGui import QPalette, QColorDialog, QFontDialog, \
     QInputDialog, QFont, QMenu
 
@@ -119,11 +119,16 @@
             colour = self.lexer.color(style)
             paper = self.lexer.paper(style)
             font = self.lexer.font(style)
+            eolfill = self.lexer.eolFill(style)
             
             itm = self.styleElementList.item(row)
             itm.setFont(font)
             itm.setBackground(paper)
             itm.setForeground(colour)
+            if eolfill:
+                itm.setCheckState(Qt.Checked)
+            else:
+                itm.setCheckState(Qt.Unchecked)
         
     def on_styleElementList_currentRowChanged(self, index):
         """
@@ -302,14 +307,16 @@
         sizeOnly = act.data() in [self.FAMILYANDSIZE, self.SIZEONLY]
         self.__changeFont(True, familyOnly, sizeOnly)
         
-    def on_eolfillCheckBox_toggled(self, b):
+    def on_eolfillCheckBox_toggled(self, on):
         """
         Private method used to set the eolfill for the selected style and
         lexer.
         
-        @param b Flag indicating enabled or disabled state.
+        @param on flag indicating enabled or disabled state (boolean)
         """
-        self.lexer.setEolFill(b, self.style)
+        self.lexer.setEolFill(on, self.style)
+        checkState = Qt.Checked if on else Qt.Unchecked
+        self.styleElementList.currentItem().setCheckState(checkState)
         
     @pyqtSlot()
     def on_allEolFillButton_clicked(self):
@@ -330,6 +337,7 @@
             self.eolfillCheckBox.setChecked(enabled)
             for style in list(self.lexer.ind2style.values()):
                 self.lexer.setEolFill(enabled, style)
+            self.__styleAllItems()
         
     @pyqtSlot()
     def on_defaultButton_clicked(self):

eric ide

mercurial