Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn authored and nyalldawson committed Jan 29, 2025
1 parent c62e2d2 commit 8f9024b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions images/themes/default/console/iconCommentEditorConsole.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions python/console/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
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
Expand Down Expand Up @@ -320,7 +320,10 @@ def __init__(self, parent=None):
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)
Expand Down
7 changes: 5 additions & 2 deletions python/console/console_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
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,
Expand Down Expand Up @@ -261,7 +261,10 @@ def contextMenuEvent(self, e):

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,
)
Expand Down

0 comments on commit 8f9024b

Please sign in to comment.