Repository: spyder-ide/spyder

Issue:
Run configuration per file dialog doesn't display complete
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [ ] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [ ] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [ ] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [ ] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [ ] Tried basic troubleshooting (if a bug/error)
    * [ ] Restarted Spyder
    * [ ] Reset preferences with ``spyder --reset``
    * [ ] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [ ] Tried the other applicable steps from the Troubleshooting Guide
* [ ] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description
Run configuration per file dialog is too tall for my screen and I can't scroll down to see the complete information on it.

![Screen Shot 2020-08-14 at 1 20 45 AM](https://user-images.githubusercontent.com/18587879/90219854-96b91400-ddcc-11ea-919e-4ab1c1dc5815.png)

I suggest fixing the max height of the dialog to the height of the Spyder's window and adding a scroll bar when it's not fully displayed. 

(It might be a MacOS problem)


### What steps reproduce the problem?

1. 
2. 
3. 

### What is the expected output? What do you see instead?



### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 4.1.4
* Python version: 
* Qt version: 
* PyQt version: 
* Operating System name/version: macOS Catalina 

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:
@steff456 can you take a look at this one?
Thanks @juanis2112 for reporting this! Could you let us know what's your screen size?

Also, I think we should discuss this with Isabella in our next meeting. I don't know if adding a scrollbar to the dialog is the best option in this case and I'm not sure how to reduce the dialog's height.

What do you think @juanis2112 and @steff456?

Resolving patch:
diff --git a/spyder/preferences/runconfig.py b/spyder/preferences/runconfig.py
--- a/spyder/preferences/runconfig.py
+++ b/spyder/preferences/runconfig.py
@@ -15,8 +15,8 @@
 from qtpy.QtWidgets import (QButtonGroup, QCheckBox, QComboBox, QDialog,
                             QDialogButtonBox, QFrame, QGridLayout, QGroupBox,
                             QHBoxLayout, QLabel, QLineEdit, QMessageBox,
-                            QPushButton, QRadioButton, QSizePolicy,
-                            QStackedWidget, QVBoxLayout, QWidget)
+                            QPushButton, QRadioButton, QScrollArea,
+                            QSizePolicy, QStackedWidget, QVBoxLayout, QWidget)
 
 # Local imports
 from spyder.config.base import _
@@ -357,6 +357,7 @@ def add_widgets(self, *widgets_or_spacings):
                 layout.addSpacing(widget_or_spacing)
             else:
                 layout.addWidget(widget_or_spacing)
+        return layout
 
     def add_button_box(self, stdbtns):
         """Create dialog button box and add it to the dialog layout"""
@@ -399,7 +400,10 @@ def setup(self, fname):
         self.filename = fname
         self.runconfigoptions = RunConfigOptions(self)
         self.runconfigoptions.set(RunConfiguration(fname).get())
-        self.add_widgets(self.runconfigoptions)
+        scrollarea = QScrollArea(self)
+        scrollarea.setWidget(self.runconfigoptions)
+        scrollarea.setMinimumWidth(560)
+        self.add_widgets(scrollarea)
         self.add_button_box(QDialogButtonBox.Cancel)
         self.setWindowTitle(_("Run settings for %s") % osp.basename(fname))
 
@@ -459,7 +463,15 @@ def setup(self, fname):
         self.combo.currentIndexChanged.connect(self.stack.setCurrentIndex)
         self.combo.setCurrentIndex(index)
 
-        self.add_widgets(combo_label, self.combo, 10, self.stack)
+        layout = self.add_widgets(combo_label, self.combo, 10, self.stack)
+        widget_dialog = QWidget()
+        widget_dialog.setLayout(layout)
+        scrollarea = QScrollArea(self)
+        scrollarea.setWidget(widget_dialog)
+        scrollarea.setMinimumWidth(600)
+        scroll_layout = QVBoxLayout()
+        scroll_layout.addWidget(scrollarea)
+        self.setLayout(scroll_layout)
         self.add_button_box(QDialogButtonBox.Ok|QDialogButtonBox.Cancel)
 
         self.setWindowTitle(_("Run configuration per file"))


Test patch: