Repository: spyder-ide/spyder
Pull request: PR: Don't hide control debugger buttons from main toolbar while executing
<!--- Explain what you've done and why --->
while debugging, clicking run (step in/out, etc) causes the debug actions on the toolbar to briefly hide until the current line has completed. This looks visually glitchy, and can cause mis-clicks. Instead continue to show the buttons if currently executing.

### Issue(s) Resolved

<!--- List the issue(s) below, in the form "Fixes #1234"; one per line --->

Fixes #23208


### Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the [Developer Certificate of Origin](https://developercertificate.org)
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

<!--- TYPE YOUR USER/NAME AFTER THE FOLLOWING: --->
I certify the above statement is true and correct: athompson673

<!--- Thanks for your help making Spyder better for everyone! --->


Problem statement:
The control debugger buttons are hidden from the main toolbar when code is executed
Hello Friends!

Thank you for the wonderful Spyder. I noticed a few UI or workflow changes - or flaws - with the Version 6 (and, may be, would like to start a discussion.)

**Debug buttons**
  From the release of V.6, the debug buttons are not always visible. Debug-function is one of the most used functions, it shouldn't be hidden, instead it should always be visible and accessible - no matter, what window or dialog is displayed. Like the Run-button, too. 
With the Version 6.0.0, "just" the button "start debug" button is displayed on the main window. The other debug buttons are hidden in the debug-pane (similar to the variable explorer). That makes it impossible to, f.e., "run debug until next line" and observe the change of variables at the same time without switching the windows. 

This has been addressed in V. 6.0.2 with making the other debug buttons appear dynamically, when starting the Debug-mode. In my case, I see a constant disappearing and reappearing of all the buttons, when I click on, f.e., "run until next break point", while running a lengthy function-block. This makes it distracting and in case of fast successive clicking, some clicks are lost because the button is not visible at such moments. More over, I unwillingly clicked another button of the button pane, because it moved under my cursor just in the moment I clicked. As solution I have to disable all the other buttons. 
Proposals:
- make the core function buttons always visible and accessible. It's a core functionality.
- let the user decide what buttons to show / make the toolbar buttons customizable. I don't need "run cell", yet it's using up the real estate on the toolbar. 
- let the user decide, where the buttons are positioned & displayed / positions & order of the buttons. Keep that position at all circumstances.


**Immediate and automatic opening of the variables after one left-click.** 
When using a mouse, one click is select, double-click means execution. This usage pattern gets broken, if one click immediately opens up a new window with variable explorer. Especially for me, I like to select a variable and keep it selected, so I visually can locate it after scrolling and checking other variable's value. While I understand the comfort of one-click-execution, this breaks the whole mouse usage-pattern. I just want to select it, now it opens it.
Proposals:
- let the user decide, whether one-click opens or selects. This can be implemented in the preferences/variable explorer.

**Fixed layout of preferences/settings dialogue**
I feel a discomfort using preferences/settings dialogue. I think the reason is the fixed size of the dialogue's elements. While the preferences-window by itself can be resized, the content elements on the right side do not change their sizes. This makes me feel strange. I don't know why. May be, the layout's proportions get visually broken and so my visual-brain, too. 
Proposals:
- may be there's a way to make the positions and sizes relative to the preference-window / not fixed?

What do you think?

Best wishes, 
tony.

Hints from issue discussion:
True. Debugging in Spyder 6 is completely messed up. I can add that I was not able to change debugging shortcuts in the Preferences window. Had to switch back to version 5. 
The buttons hiding during execution of a current line definitely seems like a bug. I generally appreciate resizable windows, but the settings content is relatively fixed, and it would be a lot of effort with not much reward to make custom resizing behavior for every page. I somewhat agree on the double click aspect of the variable explorer, however you can easily select an item with the arrow keys once the pane has focus.

Commit message: fix bug: actions shown while executing without debugging

Patch to review:
diff --git a/spyder/plugins/debugger/widgets/main_widget.py b/spyder/plugins/debugger/widgets/main_widget.py
index 6176c3bc033..3a52d2472e4 100644
--- a/spyder/plugins/debugger/widgets/main_widget.py
+++ b/spyder/plugins/debugger/widgets/main_widget.py
@@ -416,6 +416,7 @@ def update_actions(self):
                 post_mortem = False
                 executing = False
                 pdb_prompt = False
+                is_debugging = False
             else:
                 search_action.setEnabled(True)
                 search_action.setChecked(widget.finder_is_visible())
@@ -423,6 +424,7 @@ def update_actions(self):
                 sw = widget.shellwidget
                 executing = sw._executing
                 pdb_prompt = sw.is_waiting_pdb_input()
+                is_debugging = sw.is_debugging()
 
             enter_debug_action.setEnabled(post_mortem and not executing)
             interrupt_and_debug_action.setEnabled(executing)
@@ -438,7 +440,8 @@ def update_actions(self):
                 action = self.get_action(action_name)
                 action.setEnabled(pdb_prompt)
 
-            self._set_visible_control_debugger_buttons(pdb_prompt)
+            self._set_visible_control_debugger_buttons(pdb_prompt or
+                                                       is_debugging)
 
             rows = self.breakpoints_table.selectionModel().selectedRows()
             initial_row = rows[0] if rows else None


Code review comments:
diff_hunk: @@ -438,7 +440,8 @@ def update_actions(self):
                 action = self.get_action(action_name)
                 action.setEnabled(pdb_prompt)
 
-            self._set_visible_control_debugger_buttons(pdb_prompt)
+            self._set_visible_control_debugger_buttons(pdb_prompt or
+                                                       is_debugging)
path: spyder/plugins/debugger/widgets/main_widget.py
text: @user1:
```suggestion
            self._set_visible_control_debugger_buttons(
                pdb_prompt or is_debugging
            )
```

Small style suggestion.