Skip to content
Draft
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
10 changes: 10 additions & 0 deletions spyder/plugins/projects/widgets/projectdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ def __init__(self, parent):
self._validation_label = MessageLabel(self)
self._validation_label.setVisible(False)

validation_label_css = self._validation_label.css
validation_label_css.QLabel.setValues(
marginRight=f"{7 * AppStyle.MarginSize}px",
# The extra 5px are necessary because we need to add them to all
# lineedits in this dialog to align them to the labels on top of
# them (see SpyderConfigPage.create_lineedit).
marginLeft=f"{7 * AppStyle.MarginSize + 5}px",
)
self._validation_label.setStyleSheet(validation_label_css.toString())

self._description_font = self.get_font(SpyderFontType.Interface)
self._description_font.setPointSize(
self._description_font.pointSize() + 1
Expand Down
15 changes: 15 additions & 0 deletions spyder/plugins/remoteclient/widgets/connectionpages.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def _create_password_subpage(self):
)

validation_label = MessageLabel(self)
self._set_css_for_validation_label(validation_label)

# Add widgets to their required dicts
self._widgets_for_validation[AuthenticationMethod.Password].append(
Expand Down Expand Up @@ -468,6 +469,7 @@ def _create_keyfile_subpage(self):
)

validation_label = MessageLabel(self)
self._set_css_for_validation_label(validation_label)

# Add widgets to their required dicts
self._widgets_for_validation[AuthenticationMethod.KeyFile].append(
Expand Down Expand Up @@ -517,6 +519,7 @@ def _create_configfile_subpage(self):
)

validation_label = MessageLabel(self)
self._set_css_for_validation_label(validation_label)

# Add widgets to their required dicts
self._name_widgets[AuthenticationMethod.ConfigFile] = name
Expand Down Expand Up @@ -573,6 +576,7 @@ def _create_jupyterhub_subpage(self):
)

validation_label = MessageLabel(self)
self._set_css_for_validation_label(validation_label)

# Add widgets to their required dicts
self._name_widgets[AuthenticationMethod.JupyterHub] = name
Expand Down Expand Up @@ -698,6 +702,17 @@ def _compose_failed_validation_text(self, reasons: ValidationReasons):

return text

def _set_css_for_validation_label(self, label: MessageLabel):
css = label.css
css.QLabel.setValues(
marginRight=f"{9 * AppStyle.MarginSize}px",
# The extra 5px are necessary because we need to add them to all
# lineedits in this dialog to align them to the labels on top of
# them (see SpyderConfigPage.create_lineedit).
marginLeft=f"{9 * AppStyle.MarginSize + 5}px",
)
label.setStyleSheet(css.toString())


class NewConnectionPage(BaseConnectionPage):
"""Page to receive SSH credentials for a remote connection."""
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/shortcuts/widgets/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def update_warning(self):
else:
warning = NO_WARNING
tip = _('This key sequence is valid.')
icon = ima.icon('dependency_ok')
icon = ima.icon('success')

self.warning = warning
self.conflicts = conflicts
Expand Down
2 changes: 1 addition & 1 deletion spyder/utils/icon_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def __init__(self):
'toggle_lowercase': [('mdi.format-letter-case-lower',), {'color': self.MAIN_FG_COLOR}],
'toggle_uppercase': [('mdi.format-letter-case-upper',), {'color': self.MAIN_FG_COLOR}],
'gotoline': [('mdi.format-line-spacing',), {'color': self.MAIN_FG_COLOR}],
'success': [('mdi.check',), {'color': SpyderPalette.COLOR_SUCCESS_3}],
'error': [('mdi.close-circle',), {'color': SpyderPalette.COLOR_ERROR_1}],
'warning': [('mdi.alert',), {'color': SpyderPalette.COLOR_WARN_2}],
'information': [('mdi.information-outline',), {'color': SpyderPalette.GROUP_9}],
Expand Down Expand Up @@ -383,7 +384,6 @@ def __init__(self):
'folding.arrow_down': [('mdi.chevron-down',), {'color': self.MAIN_FG_COLOR}],
'lspserver.down': [('mdi.alert',), {'color': self.MAIN_FG_COLOR}],
'lspserver.ready': [('mdi.check',), {'color': self.MAIN_FG_COLOR}],
'dependency_ok': [('mdi.check',), {'color': SpyderPalette.COLOR_SUCCESS_2}],
'dependency_warning': [('mdi.alert',), {'color': SpyderPalette.COLOR_WARN_2}],
'dependency_error': [('mdi.alert',), {'color': SpyderPalette.COLOR_ERROR_1}],
'broken_image': [('mdi.image-broken-variant',), {'color': self.MAIN_FG_COLOR}],
Expand Down
2 changes: 1 addition & 1 deletion spyder/widgets/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def update_dependencies(self, dependencies):

# Format content
if dependency.check():
item.setIcon(0, ima.icon('dependency_ok'))
item.setIcon(0, ima.icon('success'))
elif dependency.kind == OPTIONAL:
item.setIcon(0, ima.icon('dependency_warning'))
item.setBackground(2, QColor(SpyderPalette.COLOR_WARN_1))
Expand Down
21 changes: 10 additions & 11 deletions spyder/widgets/helperwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,24 +799,23 @@ def __init__(self, parent):
self.setVisible(False)

# Set style
css = qstylizer.style.StyleSheet()
css.QLabel.setValues(
self.css = qstylizer.style.StyleSheet()
self.css.QLabel.setValues(
backgroundColor=SpyderPalette.COLOR_BACKGROUND_2,
# Top margin is set by the layout
# Top margin is usually set by the layout
marginTop="0px",
marginRight=f"{9 * AppStyle.MarginSize}px",
# We don't need bottom margin because there are no other elements
# below this one.
# We usually don't need bottom margin because there are no other
# elements below this one.
marginBottom="0px",
# The extra 5px are necessary because we need to add them to all
# lineedits in this dialog to align them to the labels on top of
# them (see SpyderConfigPage.create_lineedit).
marginLeft=f"{9 * AppStyle.MarginSize + 5}px",
# Left and right margins need to be set according to where/how this
# widget is used.
marginLeft="0px",
marginRight="0px",
padding=f"{3 * AppStyle.MarginSize}px {6 * AppStyle.MarginSize}px",
borderRadius=SpyderPalette.SIZE_BORDER_RADIUS,
)

self.setStyleSheet(css.toString())
self.setStyleSheet(self.css.toString())

def set_text(self, text: str):
n_reasons = 1
Expand Down