diff --git a/images/themes/default/console/iconCommentEditorConsole.svg b/images/themes/default/console/iconCommentEditorConsole.svg index 36b445934a1..44790de3166 100644 --- a/images/themes/default/console/iconCommentEditorConsole.svg +++ b/images/themes/default/console/iconCommentEditorConsole.svg @@ -1,5 +1,4 @@ - - + diff --git a/python/console/console.py b/python/console/console.py index ba15c4460f1..0789c2e312d 100644 --- a/python/console/console.py +++ b/python/console/console.py @@ -46,7 +46,7 @@ from qgis.PyQt.QtWidgets import ( QApplication, QShortcut, ) -from qgis.PyQt.QtGui import QDesktopServices, QKeySequence +from qgis.PyQt.QtGui import QDesktopServices, QKeySequence, QColor, QPalette from qgis.PyQt.QtWidgets import QVBoxLayout, QMessageBox from qgis.utils import iface from .console_sci import ShellScintilla @@ -320,7 +320,10 @@ class PythonConsoleWidget(QWidget): self.toggleCommentEditorButton.setCheckable(False) self.toggleCommentEditorButton.setEnabled(True) self.toggleCommentEditorButton.setIcon( - QgsApplication.getThemeIcon("console/iconCommentEditorConsole.svg") + QgsApplication.getThemeIcon( + "console/iconCommentEditorConsole.svg", + self.palette().color(QPalette.WindowText), + ), ) self.toggleCommentEditorButton.setMenuRole(QAction.MenuRole.PreferencesRole) self.toggleCommentEditorButton.setIconVisibleInMenu(True) diff --git a/python/console/console_editor.py b/python/console/console_editor.py index c7e868372c5..e18e93d6a31 100644 --- a/python/console/console_editor.py +++ b/python/console/console_editor.py @@ -48,7 +48,7 @@ from qgis.PyQt.QtCore import ( Qt, QUrl, ) -from qgis.PyQt.QtGui import QKeySequence +from qgis.PyQt.QtGui import QKeySequence, QColor, QPalette from qgis.PyQt.QtNetwork import QNetworkRequest from qgis.PyQt.QtWidgets import ( QAction, @@ -261,7 +261,10 @@ class Editor(QgsCodeEditorPython): menu.addSeparator() toggle_comment_action = QAction( - QgsApplication.getThemeIcon("console/iconCommentEditorConsole.svg"), + QgsApplication.getThemeIcon( + "console/iconCommentEditorConsole.svg", + self.palette().color(QPalette.WindowText), + ), QCoreApplication.translate("PythonConsole", "Toggle Comment"), menu, )