fix graph and white background added

This commit is contained in:
Ayzen
2026-10-15 14:46:06 +03:00
parent 5102ed751c
commit 9a9b8ce5c7
35 changed files with 730 additions and 463 deletions
+11 -7
View File
@@ -1,11 +1,14 @@
"""Application-wide Qt palette and stylesheet configuration."""
"""Application-wide Qt palette, stylesheet and plot colors."""
from __future__ import annotations
import pyqtgraph as pg
from PyQt6.QtGui import QColor, QPalette
from PyQt6.QtWidgets import QApplication, QStyleFactory
PLOT_BACKGROUND = "#0f141c"
TEXT_COLOR = "#1f2937"
PLOT_BACKGROUND = "#ffffff"
PLOT_FOREGROUND = TEXT_COLOR # axes, ticks, titles, legends and annotations
_LIGHT_STYLESHEET = """
QGroupBox {
@@ -82,7 +85,8 @@ QLabel#hintLabel {
def apply_light_theme(app: QApplication) -> None:
"""Apply a minimal light theme shared by all windows."""
"""Apply a minimal light theme shared by all windows and plots; call before creating them."""
pg.setConfigOptions(antialias=True, background=PLOT_BACKGROUND, foreground=PLOT_FOREGROUND)
app.setStyle(QStyleFactory.create("Fusion"))
font = app.font()
font.setPointSize(10)
@@ -90,14 +94,14 @@ def apply_light_theme(app: QApplication) -> None:
palette = QPalette()
palette.setColor(QPalette.ColorRole.Window, QColor("#f3f6fb"))
palette.setColor(QPalette.ColorRole.WindowText, QColor("#1f2937"))
palette.setColor(QPalette.ColorRole.WindowText, QColor(TEXT_COLOR))
palette.setColor(QPalette.ColorRole.Base, QColor("#ffffff"))
palette.setColor(QPalette.ColorRole.AlternateBase, QColor("#eef3f8"))
palette.setColor(QPalette.ColorRole.ToolTipBase, QColor("#ffffff"))
palette.setColor(QPalette.ColorRole.ToolTipText, QColor("#1f2937"))
palette.setColor(QPalette.ColorRole.Text, QColor("#1f2937"))
palette.setColor(QPalette.ColorRole.ToolTipText, QColor(TEXT_COLOR))
palette.setColor(QPalette.ColorRole.Text, QColor(TEXT_COLOR))
palette.setColor(QPalette.ColorRole.Button, QColor("#f8fafc"))
palette.setColor(QPalette.ColorRole.ButtonText, QColor("#1f2937"))
palette.setColor(QPalette.ColorRole.ButtonText, QColor(TEXT_COLOR))
palette.setColor(QPalette.ColorRole.BrightText, QColor("#ffffff"))
palette.setColor(QPalette.ColorRole.Link, QColor("#2f7ee6"))
palette.setColor(QPalette.ColorRole.Highlight, QColor("#2f7ee6"))