aboutsummaryrefslogtreecommitdiff
path: root/gui/split_view_layout.py
blob: ef0a14c2a4d6f545967530d71ee06a42f636ad8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
from PyQt6.QtGui import *
from PyQt6.QtWidgets import *
from PyQt6.QtCore import Qt

class SplitViewLayout(QGridLayout):
  def _setWidget(self, column: int, w: QWidget):
    self.addWidget(w, 0, column, Qt.AlignmentFlag.AlignTop | Qt.AlignmentFlag.AlignLeft)

    return

  def leftWidget(self, w: QWidget):
    self._setWidget(0, w)

  def rightWidget(self, w: QWidget):
    self._setWidget(1, w)

  def __init__(self, parent=None):
    super(SplitViewLayout, self).__init__(parent)
    self.setColumnStretch(0, 1)
    self.setColumnMinimumWidth(0, 300)
    self.setColumnStretch(1, 0)
    self.setColumnMinimumWidth(1, 400)