Sat, 18 Nov 2023 17:51:18 +0100
Editor
- Added a button to format underline text of HTML documents
--- a/docs/changelog.md Sat Nov 18 15:22:35 2023 +0100 +++ b/docs/changelog.md Sat Nov 18 17:51:18 2023 +0100 @@ -19,6 +19,7 @@ __Note__: The `Auto Save` interval has to be reconfigured! - Added the capability to save a modified file automatically when the editor looses the focus. + - Added a button to format underline text of HTML documents. - Icons - Added a configuration option to override the style dependent icon size of the tool bars.
--- a/src/eric7/QScintilla/EditorButtonsWidget.py Sat Nov 18 15:22:35 2023 +0100 +++ b/src/eric7/QScintilla/EditorButtonsWidget.py Sat Nov 18 17:51:18 2023 +0100 @@ -191,6 +191,7 @@ self.__addButton( "strikethrough", "formatTextStrikethrough", self.tr("Strike Through") ) + self.__addButton("underline", "formatTextUnderline", self.tr("Underline")) self.__addSeparator() self.__addButton("header1", "formatTextHeader1", self.tr("Header 1")) self.__addButton("header2", "formatTextHeader2", self.tr("Header 2")) @@ -269,6 +270,7 @@ self.__buttons["strikethrough"].setEnabled( self.__provider.hasStrikethrough() ) + self.__buttons["underline"].setEnabled(self.__provider.hasUnderline()) headerLevels = self.__provider.headerLevels() self.__buttons["header1"].setEnabled(headerLevels >= 1) @@ -304,6 +306,8 @@ self.__provider.italic(self.__editor) elif formatName == "strikethrough": self.__provider.strikethrough(self.__editor) + elif formatName == "underline": + self.__provider.underline(self.__editor) elif formatName.startswith("header"): with contextlib.suppress(ValueError): level = int(formatName[-1])
--- a/src/eric7/QScintilla/MarkupProviders/HtmlProvider.py Sat Nov 18 15:22:35 2023 +0100 +++ b/src/eric7/QScintilla/MarkupProviders/HtmlProvider.py Sat Nov 18 17:51:18 2023 +0100 @@ -87,6 +87,24 @@ """ self.__insertMarkup("del", editor) + def hasUnderline(self): + """ + Public method to indicate the availability of underline markup. + + @return flag indicating the availability of underline markup + @rtype bool + """ + return True + + def underline(self, editor): + """ + Public method to generate underline text. + + @param editor reference to the editor to work on + @type Editor + """ + self.__insertMarkup("u", editor) + def headerLevels(self): """ Public method to determine the available header levels.
--- a/src/eric7/QScintilla/MarkupProviders/MarkupBase.py Sat Nov 18 15:22:35 2023 +0100 +++ b/src/eric7/QScintilla/MarkupProviders/MarkupBase.py Sat Nov 18 17:51:18 2023 +0100 @@ -86,6 +86,24 @@ """ pass + def hasUnderline(self): + """ + Public method to indicate the availability of underline markup. + + @return flag indicating the availability of underline markup + @rtype bool + """ + return False + + def underline(self, editor): + """ + Public method to generate underline text. + + @param editor reference to the editor to work on + @type Editor + """ + pass + def headerLevels(self): """ Public method to determine the available header levels.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/eric7/icons/breeze-dark/formatTextUnderline.svg Sat Nov 18 17:51:18 2023 +0100 @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + viewBox="0 0 22 22" + version="1.1" + id="svg6" + sodipodi:docname="formatTextUnderline.svg" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <sodipodi:namedview + id="namedview8" + pagecolor="#ffffff" + bordercolor="#000000" + borderopacity="0.25" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + showgrid="false" + inkscape:zoom="33.772727" + inkscape:cx="11" + inkscape:cy="11" + inkscape:window-width="3440" + inkscape:window-height="1380" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg6" /> + <defs + id="defs3051"> + <style + type="text/css" + id="current-color-scheme"> + .ColorScheme-Text { + color:#eff0f1; + } + </style> + </defs> + <path + style="fill:currentColor;fill-opacity:1;stroke:none;stroke-width:1.26773" + d="M 4.5714286,1 V 9.7499999 C 4.5714286,13.2125 7.4385713,16 11,16 c 3.561429,0 6.428571,-2.7875 6.428571,-6.2500001 V 1 h -2.571428 v 10 c 0,1.385 -1.146857,2.5 -2.571429,2.5 -1.424571,0 -2.571428,-1.115 -2.571428,-2.5 V 1 Z M 2,19.75 V 21 h 18 v -1.25 z" + class="ColorScheme-Text" + id="path4" /> +</svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/eric7/icons/breeze-light/formatTextUnderline.svg Sat Nov 18 17:51:18 2023 +0100 @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + viewBox="0 0 22 22" + version="1.1" + id="svg6" + sodipodi:docname="formatTextUnderline.svg" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <sodipodi:namedview + id="namedview8" + pagecolor="#ffffff" + bordercolor="#000000" + borderopacity="0.25" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + showgrid="false" + inkscape:zoom="33.772727" + inkscape:cx="11" + inkscape:cy="11" + inkscape:window-width="3440" + inkscape:window-height="1380" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg6" /> + <defs + id="defs3051"> + <style + type="text/css" + id="current-color-scheme"> + .ColorScheme-Text { + color:#232629; + } + </style> + </defs> + <path + style="fill:currentColor;fill-opacity:1;stroke:none;stroke-width:1.26773" + d="m 4.5714286,1 v 8.75 c 0,3.4625 2.8671428,6.25 6.4285714,6.25 3.561429,0 6.428571,-2.7875 6.428571,-6.25 V 1 h -2.571428 v 10 c 0,1.385 -1.146857,2.5 -2.571429,2.5 -1.424571,0 -2.571428,-1.115 -2.571428,-2.5 V 1 Z M 2,19.75 V 21 h 18 v -1.25 z" + class="ColorScheme-Text" + id="path4" /> +</svg>