mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-10 05:30:45 -08:00
Make the list of line checkboxes scrollable.
Copied from Perforce Change: 194172
This commit is contained in:
parent
f62ff53c90
commit
6e27d4f95e
1 changed files with 14 additions and 6 deletions
|
|
@ -374,17 +374,23 @@ class ApplicationWindow(QtWidgets.QMainWindow):
|
|||
shortcut = QtWidgets.QShortcut(QtGui.QKeySequence("Ctrl+W"), self)
|
||||
shortcut.activated.connect(self.close)
|
||||
|
||||
layout = QtWidgets.QHBoxLayout(self._main)
|
||||
main_layout = QtWidgets.QHBoxLayout(self._main)
|
||||
|
||||
self._lines_scroll = QtWidgets.QScrollArea()
|
||||
self._lines_widget = QtWidgets.QWidget()
|
||||
self._lines_scroll.setWidget(self._lines_widget)
|
||||
self._lines_scroll.setWidgetResizable(True)
|
||||
self._lines_scroll.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
|
||||
self._line_checkbox = {}
|
||||
left_panel = QtWidgets.QVBoxLayout()
|
||||
layout.addLayout(left_panel)
|
||||
lines_layout = QtWidgets.QVBoxLayout(self._lines_widget)
|
||||
self._lines = QtWidgets.QVBoxLayout()
|
||||
left_panel.addLayout(self._lines)
|
||||
left_panel.addStretch(1)
|
||||
lines_layout.addLayout(self._lines)
|
||||
lines_layout.addStretch(1)
|
||||
main_layout.addWidget(self._lines_scroll)
|
||||
|
||||
canvas = FigureCanvas(Figure(figsize=(10, 6)))
|
||||
layout.addWidget(canvas)
|
||||
main_layout.addWidget(canvas)
|
||||
self.addToolBar(QtCore.Qt.BottomToolBarArea,
|
||||
NavigationToolbar(canvas, self))
|
||||
|
||||
|
|
@ -411,6 +417,8 @@ class ApplicationWindow(QtWidgets.QMainWindow):
|
|||
self._model.needs_redraw()
|
||||
checkbox.stateChanged.connect(state_changed)
|
||||
checkbox.setStyleSheet(f"color:{line.color}")
|
||||
self._lines_scroll.setMinimumWidth(
|
||||
self._lines_widget.sizeHint().width())
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue