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

PR: Add help info widget to show tooltips in Preferences (UX/UI) #20926

Merged
merged 27 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4d2c15b
add help image label
jsbautista May 15, 2023
73fc563
Apply suggestions
jsbautista May 15, 2023
882851e
Apply suggestions
jsbautista May 24, 2023
ad5c01e
Apply suggestions
jsbautista May 24, 2023
026fe82
Merge branch 'master' into preferencesButton
jsbautista May 29, 2023
f71a31c
Apply suggestions
jsbautista Jun 5, 2023
a1ffa22
Merge branch 'preferencesButton' of https://github.com/jsbautista/spy…
jsbautista Jun 5, 2023
accf5fb
Apply suggestions
jsbautista Jun 5, 2023
ccc39a9
Merge branch 'master' into preferencesButton
jsbautista Jun 13, 2023
b857fd6
Merge branch 'master' into preferencesButton
jsbautista Jun 19, 2023
9b72d52
Merge branch 'master' into preferencesButton
jsbautista Jun 26, 2023
0e8111b
Apply suggestions
jsbautista Jun 26, 2023
52e6d96
Merge branch 'preferencesButton' of https://github.com/jsbautista/spy…
jsbautista Jun 26, 2023
fc34ae0
Apply suggestions
jsbautista Jun 26, 2023
3978d61
Apply suggestions
jsbautista Jun 26, 2023
7583ca8
Apply suggestions
jsbautista Jun 26, 2023
0bb5811
Apply suggestions
jsbautista Jun 26, 2023
3b3b399
Apply suggestions
jsbautista Jul 4, 2023
cf04e97
Merge branch 'master' into preferencesButton
jsbautista Jul 4, 2023
61bf9c7
Merge branch 'master' into preferencesButton
jsbautista Jul 7, 2023
226dbe1
Apply suggestions
jsbautista Jul 7, 2023
24c40ec
Merge branch 'master' into preferencesButton
jsbautista Jul 7, 2023
fd2032d
Fix some layout issues with the help label
dalthviz Jul 14, 2023
24a25d0
Fix status bar preferences page layout
dalthviz Jul 14, 2023
3c401c6
Apply suggestions from code review
dalthviz Jul 17, 2023
0a2ce34
Remove help_info kwarg
dalthviz Jul 17, 2023
207fea6
Merge branch 'master' into preferencesButton
dalthviz Jul 18, 2023
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
4 changes: 2 additions & 2 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3033,7 +3033,7 @@ def test_preferences_checkboxes_not_checked_regression(main_window, qtbot):
check_name = tab_widgets[tabname]
check = getattr(tab, check_name)
page.tabs.setCurrentIndex(idx)
check.animateClick()
check.checkbox.animateClick()
qtbot.wait(500)
dlg.ok_btn.animateClick()

Expand Down Expand Up @@ -3222,7 +3222,7 @@ def test_preferences_change_interpreter(qtbot, main_window):
# Change main interpreter on preferences
dlg, index, page = preferences_dialog_helper(qtbot, main_window,
'main_interpreter')
page.cus_exec_radio.setChecked(True)
page.cus_exec_radio.radiobutton.setChecked(True)
page.cus_exec_combo.combobox.setCurrentText(sys.executable)

mi_container = main_window.main_interpreter.get_container()
Expand Down
6 changes: 3 additions & 3 deletions spyder/plugins/appearance/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def setup_page(self):
self.delete_button.clicked.connect(self.delete_scheme)
self.schemes_combobox.currentIndexChanged.connect(self.update_preview)
self.schemes_combobox.currentIndexChanged.connect(self.update_buttons)
system_font_checkbox.stateChanged.connect(self.update_app_font_group)
system_font_checkbox.checkbox.stateChanged.connect(self.update_app_font_group)
dalthviz marked this conversation as resolved.
Show resolved Hide resolved

# Setup
for name in names:
Expand All @@ -191,8 +191,8 @@ def setup_page(self):
self.scheme_editor_dialog.add_color_scheme_stack(name, custom=True)

if sys.platform == 'darwin':
system_font_checkbox.setEnabled(False)
self.update_app_font_group(system_font_checkbox.isChecked())
system_font_checkbox.checkbox.setEnabled(False)
self.update_app_font_group(system_font_checkbox.checkbox.isChecked())
self.update_combobox()
self.update_preview()

Expand Down
35 changes: 23 additions & 12 deletions spyder/plugins/application/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def setup_page(self):
'use_custom_margin')
margin_spin = self.create_spinbox("", _("pixels"), 'custom_margin',
default=0, min_=0, max_=30)
margin_box.toggled.connect(margin_spin.spinbox.setEnabled)
margin_box.toggled.connect(margin_spin.slabel.setEnabled)
margin_box.checkbox.toggled.connect(margin_spin.spinbox.setEnabled)
margin_box.checkbox.toggled.connect(margin_spin.slabel.setEnabled)
margin_spin.spinbox.setEnabled(self.get_option('use_custom_margin'))
margin_spin.slabel.setEnabled(self.get_option('use_custom_margin'))

Expand All @@ -114,8 +114,8 @@ def setup_page(self):
'custom_cursor_blinking',
default=QApplication.cursorFlashTime(),
min_=0, max_=5000, step=100)
cursor_box.toggled.connect(cursor_spin.spinbox.setEnabled)
cursor_box.toggled.connect(cursor_spin.slabel.setEnabled)
cursor_box.checkbox.toggled.connect(cursor_spin.spinbox.setEnabled)
cursor_box.checkbox.toggled.connect(cursor_spin.slabel.setEnabled)
cursor_spin.spinbox.setEnabled(
self.get_option('use_custom_cursor_blinking'))
cursor_spin.slabel.setEnabled(
Expand Down Expand Up @@ -153,7 +153,7 @@ def set_open_file(state):
_("Open files from Finder with Spyder"),
'mac_open_file',
tip=_("Register Spyder with the Launch Services"))
mac_open_file_box.toggled.connect(set_open_file)
mac_open_file_box.checkbox.toggled.connect(set_open_file)
macOS_layout = QVBoxLayout()
macOS_layout.addWidget(mac_open_file_box)
if als.get_bundle_identifier() is None:
Expand Down Expand Up @@ -207,21 +207,32 @@ def set_open_file(state):
regex=r"[0-9]+(?:\.[0-9]*)(;[0-9]+(?:\.[0-9]*))*",
restart=True)

normal_radio.toggled.connect(self.custom_scaling_edit.setDisabled)
auto_scale_radio.toggled.connect(self.custom_scaling_edit.setDisabled)
custom_scaling_radio.toggled.connect(
self.custom_scaling_edit.setEnabled)
normal_radio.radiobutton.toggled.connect(
self.custom_scaling_edit.textbox.setDisabled)
auto_scale_radio.radiobutton.toggled.connect(
self.custom_scaling_edit.textbox.setDisabled)
custom_scaling_radio.radiobutton.toggled.connect(
self.custom_scaling_edit.textbox.setEnabled)

# Layout Screen resolution
screen_resolution_layout = QVBoxLayout()
screen_resolution_layout.addWidget(screen_resolution_label)

screen_resolution_inner_layout = QGridLayout()
screen_resolution_inner_layout.addWidget(normal_radio, 0, 0)
screen_resolution_inner_layout.addWidget(auto_scale_radio, 1, 0)
screen_resolution_inner_layout.addWidget(custom_scaling_radio, 2, 0)
screen_resolution_inner_layout.addWidget(
self.custom_scaling_edit, 2, 1)
auto_scale_radio.radiobutton, 1, 0)
screen_resolution_inner_layout.addWidget(
auto_scale_radio.radiobutton.help_label, 1, 1)
screen_resolution_inner_layout.addWidget(
custom_scaling_radio.radiobutton, 2, 0)
screen_resolution_inner_layout.addWidget(
custom_scaling_radio.radiobutton.help_label, 2, 1)
screen_resolution_inner_layout.addWidget(
self.custom_scaling_edit.textbox, 2, 2)
screen_resolution_inner_layout.addWidget(
self.custom_scaling_edit.help_label, 2, 3)
screen_resolution_inner_layout.setColumnStretch(2, 1)

screen_resolution_layout.addLayout(screen_resolution_inner_layout)
screen_resolution_group.setLayout(screen_resolution_layout)
Expand Down
9 changes: 7 additions & 2 deletions spyder/plugins/completion/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,23 @@ def setup_page(self):
completions_layout.addWidget(completions_after_characters.plabel, 3, 0)
completions_layout.addWidget(
completions_after_characters.spinbox, 3, 1)
completions_layout.addWidget(
completions_after_characters.help_label, 3, 2)
completions_layout.addWidget(completions_hint_after_idle.plabel, 5, 0)
completions_layout.addWidget(completions_hint_after_idle.spinbox, 5, 1)
completions_layout.addWidget(
completions_hint_after_idle.help_label, 5, 2)
completions_layout.addWidget(completions_wait_for_ms.plabel, 6, 0)
completions_layout.addWidget(completions_wait_for_ms.spinbox, 6, 1)
completions_layout.setColumnStretch(2, 6)
completions_layout.addWidget(completions_wait_for_ms.help_label, 6, 2)
completions_layout.setColumnStretch(3, 6)
self.completions_group.setLayout(completions_layout)

def disable_completion_after_characters(state):
completions_after_characters.plabel.setEnabled(state)
completions_after_characters.spinbox.setEnabled(state)

automatic_completion_box.toggled.connect(
automatic_completion_box.checkbox.toggled.connect(
disable_completion_after_characters)

layout = QVBoxLayout()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def __init__(self, parent):
self.use_stdio = self.create_checkbox(
_("Use stdio pipes to communicate with server"),
'advanced/stdio')
self.use_stdio.stateChanged.connect(self.disable_tcp)
self.external_server.stateChanged.connect(self.disable_stdio)
self.use_stdio.checkbox.stateChanged.connect(self.disable_tcp)
self.external_server.checkbox.stateChanged.connect(self.disable_stdio)

# Advanced layout
advanced_g_layout = QGridLayout()
Expand All @@ -87,9 +87,9 @@ def __init__(self, parent):
advanced_options_widget = QWidget()
advanced_options_widget.setLayout(advanced_options_layout)
advanced_options_widget.setEnabled(self.get_option('advanced/enabled'))
self.advanced_options_check.toggled.connect(
self.advanced_options_check.checkbox.toggled.connect(
advanced_options_widget.setEnabled)
self.advanced_options_check.toggled.connect(
self.advanced_options_check.checkbox.toggled.connect(
self.show_advanced_warning)

# Advanced options layout
Expand All @@ -108,15 +108,15 @@ def disable_tcp(self, state):
if state == Qt.Checked:
self.advanced_host.textbox.setEnabled(False)
self.advanced_port.spinbox.setEnabled(False)
self.external_server.stateChanged.disconnect()
self.external_server.setChecked(False)
self.external_server.setEnabled(False)
self.external_server.checkbox.stateChanged.disconnect()
self.external_server.checkbox.setChecked(False)
self.external_server.checkbox.setEnabled(False)
else:
self.advanced_host.textbox.setEnabled(True)
self.advanced_port.spinbox.setEnabled(True)
self.external_server.setChecked(False)
self.external_server.setEnabled(True)
self.external_server.stateChanged.connect(self.disable_stdio)
self.external_server.checkbox.setChecked(False)
self.external_server.checkbox.setEnabled(True)
self.external_server.checkbox.stateChanged.connect(self.disable_stdio)
dalthviz marked this conversation as resolved.
Show resolved Hide resolved

def disable_stdio(self, state):
if state == Qt.Checked:
Expand Down Expand Up @@ -167,10 +167,10 @@ def is_valid(self):
# and we need to automatically check the corresponding
# option
if host not in ['127.0.0.1', 'localhost']:
self.external_server.setChecked(True)
self.external_server.checkbox.setChecked(True)

# Checks for external PyLS
if self.external_server.isChecked():
if self.external_server.checkbox.isChecked():
port = int(self.advanced_port.spinbox.text())

# Check that host and port of the current server are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __init__(self, parent):
docstring_style_g_widget = QWidget()
docstring_style_g_widget.setLayout(docstring_style_g_layout)
docstring_style_g_widget.setEnabled(self.get_option('pydocstyle'))
self.docstring_style_check.toggled.connect(
self.docstring_style_check.checkbox.toggled.connect(
docstring_style_g_widget.setEnabled)

# Docstring style layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(self, parent):
code_style_g_widget = QWidget()
code_style_g_widget.setLayout(code_style_g_layout)
code_style_g_widget.setEnabled(self.get_option('pycodestyle'))
self.code_style_check.toggled.connect(code_style_g_widget.setEnabled)
self.code_style_check.checkbox.toggled.connect(code_style_g_widget.setEnabled)
dalthviz marked this conversation as resolved.
Show resolved Hide resolved

# Code style layout
code_style_group = QGroupBox(_("Code style"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, parent):
introspection_layout.addWidget(enable_hover_hints_box)
introspection_group.setLayout(introspection_layout)

goto_definition_box.toggled.connect(follow_imports_box.setEnabled)
goto_definition_box.checkbox.toggled.connect(follow_imports_box.setEnabled)
dalthviz marked this conversation as resolved.
Show resolved Hide resolved

# Advanced group
advanced_group = QGroupBox(_("Advanced"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ def __init__(self, parent):
linting_layout.addWidget(underline_errors_box)
linting_layout.addWidget(linting_complexity_box)
self.setLayout(linting_layout)
linting_check.toggled.connect(underline_errors_box.setEnabled)
linting_check.checkbox.toggled.connect(underline_errors_box.setEnabled)
8 changes: 4 additions & 4 deletions spyder/plugins/editor/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def setup_page(self):
"", _(" ms"),
'occurrence_highlighting/timeout',
min_=100, max_=1000000, step=100)
occurrence_box.toggled.connect(occurrence_spin.spinbox.setEnabled)
occurrence_box.toggled.connect(occurrence_spin.slabel.setEnabled)
occurrence_box.checkbox.toggled.connect(occurrence_spin.spinbox.setEnabled)
occurrence_box.checkbox.toggled.connect(occurrence_spin.slabel.setEnabled)
dalthviz marked this conversation as resolved.
Show resolved Hide resolved
occurrence_spin.spinbox.setEnabled(
self.get_option('occurrence_highlighting'))
occurrence_spin.slabel.setEnabled(
Expand Down Expand Up @@ -220,7 +220,7 @@ def enable_tabwidth_spin(index):
_('seconds'),
'autosave_interval',
min_=1, max_=3600)
autosave_checkbox.toggled.connect(autosave_spinbox.setEnabled)
autosave_checkbox.checkbox.toggled.connect(autosave_spinbox.setEnabled)

autosave_layout = QVBoxLayout()
autosave_layout.addWidget(autosave_checkbox)
Expand Down Expand Up @@ -297,7 +297,7 @@ def enable_tabwidth_spin(index):
eol_combo_choices,
'convert_eol_on_save_to',
)
convert_eol_on_save_box.toggled.connect(
convert_eol_on_save_box.checkbox.toggled.connect(
convert_eol_on_save_combo.setEnabled)
convert_eol_on_save_combo.setEnabled(
self.get_option('convert_eol_on_save'))
Expand Down
10 changes: 6 additions & 4 deletions spyder/plugins/ipythonconsole/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def setup_page(self):
"plotting libraries different to Matplotlib or to develop\n"
"GUIs with Spyder."))
autoload_pylab_box.setEnabled(self.get_option('pylab'))
pylab_box.toggled.connect(autoload_pylab_box.setEnabled)
pylab_box.checkbox.toggled.connect(autoload_pylab_box.setEnabled)

pylab_layout = QVBoxLayout()
pylab_layout.addWidget(pylab_box)
Expand Down Expand Up @@ -131,7 +131,7 @@ def setup_page(self):
backend_layout.addWidget(backend_box)
backend_group.setLayout(backend_layout)
backend_group.setEnabled(self.get_option('pylab'))
pylab_box.toggled.connect(backend_group.setEnabled)
pylab_box.checkbox.toggled.connect(backend_group.setEnabled)

# Inline backend Group
inline_group = QGroupBox(_("Inline backend"))
Expand Down Expand Up @@ -186,7 +186,7 @@ def setup_page(self):
inline_v_layout.addLayout(inline_h_layout)
inline_group.setLayout(inline_v_layout)
inline_group.setEnabled(self.get_option('pylab'))
pylab_box.toggled.connect(inline_group.setEnabled)
pylab_box.checkbox.toggled.connect(inline_group.setEnabled)

# --- Startup ---
# Run lines Group
Expand Down Expand Up @@ -215,7 +215,7 @@ def setup_page(self):
'startup/use_run_file', False)
run_file_browser = self.create_browsefile('', 'startup/run_file', '')
run_file_browser.setEnabled(False)
file_radio.toggled.connect(run_file_browser.setEnabled)
file_radio.checkbox.toggled.connect(run_file_browser.setEnabled)

run_file_layout = QVBoxLayout()
run_file_layout.addWidget(run_file_label)
Expand Down Expand Up @@ -338,8 +338,10 @@ def setup_page(self):
prompts_g_layout = QGridLayout()
prompts_g_layout.addWidget(in_prompt_edit.label, 0, 0)
prompts_g_layout.addWidget(in_prompt_edit.textbox, 0, 1)
prompts_g_layout.addWidget(in_prompt_edit.help_label, 0, 2)
prompts_g_layout.addWidget(out_prompt_edit.label, 1, 0)
prompts_g_layout.addWidget(out_prompt_edit.textbox, 1, 1)
prompts_g_layout.addWidget(out_prompt_edit.help_label, 1, 2)
prompts_layout.addLayout(prompts_g_layout)
prompts_group.setLayout(prompts_layout)

Expand Down
4 changes: 2 additions & 2 deletions spyder/plugins/maininterpreter/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def setup_page(self):
adjust_to_contents=True,
validate_callback=programs.is_python_interpreter,
)
self.def_exec_radio.toggled.connect(self.cus_exec_combo.setDisabled)
self.cus_exec_radio.toggled.connect(self.cus_exec_combo.setEnabled)
self.def_exec_radio.radiobutton.toggled.connect(self.cus_exec_combo.setDisabled)
self.cus_exec_radio.radiobutton.toggled.connect(self.cus_exec_combo.setEnabled)
dalthviz marked this conversation as resolved.
Show resolved Hide resolved
pyexec_layout.addWidget(self.cus_exec_combo)
pyexec_group.setLayout(pyexec_layout)

Expand Down
Loading