Skip to content

Commit

Permalink
Fix progress bar legend getting cut when in progress
Browse files Browse the repository at this point in the history
This commit fixes the issue where the legend bar is being pushed around when the loading bar changes visiblity.
  • Loading branch information
jonathan-eq committed Oct 21, 2024
1 parent 9a06e99 commit cc24a89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ert/gui/simulation/view/progress_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def __init__(self) -> None:
self._waiting_progress_bar = QProgressBar(self)
self._waiting_progress_bar.setRange(0, 0)
self._waiting_progress_bar.setFixedHeight(30)
waiting_progress_bar_size_policy = self._waiting_progress_bar.sizePolicy()
waiting_progress_bar_size_policy.setRetainSizeWhenHidden(True)
self._waiting_progress_bar.setSizePolicy(waiting_progress_bar_size_policy)
self._vertical_layout.addWidget(self._waiting_progress_bar)

self._progress_frame = QFrame(self)
Expand All @@ -52,6 +55,9 @@ def __init__(self) -> None:

for state, color in REAL_STATE_TO_COLOR.items():
label = QLabel(self)
label_size_policy = label.sizePolicy()
label_size_policy.setRetainSizeWhenHidden(True)
label.setSizePolicy(label_size_policy)
label.setVisible(False)
label.setObjectName(f"progress_{state}")
label.setStyleSheet(f"background-color : {QColor(*color).name()}")
Expand Down

0 comments on commit cc24a89

Please sign in to comment.