[tracks] layout tweaks
This commit is contained in:
parent
d6b91c25d2
commit
4ef6143d14
@ -1,6 +1,5 @@
|
||||
import logging
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
from PySide6.QtCore import Qt, QThreadPool, Signal
|
||||
from PySide6.QtGui import QImage, QBrush, QColor
|
||||
@ -37,12 +36,6 @@ class FixTracks(QWidget):
|
||||
self._detectionView = DetectionView()
|
||||
self._detectionView.signals.itemsSelected.connect(self.on_detectionsSelected)
|
||||
self._skeleton = SkeletonWidget()
|
||||
# self._skeleton.setMaximumSize(QSize(400, 400))
|
||||
top_splitter = QSplitter(Qt.Orientation.Horizontal)
|
||||
top_splitter.addWidget(self._detectionView)
|
||||
top_splitter.addWidget(self._skeleton)
|
||||
top_splitter.setStretchFactor(0, 2)
|
||||
top_splitter.setStretchFactor(1, 1)
|
||||
|
||||
self._progress_bar = QProgressBar(self)
|
||||
self._progress_bar.setMaximumHeight(20)
|
||||
@ -61,15 +54,18 @@ class FixTracks(QWidget):
|
||||
self._keypointcombo = QComboBox()
|
||||
self._keypointcombo.currentIndexChanged.connect(self.on_keypointSelected)
|
||||
|
||||
combo_layout = QGridLayout()
|
||||
combo_layout.addWidget(QLabel("Window:"), 0, 0)
|
||||
combo_layout.addWidget(self._windowspinner, 0, 1)
|
||||
combo_layout.addWidget(QLabel("Keypoint:"), 1, 0)
|
||||
combo_layout.addWidget(self._keypointcombo, 1, 1)
|
||||
combo_layout = QHBoxLayout()
|
||||
combo_layout.addWidget(QLabel("Window width:"))
|
||||
combo_layout.addWidget(self._windowspinner)
|
||||
combo_layout.addWidget(QLabel("frames"))
|
||||
combo_layout.addWidget(QLabel("Keypoint:"))
|
||||
combo_layout.addWidget(self._keypointcombo)
|
||||
combo_layout.addItem(QSpacerItem(100, 10, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed))
|
||||
|
||||
timelinebox = QHBoxLayout()
|
||||
timelinebox.addWidget(self._timeline)
|
||||
timelinebox = QVBoxLayout()
|
||||
timelinebox.setSpacing(2)
|
||||
timelinebox.addLayout(combo_layout)
|
||||
timelinebox.addWidget(self._timeline)
|
||||
|
||||
self._controls_widget = SelectionControls()
|
||||
self._controls_widget.assignOne.connect(self.on_assignOne)
|
||||
@ -118,7 +114,8 @@ class FixTracks(QWidget):
|
||||
cntrlBox = QHBoxLayout()
|
||||
cntrlBox.addWidget(self._classifier)
|
||||
cntrlBox.addWidget(self._controls_widget, alignment=Qt.AlignmentFlag.AlignCenter)
|
||||
cntrlBox.addItem(QSpacerItem(300, 100, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Expanding))
|
||||
cntrlBox.addWidget(self._skeleton)
|
||||
cntrlBox.addItem(QSpacerItem(50, 100, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Expanding))
|
||||
|
||||
vbox = QVBoxLayout()
|
||||
vbox.addLayout(timelinebox)
|
||||
@ -128,7 +125,7 @@ class FixTracks(QWidget):
|
||||
container.setLayout(vbox)
|
||||
|
||||
splitter = QSplitter(Qt.Orientation.Vertical)
|
||||
splitter.addWidget(top_splitter)
|
||||
splitter.addWidget(self._detectionView)
|
||||
splitter.addWidget(container)
|
||||
splitter.setStretchFactor(0, 3)
|
||||
splitter.setStretchFactor(1, 1)
|
||||
@ -306,7 +303,10 @@ class FixTracks(QWidget):
|
||||
"""
|
||||
self._currentWindowWidth = value
|
||||
logging.debug("Tracks:OnWindowSizeChanged %i franes", value)
|
||||
self._timeline.setWindowWidth(self._currentWindowWidth / self._maxframes)
|
||||
if self._maxframes == 0:
|
||||
self._timeline.setWindowWidth(self._currentWindowWidth / 2000)
|
||||
else:
|
||||
self._timeline.setWindowWidth(self._currentWindowWidth / self._maxframes)
|
||||
self._controls_widget.setSelectedTracks(None)
|
||||
|
||||
def on_detectionsSelected(self, detections):
|
||||
|
Loading…
Reference in New Issue
Block a user