Polish Acrobat-style interface

This commit is contained in:
2026-06-29 22:40:41 +08:00
parent a8d8885a3f
commit 6d22762279
6 changed files with 177 additions and 35 deletions
+15 -6
View File
@@ -5,6 +5,7 @@ from collections.abc import Iterable
from PySide6.QtGui import QAction
from PySide6.QtWidgets import (
QFrame,
QLabel,
QLineEdit,
QListWidget,
QPushButton,
@@ -21,17 +22,22 @@ class ToolSection(QFrame):
self.setObjectName("toolSection")
layout = QVBoxLayout(self)
layout.setContentsMargins(8, 8, 8, 8)
layout.setSpacing(6)
layout.setContentsMargins(10, 10, 10, 10)
layout.setSpacing(5)
title_button = QPushButton(title)
title_button.setObjectName("toolSectionTitle")
title_button.setEnabled(False)
layout.addWidget(title_button)
title_label = QLabel(title)
title_label.setObjectName("toolSectionTitle")
layout.addWidget(title_label)
for action in actions:
button = QPushButton(action.text())
button.setObjectName("rightToolButton")
button.setToolTip(action.toolTip() or action.text())
button.setFlat(True)
button.setCheckable(action.isCheckable())
button.setChecked(action.isChecked())
if action.isCheckable():
action.toggled.connect(button.setChecked)
button.clicked.connect(action.trigger)
button.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
layout.addWidget(button)
@@ -42,12 +48,15 @@ class RightToolsPanel(QWidget):
super().__init__()
self.search_box = search_box
self.search_results = search_results
self.setObjectName("rightToolsPanel")
self.sections_container = QWidget()
self.sections_container.setObjectName("rightToolsSections")
self.sections_layout = QVBoxLayout(self.sections_container)
self.sections_layout.setContentsMargins(0, 0, 0, 0)
self.sections_layout.setSpacing(8)
scroll = QScrollArea()
scroll.setObjectName("rightToolsScroll")
scroll.setWidgetResizable(True)
scroll.setFrameShape(QFrame.Shape.NoFrame)
scroll.setWidget(self.sections_container)