Align controls to same height with vertical separator
- Move analysis controls (period + button) to horizontal layout - Add vertical separator (|) between database and analysis sections - Align all controls at the same height for cleaner appearance - Remove unnecessary nested vertical layouts - Database controls on left, analysis controls on right - Proper visual separation while maintaining compact layout
This commit is contained in:
+15
-11
@@ -375,9 +375,10 @@ class MainWindow(QMainWindow):
|
|||||||
controlsGroup = QGroupBox("Controls")
|
controlsGroup = QGroupBox("Controls")
|
||||||
controlsLayout = QHBoxLayout()
|
controlsLayout = QHBoxLayout()
|
||||||
|
|
||||||
# Database controls
|
# Database controls - left side
|
||||||
dbControlsLayout = QVBoxLayout()
|
dbControlsLayout = QVBoxLayout()
|
||||||
|
|
||||||
|
# Database buttons in horizontal layout
|
||||||
dbButtonsLayout = QHBoxLayout()
|
dbButtonsLayout = QHBoxLayout()
|
||||||
addDbButton = QPushButton("Add Database File")
|
addDbButton = QPushButton("Add Database File")
|
||||||
addDbButton.clicked.connect(self.addDatabaseFile)
|
addDbButton.clicked.connect(self.addDatabaseFile)
|
||||||
@@ -386,6 +387,7 @@ class MainWindow(QMainWindow):
|
|||||||
dbButtonsLayout.addWidget(addDbButton)
|
dbButtonsLayout.addWidget(addDbButton)
|
||||||
dbButtonsLayout.addWidget(clearDbButton)
|
dbButtonsLayout.addWidget(clearDbButton)
|
||||||
|
|
||||||
|
# Database status label
|
||||||
self.dbPathsLabel = QLabel("No database files selected")
|
self.dbPathsLabel = QLabel("No database files selected")
|
||||||
self.dbPathsLabel.setMaximumWidth(200)
|
self.dbPathsLabel.setMaximumWidth(200)
|
||||||
self.dbPathsLabel.setWordWrap(True)
|
self.dbPathsLabel.setWordWrap(True)
|
||||||
@@ -393,27 +395,29 @@ class MainWindow(QMainWindow):
|
|||||||
dbControlsLayout.addLayout(dbButtonsLayout)
|
dbControlsLayout.addLayout(dbButtonsLayout)
|
||||||
dbControlsLayout.addWidget(self.dbPathsLabel)
|
dbControlsLayout.addWidget(self.dbPathsLabel)
|
||||||
|
|
||||||
# Analyze controls (period + button)
|
# Analysis controls - right side
|
||||||
analyzeControlsLayout = QVBoxLayout()
|
analyzeControlsLayout = QHBoxLayout()
|
||||||
|
analyzeControlsLayout.addWidget(QLabel("Time period:"))
|
||||||
|
|
||||||
# Time period and analyze button in same row
|
|
||||||
analyzeRowLayout = QHBoxLayout()
|
|
||||||
analyzeRowLayout.addWidget(QLabel("Time period:"))
|
|
||||||
self.periodComboBox = QComboBox()
|
self.periodComboBox = QComboBox()
|
||||||
self.periodComboBox.addItems(["All time", "Last month", "Last year"])
|
self.periodComboBox.addItems(["All time", "Last month", "Last year"])
|
||||||
self.periodComboBox.setCurrentText("All time")
|
self.periodComboBox.setCurrentText("All time")
|
||||||
analyzeRowLayout.addWidget(self.periodComboBox)
|
analyzeControlsLayout.addWidget(self.periodComboBox)
|
||||||
|
|
||||||
self.analyzeButton = QPushButton("Analyze Transfers")
|
self.analyzeButton = QPushButton("Analyze Transfers")
|
||||||
self.analyzeButton.clicked.connect(self.analyzeTransfers)
|
self.analyzeButton.clicked.connect(self.analyzeTransfers)
|
||||||
analyzeRowLayout.addWidget(self.analyzeButton)
|
analyzeControlsLayout.addWidget(self.analyzeButton)
|
||||||
|
|
||||||
analyzeControlsLayout.addLayout(analyzeRowLayout)
|
# Create a frame for the vertical separator
|
||||||
|
separator = QLabel("|")
|
||||||
|
separator.setAlignment(Qt.AlignCenter)
|
||||||
|
separator.setStyleSheet("color: gray; font-size: 16px; padding: 0 10px;")
|
||||||
|
|
||||||
# Add all sections to main layout
|
# Add all sections to main layout with proper alignment
|
||||||
controlsLayout.addLayout(dbControlsLayout)
|
controlsLayout.addLayout(dbControlsLayout)
|
||||||
controlsLayout.addStretch()
|
controlsLayout.addWidget(separator)
|
||||||
controlsLayout.addLayout(analyzeControlsLayout)
|
controlsLayout.addLayout(analyzeControlsLayout)
|
||||||
|
controlsLayout.addStretch()
|
||||||
|
|
||||||
# Hidden variables to replace checkboxes
|
# Hidden variables to replace checkboxes
|
||||||
self.uploadsCheckBox = True
|
self.uploadsCheckBox = True
|
||||||
|
|||||||
Reference in New Issue
Block a user