[board] Added grid color to color scheme

Dieser Commit ist enthalten in:
Reinder Feenstra 2025-10-20 10:47:15 +02:00
Ursprung af88d2d774
Commit aa06dc912e
3 geänderte Dateien mit 47 neuen und 45 gelöschten Zeilen

Datei anzeigen

@ -605,7 +605,6 @@ void BoardAreaWidget::paintEvent(QPaintEvent* event)
const QColor backgroundColor50{0x10, 0x10, 0x10, 0x80};
const QColor backgroundColorError50{0xff, 0x00, 0x00, 0x80};
const QColor gridColor{0x40, 0x40, 0x40};
const QColor gridColorHighlight{Qt::white};
const QColor gridColorError{Qt::red};
const int tileSize = getTileSize();
@ -624,7 +623,7 @@ void BoardAreaWidget::paintEvent(QPaintEvent* event)
break;
case BoardAreaGrid::Line:
painter.setPen(gridColor);
painter.setPen(m_colorScheme->grid);
for(int y = viewport.top(); y <= viewport.bottom(); y += gridSize)
painter.drawLine(viewport.left(), y, viewport.right(), y);
for(int x = viewport.left(); x <= viewport.right(); x += gridSize)
@ -632,7 +631,7 @@ void BoardAreaWidget::paintEvent(QPaintEvent* event)
break;
case BoardAreaGrid::Dot:
painter.setPen(gridColor);
painter.setPen(m_colorScheme->grid);
for(int y = viewport.top(); y <= viewport.bottom(); y += gridSize)
for(int x = viewport.left(); x <= viewport.right(); x += gridSize)
painter.drawPoint(x, y);

Datei anzeigen

@ -3,7 +3,7 @@
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2021,2023-2024 Reinder Feenstra
* Copyright (C) 2021-2025 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -23,47 +23,49 @@
#include "boardcolorscheme.hpp"
const BoardColorScheme BoardColorScheme::dark = {
/*.background =*/ {0x10, 0x10, 0x10},
/*.foreground =*/ {0xFF, 0xFF, 0xFF},
/*.track =*/ {0xC0, 0xC0, 0xC0},
/*.trackDisabled =*/ {0x40, 0x40, 0x40},
/*.trackReserved =*/ {Qt::yellow},
/*.trackReservedDisabled =*/ {0x99, 0x99, 0x00},
/*.blockFree =*/ {0x66, 0xC6, 0x66},
/*.blockReserved =*/ {Qt::yellow},
/*.blockOccupied =*/ {0xC6, 0x66, 0x66},
/*.blockUnknown =*/ {0x66, 0x66, 0x66},
/*.blockText =*/ {Qt::black},
/*.sensorFree =*/ {0x66, 0xC6, 0x66},
/*.sensorOccupied =*/ {0xC6, 0x66, 0x66},
/*.sensorIdle =*/ {0x40, 0x40, 0x40},
/*.sensorTriggered =*/ {0x00, 0xBF, 0xFF},
/*.sensorUnknown =*/ {0x10, 0x10, 0x10},
/*.turnoutState =*/ {Qt::blue},
/*.decouplerDeactivated =*/ {0x10, 0x10, 0x10},
/*.decouplerActivated =*/ {0x00, 0xBF, 0xFF},
/*.blockHighlightAlpha =*/ 0.2,
.background = {0x10, 0x10, 0x10},
.foreground = {0xFF, 0xFF, 0xFF},
.grid = {0x40, 0x40, 0x40},
.track = {0xC0, 0xC0, 0xC0},
.trackDisabled = {0x40, 0x40, 0x40},
.trackReserved = {Qt::yellow},
.trackReservedDisabled = {0x99, 0x99, 0x00},
.blockFree = {0x66, 0xC6, 0x66},
.blockReserved = {Qt::yellow},
.blockOccupied = {0xC6, 0x66, 0x66},
.blockUnknown = {0x66, 0x66, 0x66},
.blockText = {Qt::black},
.sensorFree = {0x66, 0xC6, 0x66},
.sensorOccupied = {0xC6, 0x66, 0x66},
.sensorIdle = {0x40, 0x40, 0x40},
.sensorTriggered = {0x00, 0xBF, 0xFF},
.sensorUnknown = {0x10, 0x10, 0x10},
.turnoutState = {Qt::blue},
.decouplerDeactivated = {0x10, 0x10, 0x10},
.decouplerActivated = {0x00, 0xBF, 0xFF},
.blockHighlightAlpha = 0.2,
};
const BoardColorScheme BoardColorScheme::light = {
/*.background =*/ {0xF5, 0xF5, 0xF5},
/*.foreground =*/ {0x00, 0x00, 0x00},
/*.track =*/ {0x00, 0x00, 0x00},
/*.trackDisabled =*/ {0xA0, 0xA0, 0xA0},
/*.trackReserved =*/ {Qt::yellow},
/*.trackReservedDisabled =*/ {0x99, 0x99, 0x00},
/*.blockFree =*/ {0x44, 0xC6, 0x44},
/*.blockReserved =*/ {Qt::yellow},
/*.blockOccupied =*/ {0xC6, 0x44, 0x44},
/*.blockUnknown =*/ {0x88, 0x88, 0x88},
/*.blockText =*/ {Qt::white},
/*.sensorFree =*/ {0x44, 0xC6, 0x44},
/*.sensorOccupied =*/ {0xC6, 0x44, 0x44},
/*.sensorIdle =*/ {0x40, 0x40, 0x40},
/*.sensorTriggered =*/ {0x00, 0xBF, 0xFF},
/*.sensorUnknown =*/ {0x10, 0x10, 0x10},
/*.turnoutState =*/ {Qt::cyan},
/*.decouplerDeactivated =*/ {0xF5, 0xF5, 0xF5},
/*.decouplerActivated =*/ {0x00, 0xBF, 0xFF},
/*.blockHighlightAlpha =*/ 0.3,
.background = {0xF5, 0xF5, 0xF5},
.foreground = {0x00, 0x00, 0x00},
.grid = {0x40, 0x40, 0x40},
.track = {0x00, 0x00, 0x00},
.trackDisabled = {0xA0, 0xA0, 0xA0},
.trackReserved = {Qt::yellow},
.trackReservedDisabled = {0x99, 0x99, 0x00},
.blockFree = {0x44, 0xC6, 0x44},
.blockReserved = {Qt::yellow},
.blockOccupied = {0xC6, 0x44, 0x44},
.blockUnknown = {0x88, 0x88, 0x88},
.blockText = {Qt::white},
.sensorFree = {0x44, 0xC6, 0x44},
.sensorOccupied = {0xC6, 0x44, 0x44},
.sensorIdle = {0x40, 0x40, 0x40},
.sensorTriggered = {0x00, 0xBF, 0xFF},
.sensorUnknown = {0x10, 0x10, 0x10},
.turnoutState = {Qt::cyan},
.decouplerDeactivated = {0xF5, 0xF5, 0xF5},
.decouplerActivated = {0x00, 0xBF, 0xFF},
.blockHighlightAlpha = 0.3,
};

Datei anzeigen

@ -3,7 +3,7 @@
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2021,2023-2024 Reinder Feenstra
* Copyright (C) 2021-2025 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -32,6 +32,7 @@ struct BoardColorScheme
const QColor background;
const QColor foreground;
const QColor grid;
const QColor track;
const QColor trackDisabled;
const QColor trackReserved;