Skip to content

Commit

Permalink
ShortcutsSummary: Use a ScrollArea to avoid the dialog to be greater …
Browse files Browse the repository at this point in the history
…than the screen.
  • Loading branch information
rlaverde committed May 10, 2017
1 parent 25df8bb commit eda8cfc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions spyder/widgets/shortcutssummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from qtpy.QtCore import Qt
from qtpy.QtGui import QFont
from qtpy.QtWidgets import (QDialog, QLabel, QGridLayout, QGroupBox,
QVBoxLayout, QHBoxLayout, QDesktopWidget)
QVBoxLayout, QHBoxLayout, QDesktopWidget,
QScrollArea, QWidget)

# Local imports
from spyder.config.base import _
Expand Down Expand Up @@ -119,16 +120,25 @@ def __init__(self, parent=None):
column_layout.addStretch() # avoid lasts sections to appear too big
columns_layout.addLayout(column_layout)

# Scroll widget
self.scroll_widget = QWidget()
self.scroll_widget.setLayout(columns_layout)
self.scroll_area = QScrollArea()
self.scroll_area.setWidget(self.scroll_widget)

# widget setup
self.setWindowFlags(Qt.FramelessWindowHint)
self.setWindowOpacity(0.95)

# layout
self._layout = QVBoxLayout()
self._layout.addWidget(title_label)
self._layout.addLayout(columns_layout)

self._layout.addWidget(self.scroll_area)
self.setLayout(self._layout)

self.setGeometry(0, 0, width, height)

def get_screen_resolution(self):
"""Return the screen resolution of the primary screen."""
widget = QDesktopWidget()
Expand Down

0 comments on commit eda8cfc

Please sign in to comment.