Fix wizard: step bar text clipped + black background in content area
_StepBar: - setFixedHeight(40→54) — label text (cy+r+4=34, h=16) ya no se recorta - cy fijado a 20 en lugar de h//2 para dejar margen inferior al texto - drawText rect ampliado a 112×16 para labels más largos (esp. "Refinamiento") - setStyleSheet background:_PANEL para que coincida con el header NewShipWizard content area: - QStackedWidget: stylesheet "background:_BG" para el widget contenedor - Cada página de paso: autoFillBackground=True + palette Window→_BG (palette en vez de setStyleSheet evita que el fondo cascadee a los hijos QDoubleSpinBox/QLineEdit que tienen sus propios estilos inline) - QPalette añadido al import de PySide6.QtGui 282 tests, 0 fallos. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,7 @@ from typing import Optional
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from PySide6.QtCore import Qt, QSize, Signal
|
from PySide6.QtCore import Qt, QSize, Signal
|
||||||
from PySide6.QtCore import QPointF
|
from PySide6.QtCore import QPointF
|
||||||
from PySide6.QtGui import QColor, QFont, QPainter, QPen, QBrush, QPolygonF
|
from PySide6.QtGui import QColor, QFont, QPainter, QPalette, QPen, QBrush, QPolygonF
|
||||||
from PySide6.QtWidgets import (
|
from PySide6.QtWidgets import (
|
||||||
QApplication,
|
QApplication,
|
||||||
QDialog,
|
QDialog,
|
||||||
@@ -688,11 +688,21 @@ class NewShipWizard(QDialog):
|
|||||||
|
|
||||||
# ── Contenido (stackedWidget) ─────────────────────────────────
|
# ── Contenido (stackedWidget) ─────────────────────────────────
|
||||||
self._stack = QStackedWidget()
|
self._stack = QStackedWidget()
|
||||||
|
self._stack.setStyleSheet(f"QStackedWidget {{ background: {_BG}; }}")
|
||||||
|
|
||||||
self._s1 = _StepDimensions()
|
self._s1 = _StepDimensions()
|
||||||
self._s2 = _StepFamily()
|
self._s2 = _StepFamily()
|
||||||
self._s3 = _StepRefine()
|
self._s3 = _StepRefine()
|
||||||
self._s4 = _StepPreview()
|
self._s4 = _StepPreview()
|
||||||
|
|
||||||
|
# autoFillBackground + palette → rellena el fondo sin cascadear a hijos
|
||||||
|
_bg_color = QColor(_BG)
|
||||||
|
for page in (self._s1, self._s2, self._s3, self._s4):
|
||||||
|
page.setAutoFillBackground(True)
|
||||||
|
_pal = QPalette(page.palette())
|
||||||
|
_pal.setColor(QPalette.ColorRole.Window, _bg_color)
|
||||||
|
page.setPalette(_pal)
|
||||||
|
|
||||||
self._stack.addWidget(self._s1)
|
self._stack.addWidget(self._s1)
|
||||||
self._stack.addWidget(self._s2)
|
self._stack.addWidget(self._s2)
|
||||||
self._stack.addWidget(self._s3)
|
self._stack.addWidget(self._s3)
|
||||||
@@ -817,7 +827,8 @@ class _StepBar(QWidget):
|
|||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self._labels = labels
|
self._labels = labels
|
||||||
self._active = 0
|
self._active = 0
|
||||||
self.setFixedHeight(40)
|
self.setFixedHeight(54)
|
||||||
|
self.setStyleSheet(f"background:{_PANEL};")
|
||||||
|
|
||||||
def set_active(self, idx: int) -> None:
|
def set_active(self, idx: int) -> None:
|
||||||
self._active = idx
|
self._active = idx
|
||||||
@@ -832,7 +843,7 @@ class _StepBar(QWidget):
|
|||||||
|
|
||||||
for i, lbl in enumerate(self._labels):
|
for i, lbl in enumerate(self._labels):
|
||||||
cx = int(step_w * i + step_w / 2)
|
cx = int(step_w * i + step_w / 2)
|
||||||
cy = h // 2
|
cy = 20 # círculo en la franja superior; deja ~22px debajo para el texto
|
||||||
|
|
||||||
# Línea de conexión
|
# Línea de conexión
|
||||||
if i > 0:
|
if i > 0:
|
||||||
@@ -869,7 +880,7 @@ class _StepBar(QWidget):
|
|||||||
|
|
||||||
# Texto del paso
|
# Texto del paso
|
||||||
p.setPen(QPen(QColor(_ACCENT if i == self._active else _MUTED)))
|
p.setPen(QPen(QColor(_ACCENT if i == self._active else _MUTED)))
|
||||||
p.drawText(cx - 50, cy + r + 2, 100, 14,
|
p.drawText(cx - 56, cy + r + 4, 112, 16,
|
||||||
Qt.AlignmentFlag.AlignCenter, lbl)
|
Qt.AlignmentFlag.AlignCenter, lbl)
|
||||||
|
|
||||||
p.end()
|
p.end()
|
||||||
|
|||||||
Reference in New Issue
Block a user