Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui][python console] Fix hard to read python console editor icons #60261

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion images/themes/default/console/iconClassBrowserConsole.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion 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.ColorRole.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.ColorRole.WindowText),
),
QCoreApplication.translate("PythonConsole", "Toggle Comment"),
menu,
)
Expand Down
Loading