Give the editor a visual identity and a real levels control

The panel now uses the same colours the page is drawn with, on dark
chrome so the scan is the brightest thing on screen. Levels move from two
anonymous sliders to the scan's own histogram with draggable black and
white points and a tone strip, since getting them wrong is the one
mistake that only shows up on the tablet. A page rail replaces the
stepper and carries each page's slice count; export is pinned below the
scroll instead of below the fold; marker types read as prose.
This commit is contained in:
Esa Kataja
2026-07-29 15:39:24 +03:00
parent cdf37302d7
commit 68e41c2470
6 changed files with 493 additions and 100 deletions
+7 -6
View File
@@ -31,7 +31,7 @@ from PySide6.QtWidgets import (
QWidget,
)
from . import lilypond
from . import lilypond, panel as ui
from .detect import staff_height
from .editor import section
from .project import Project, Replacement, Voice
@@ -141,7 +141,7 @@ class EngraveWindow(QDialog):
box = QVBoxLayout(panel)
box.setContentsMargins(0, 0, 0, 0)
heading = QLabel(title)
heading.setStyleSheet("font-weight: 700; color: #808080;")
heading.setStyleSheet(ui.HEADING.replace("QToolButton", "QLabel"))
box.addWidget(heading)
view = label or QLabel()
@@ -196,7 +196,7 @@ class EngraveWindow(QDialog):
box.addLayout(top)
voices_label = QLabel("Voices")
voices_label.setStyleSheet("font-weight: 700; color: #808080;")
voices_label.setStyleSheet(ui.HEADING.replace("QToolButton", "QLabel"))
box.addWidget(voices_label)
self.voice_box = QVBoxLayout()
@@ -211,6 +211,7 @@ class EngraveWindow(QDialog):
remove = QPushButton("Remove last voice")
remove.clicked.connect(self._remove_voice)
render = QPushButton("Render (Ctrl+↵)")
render.setProperty("role", "primary")
render.clicked.connect(self.render)
drop = QPushButton("Discard replacement")
drop.clicked.connect(self._discard)
@@ -229,7 +230,7 @@ class EngraveWindow(QDialog):
self.generated = QPlainTextEdit()
self.generated.setReadOnly(True)
self.generated.setMaximumHeight(220)
self.generated.setStyleSheet("color: #808080;")
self.generated.setStyleSheet(f"color: {ui.GRAPHITE};")
raw.addWidget(self.generated)
self._refresh_source()
return panel
@@ -287,13 +288,13 @@ class EngraveWindow(QDialog):
def render(self) -> None:
source = self._source()
self.status.setStyleSheet("color: #808080;")
self.status.setStyleSheet(f"color: {ui.GRAPHITE};")
self.status.setText("rendering…")
self.repaint()
try:
image = lilypond.render(source)
except lilypond.LilypondError as error:
self.status.setStyleSheet("color: #c0392b;")
self.status.setStyleSheet(f"color: {ui.PROOF};")
self.status.setText(str(error)[-600:])
return