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

class SplitViewLayout(QGridLayout):
  def leftWidget(self, w: QWidget):
    self.addWidget(w, 0, 0)

  def rightWidget(self, w: QWidget):
    self.addWidget(w, 0, 1, Qt.AlignmentFlag.AlignTop | Qt.AlignmentFlag.AlignLeft)

  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)