|
| 1 | +#pragma once |
| 2 | + |
| 3 | +#include <QApplication> |
| 4 | +#include <QString> |
| 5 | + |
| 6 | +// Pure black terminal aesthetic with white borders |
| 7 | +namespace theme { |
| 8 | + |
| 9 | +constexpr const char* Bg = "#000000"; |
| 10 | +constexpr const char* BgPanel = "#0a0a0a"; |
| 11 | +constexpr const char* Border = "#ffffff"; |
| 12 | +constexpr const char* BorderDim = "#333333"; |
| 13 | +constexpr const char* Text = "#ffffff"; |
| 14 | +constexpr const char* TextDim = "#777777"; |
| 15 | +constexpr const char* HeaderBg = "#111111"; |
| 16 | +constexpr const char* Green = "#00ff88"; |
| 17 | +constexpr const char* Red = "#ff4466"; |
| 18 | +constexpr const char* Yellow = "#ffcc00"; |
| 19 | +constexpr const char* Cyan = "#44ddcc"; |
| 20 | + |
| 21 | +constexpr int BorderRadius = 12; |
| 22 | +constexpr int BorderWidth = 2; |
| 23 | +constexpr int FontSize = 15; |
| 24 | +constexpr int FontSizeLg = 18; |
| 25 | +constexpr int FontSizeSm = 13; |
| 26 | + |
| 27 | +// Per-motor colors (indexed 0-5) |
| 28 | +constexpr const char* MotorColors[] = { |
| 29 | + "#5599ff", // blue |
| 30 | + "#cc77ff", // purple |
| 31 | + "#00ff88", // green |
| 32 | + "#ff9944", // orange |
| 33 | + "#ff4466", // red |
| 34 | + "#44ddcc", // teal |
| 35 | +}; |
| 36 | + |
| 37 | +inline void applyGlobalStylesheet(QApplication& app) { |
| 38 | + app.setStyleSheet(QString(R"( |
| 39 | + * { font-family: monospace; font-size: %1px; } |
| 40 | + QMainWindow { background: %2; } |
| 41 | + QLabel { color: %3; font-size: %1px; } |
| 42 | + QPushButton { |
| 43 | + background: %4; color: %3; border: 1px solid %5; |
| 44 | + border-radius: 6px; padding: 10px 16px; font-weight: bold; |
| 45 | + font-size: %1px; |
| 46 | + } |
| 47 | + QPushButton:hover { background: #1a1a1a; border-color: %3; } |
| 48 | + QPushButton:pressed { background: #222222; } |
| 49 | + QComboBox { |
| 50 | + background: %4; color: %3; border: 1px solid %5; |
| 51 | + border-radius: 6px; padding: 8px 12px; font-size: %1px; |
| 52 | + } |
| 53 | + QComboBox::drop-down { border: none; } |
| 54 | + QComboBox QAbstractItemView { |
| 55 | + background: %4; color: %3; selection-background-color: #222222; |
| 56 | + font-size: %1px; |
| 57 | + } |
| 58 | + QDoubleSpinBox, QSpinBox { |
| 59 | + background: %4; color: %3; border: 1px solid %5; |
| 60 | + border-radius: 6px; padding: 8px 12px; font-size: %1px; |
| 61 | + } |
| 62 | + QCheckBox { color: %3; spacing: 8px; font-size: %1px; } |
| 63 | + QCheckBox::indicator { |
| 64 | + width: 18px; height: 18px; border: 1px solid %5; |
| 65 | + border-radius: 3px; background: %4; |
| 66 | + } |
| 67 | + QCheckBox::indicator:checked { background: %3; border-color: %3; } |
| 68 | + QTabWidget::pane { border: 1px solid %5; background: %2; border-radius: 6px; } |
| 69 | + QTabBar::tab { |
| 70 | + background: %4; color: %3; padding: 10px 20px; |
| 71 | + border: 1px solid %5; border-bottom: none; |
| 72 | + border-top-left-radius: 6px; border-top-right-radius: 6px; |
| 73 | + font-size: %1px; |
| 74 | + } |
| 75 | + QTabBar::tab:selected { background: %2; border-color: %3; } |
| 76 | + QTabBar::tab:hover { background: #1a1a1a; } |
| 77 | + QTextEdit { |
| 78 | + background: %4; color: %3; border: none; |
| 79 | + font-family: monospace; font-size: %6px; |
| 80 | + selection-background-color: #333333; |
| 81 | + } |
| 82 | + )") |
| 83 | + .arg(FontSize).arg(Bg).arg(Text).arg(BgPanel).arg(BorderDim).arg(FontSizeSm)); |
| 84 | +} |
| 85 | + |
| 86 | +} // namespace theme |
0 commit comments