diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index 023a5cd053f..804b4573eda 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -71,8 +71,8 @@ from spyder import dependencies from spyder.app import tour from spyder.app.utils import (create_splash_screen, delete_lsp_log_files, - qt_message_handler, setup_logging, - set_opengl_implementation, Spy) + qt_message_handler, set_links_color, + setup_logging, set_opengl_implementation, Spy) from spyder.config.base import (_, DEV, get_conf_path, get_debug_level, get_home_dir, get_module_source_path, get_safe_mode, is_pynsist, running_in_mac_app, @@ -2289,6 +2289,9 @@ def main(options, args): pass CONF.set('main', 'previous_crash', previous_crash) + # **** Set color for links **** + set_links_color(app) + # **** Create main window **** mainwindow = None try: diff --git a/spyder/app/utils.py b/spyder/app/utils.py index b7282c99108..4bc79a37dda 100644 --- a/spyder/app/utils.py +++ b/spyder/app/utils.py @@ -17,7 +17,7 @@ # Third-party imports import psutil from qtpy.QtCore import QCoreApplication, Qt -from qtpy.QtGui import QPixmap +from qtpy.QtGui import QColor, QPalette, QPixmap from qtpy.QtWidgets import QSplashScreen # Local imports @@ -26,6 +26,7 @@ from spyder.utils.image_path_manager import get_image_path from spyder.utils.qthelpers import file_uri from spyder.utils.external.dafsa.dafsa import DAFSA +from spyder.utils.stylesheet import QStylePalette # For spyder-ide/spyder#7447. try: @@ -183,3 +184,17 @@ def create_splash_screen(): splash = None return splash + + +def set_links_color(app): + """ + Fix color for links. + + This is taken from QDarkstyle, which is MIT licensed. + """ + color = QStylePalette.COLOR_ACCENT_3 + qcolor = QColor(color) + + app_palette = app.palette() + app_palette.setColor(QPalette.Normal, QPalette.Link, qcolor) + app.setPalette(app_palette) diff --git a/spyder/plugins/editor/widgets/editor.py b/spyder/plugins/editor/widgets/editor.py index e620d7052c3..63305e1171b 100644 --- a/spyder/plugins/editor/widgets/editor.py +++ b/spyder/plugins/editor/widgets/editor.py @@ -3195,7 +3195,7 @@ def __init__(self, plugin, menu_actions, toolbar_list, menu_list): self.toolbars.append(toolbar) if menu_list: quit_action = create_action(self, _("Close window"), - icon="close_panel", + icon=ima.icon("close_pane"), tip=_("Close this window"), triggered=self.close) self.menus = [] diff --git a/spyder/plugins/variableexplorer/widgets/objectexplorer/objectexplorer.py b/spyder/plugins/variableexplorer/widgets/objectexplorer/objectexplorer.py index 1e4878e17cc..a94a7a169a3 100644 --- a/spyder/plugins/variableexplorer/widgets/objectexplorer/objectexplorer.py +++ b/spyder/plugins/variableexplorer/widgets/objectexplorer/objectexplorer.py @@ -34,8 +34,8 @@ DEFAULT_ATTR_COLS, DEFAULT_ATTR_DETAILS, ToggleColumnTreeView, TreeItem, TreeModel, TreeProxyModel) from spyder.utils.icon_manager import ima -from spyder.utils.qthelpers import (add_actions, create_plugin_layout, - create_toolbutton, qapplication) +from spyder.utils.qthelpers import add_actions, create_toolbutton, qapplication +from spyder.utils.stylesheet import PANES_TOOLBAR_STYLESHEET from spyder.widgets.simplecodeeditor import SimpleCodeEditor @@ -185,6 +185,7 @@ def _setup_menu(self, show_callable_attributes=False, toggled=self._toggle_show_callable_attributes_action) callable_attributes.setCheckable(True) callable_attributes.setChecked(show_callable_attributes) + callable_attributes.setStyleSheet(str(PANES_TOOLBAR_STYLESHEET)) self.tools_layout.addWidget(callable_attributes) special_attributes = create_toolbutton( @@ -193,20 +194,21 @@ def _setup_menu(self, show_callable_attributes=False, toggled=self._toggle_show_special_attributes_action) special_attributes.setCheckable(True) special_attributes.setChecked(show_special_attributes) + special_attributes.setStyleSheet(str(PANES_TOOLBAR_STYLESHEET)) + self.tools_layout.addSpacing(5) self.tools_layout.addWidget(special_attributes) self.tools_layout.addStretch() self.options_button = create_toolbutton( self, text=_('Options'), icon=ima.icon('tooloptions')) + self.options_button.setStyleSheet(str(PANES_TOOLBAR_STYLESHEET)) self.options_button.setPopupMode(QToolButton.InstantPopup) self.show_cols_submenu = QMenu(self) + self.show_cols_submenu.setObjectName('checkbox-padding') self.options_button.setMenu(self.show_cols_submenu) - # Don't show menu arrow and remove padding - self.options_button.setStyleSheet( - ("QToolButton::menu-indicator{image: none;}\n" - "QToolButton{padding: 3px;}")) + self.show_cols_submenu.setStyleSheet(str(PANES_TOOLBAR_STYLESHEET)) self.tools_layout.addWidget(self.options_button) @Slot() @@ -226,9 +228,13 @@ def _toggle_show_special_attributes_action(self): def _setup_views(self): """Creates the UI widgets.""" + layout = QVBoxLayout() + layout.setContentsMargins(0, 0, 0, 0) + layout.setSpacing(0) + + layout.addLayout(self.tools_layout) self.central_splitter = QSplitter(self, orientation=Qt.Vertical) - layout = create_plugin_layout(self.tools_layout, - self.central_splitter) + layout.addWidget(self.central_splitter) self.setLayout(layout) # Stretch last column? diff --git a/spyder/utils/icon_manager.py b/spyder/utils/icon_manager.py index d322f3a8ef1..ac8130c5561 100644 --- a/spyder/utils/icon_manager.py +++ b/spyder/utils/icon_manager.py @@ -184,7 +184,7 @@ def __init__(self): 'editcut': [('mdi.content-cut',), {'color': self.MAIN_FG_COLOR}], 'editclear': [('mdi.delete',), {'color': self.MAIN_FG_COLOR}], 'selectall': [('mdi.select-all',), {'color': self.MAIN_FG_COLOR}], - 'exit': [('mdi.power',), {'color': SpyderPalette.COLOR_ERROR_1}], + 'exit': [('mdi.power',), {'color': self.MAIN_FG_COLOR}], 'advanced': [('mdi.package-variant',), {'color': self.MAIN_FG_COLOR}], 'bug': [('mdi.bug',), {'color': self.MAIN_FG_COLOR}], 'window_nofullscreen': [('mdi.arrow-collapse-all',), {'color': self.MAIN_FG_COLOR}],