Skip to content

Commit

Permalink
Preferences: Set min height for config pages
Browse files Browse the repository at this point in the history
- This prevents text from being clipped when there's not enough space
available.
- Also, fix similar error in the editor config page.
  • Loading branch information
ccordoba12 committed Oct 21, 2023
1 parent 4883542 commit 1d83832
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion spyder/plugins/editor/confpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class EditorConfigPage(PluginConfigPage, SpyderConfigurationObserver):
def __init__(self, plugin, parent):
PluginConfigPage.__init__(self, plugin, parent)
SpyderConfigurationObserver.__init__(self)

self.removetrail_box = None
self.add_newline_box = None
self.remove_trail_newline_box = None
Expand All @@ -43,6 +44,9 @@ def get_icon(self):
return ima.icon('edit')

def setup_page(self):
# We need to set this so that the text of some options is not clipped
self.setMinimumHeight(670)

newcb = self.create_checkbox

# --- Display tab ---
Expand Down Expand Up @@ -306,7 +310,7 @@ def enable_tabwidth_spin(index):
"mixed end-of-line characters (this may "
"raise syntax errors in the consoles "
"on Windows platforms), Spyder may fix the "
"file automatically.<br><br>"))
"file automatically."))
eol_label.setWordWrap(True)
check_eol_box = newcb(_("Fix automatically and show warning "
"message box"),
Expand Down
6 changes: 4 additions & 2 deletions spyder/plugins/preferences/widgets/config_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class SpyderConfigPage(ConfigPage, ConfigAccessMixin):
"""Plugin configuration dialog box page widget"""
CONF_SECTION = None
MAX_WIDTH = 620
MIN_HEIGHT = 550

def __init__(self, parent):
ConfigPage.__init__(
Expand All @@ -170,12 +171,13 @@ def __init__(self, parent):
self.main = parent.main
self.tabs = None

# Maximum width
# Set dimensions
self.setMaximumWidth(self.MAX_WIDTH)
self.setMinimumHeight(self.MIN_HEIGHT)

def sizeHint(self):
"""Default page size."""
return QSize(self.MAX_WIDTH, 400)
return QSize(self.MAX_WIDTH, self.MIN_HEIGHT)

def _apply_settings_tabs(self, options):
if self.tabs is not None:
Expand Down

0 comments on commit 1d83832

Please sign in to comment.