Skip to content
Snippets Groups Projects

Fix program not fitting on low resolution screens

Merged Kien Le requested to merge bug-#180-program_does_not_fit_low_resolution_screens into master
3 unresolved threads
1 file
+ 1
0
Compare changes
  • Side-by-side
  • Inline
@@ -7,6 +7,7 @@ from PySide2.QtWidgets import (
QMainWindow, QWidget, QTextBrowser, QPushButton, QLineEdit, QDateEdit,
QListWidget, QCheckBox, QRadioButton, QMenu, QLabel, QFrame,
QVBoxLayout, QHBoxLayout, QGridLayout, QAbstractItemView, QButtonGroup,
QSplitter,
)
from PySide2.QtWidgets import (
QAction, QActionGroup, QShortcut
@@ -279,7 +280,6 @@ class UIMainWindow(object):
:param main_window: QMainWindow - main GUI for user to interact with
"""
self.main_window = main_window
main_window.resize(1798, 1110)
main_window.setWindowTitle("SOH Station Viewer")
self.central_widget = QWidget(main_window)
main_window.setCentralWidget(self.central_widget)
@@ -294,8 +294,6 @@ class UIMainWindow(object):
self.set_first_row(main_layout)
self.set_second_row(main_layout)
self.tracking_info_text_browser.setFixedHeight(80)
main_layout.addWidget(self.tracking_info_text_browser)
self.create_menu_bar(main_window)
self.connect_signals(main_window)
self.create_shortcuts(main_window)
@@ -352,7 +350,7 @@ class UIMainWindow(object):
left_widget = QWidget(self.central_widget)
h_layout.addWidget(left_widget)
left_widget.setFixedWidth(240)
left_widget.setMinimumHeight(650)
# left_widget.setMinimumHeight(650)
left_layout = QVBoxLayout()
left_layout.setContentsMargins(0, 0, 0, 0)
left_layout.setSpacing(0)
@@ -360,12 +358,22 @@ class UIMainWindow(object):
self.set_control_column(left_layout)
plot_splitter = QSplitter(QtCore.Qt.Orientation.Vertical)
h_layout.addWidget(plot_splitter, 2)
self.plotting_widget = SOHWidget(self.main_window,
self.tracking_info_text_browser,
'SOH',
self.main_window)
plot_splitter.addWidget(self.plotting_widget)
h_layout.addWidget(self.plotting_widget, 2)
self.tracking_info_text_browser.setMinimumHeight(60)
self.tracking_info_text_browser.setMaximumHeight(80)
    • Maintainer

      The default height seem to be the maximum height. Can you set the default height to be the minimum one?

      • Author Developer

        I'll do that. What do you think the maximum height for this should be?

      • Maintainer

        The maximum and minimum heights you set are ok. Just that when I open, it shows the maximum one.

        Another thing I don't know if you think it's important. User can collapse the info which is ok for the normal case. Can we prevent it to be collapsed? If not we may have to think of expanding the text browser when there's warning or error.

      • Maintainer

        I found this

        int index = my_splitter.indexOf(widget);
        my_splitter.setCollapsible(index, false);
      • Please register or sign in to reply
Please register or sign in to reply
plot_splitter.addWidget(self.tracking_info_text_browser)
tracking_browser_idx = plot_splitter.indexOf(
self.tracking_info_text_browser
)
plot_splitter.setCollapsible(tracking_browser_idx, False)
def set_control_column(self, left_layout):
"""
Loading