mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-07-01 04:16:26 +00:00
wip: ScoreEditor
This commit is contained in:
@ -15,6 +15,7 @@ from PySide6.QtWidgets import (
|
||||
|
||||
from ui.implements.components.chartSelector import ChartSelector
|
||||
|
||||
from ..utils import keepWidgetInScreen
|
||||
from .base import TextSegmentDelegate
|
||||
|
||||
|
||||
@ -164,6 +165,8 @@ class ChartDelegate(TextSegmentDelegate):
|
||||
def updateEditorGeometry(self, editor: QWidget, option, index: QModelIndex) -> None:
|
||||
editor.move(editor.pos() + option.rect.topLeft())
|
||||
editor.setMaximumWidth(option.rect.width())
|
||||
|
||||
keepWidgetInScreen(editor)
|
||||
|
||||
def setEditorData(self, editor: ChartSelectorDelegateWrapper, index: QModelIndex):
|
||||
if self.checkIsEditor(editor) and isinstance(self.getChart(index), Chart):
|
||||
|
@ -27,11 +27,11 @@ class ScoreEditorDelegateWrapper(ScoreEditor):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
self.hLine = QFrame(self)
|
||||
self.hLine.setFrameShape(QFrame.Shape.HLine)
|
||||
self.hLine.setFrameShadow(QFrame.Shadow.Plain)
|
||||
self.hLine.setFixedHeight(5)
|
||||
self.formLayout.insertRow(0, self.hLine)
|
||||
# self.hLine = QFrame(self)
|
||||
# self.hLine.setFrameShape(QFrame.Shape.HLine)
|
||||
# self.hLine.setFrameShadow(QFrame.Shadow.Plain)
|
||||
# self.hLine.setFixedHeight(5)
|
||||
# self.gridLayout.addWidget(self.hLine, self.gridLayout.rowCount(), 0, -1, -1)
|
||||
|
||||
self.delegateHeader = QWidget(self)
|
||||
self.delegateHeaderHBoxLayout = QHBoxLayout(self.delegateHeader)
|
||||
@ -47,7 +47,9 @@ class ScoreEditorDelegateWrapper(ScoreEditor):
|
||||
self.editorDiscardButton.clicked.connect(self.rejected)
|
||||
self.delegateHeaderHBoxLayout.addWidget(self.editorDiscardButton)
|
||||
|
||||
self.formLayout.insertRow(0, self.delegateHeader)
|
||||
self.gridLayout.addWidget(
|
||||
self.delegateHeader, self.gridLayout.rowCount(), 0, -1, -1
|
||||
)
|
||||
|
||||
def setText(self, score: Score, _extra: str = None):
|
||||
text = "Editing "
|
||||
|
Reference in New Issue
Block a user