Background cross color is now a setting in the config file

This allows users to change the color of the background grid e.g if they
are using a projector or other low-contrast display.

The settings are in the `Board` category and are named `CrossColorDarkBackground`
and `CrossColorLightBackground`. They take strings representing the
color in any of the following formats:

- #RGB (Hexadecimal digits)
- #RRGGBB
- #AARRGGBB
- #RRRGGGBBB
- #RRRRGGGGBBBB
- Any SVG color keyword name (as defined by W3C)
preferencesAboutTextFull
Craig Watson 8 years ago
parent 42827b2a46
commit 2fd0cc87b1
  1. 4
      src/board/UBBoardView.cpp
  2. 7
      src/core/UBSettings.cpp
  3. 5
      src/core/UBSettings.h
  4. 4
      src/domain/UBGraphicsScene.cpp

@ -1597,9 +1597,9 @@ void UBBoardView::drawBackground (QPainter *painter, const QRectF &rect)
QColor bgCrossColor;
if (darkBackground)
bgCrossColor = UBSettings::crossDarkBackground;
bgCrossColor = QColor(UBSettings::settings()->boardCrossColorDarkBackground->get().toString());
else
bgCrossColor = UBSettings::crossLightBackground;
bgCrossColor = QColor(UBSettings::settings()->boardCrossColorLightBackground->get().toString());
if (transform ().m11 () < 1.0)
{

@ -71,9 +71,6 @@ const char *UBSettings::sDefaultFontFamily = "Arial";
QString UBSettings::currentFileVersion = "4.8.0";
QColor UBSettings::crossDarkBackground = QColor(44, 44, 44, 200);
QColor UBSettings::crossLightBackground = QColor(165, 225, 255);
QBrush UBSettings::eraserBrushDarkBackground = QBrush(QColor(127, 127, 127, 80));
QBrush UBSettings::eraserBrushLightBackground = QBrush(QColor(255, 255, 255, 30));
@ -272,6 +269,10 @@ void UBSettings::init()
pageSize = new UBSetting(this, "Board", "DefaultPageSize", documentSizes.value(DocumentSizeRatio::Ratio4_3));
boardCrossColorDarkBackground = new UBSetting(this, "Board", "CrossColorDarkBackground", "#C82C2C2C");
boardCrossColorLightBackground = new UBSetting(this, "Board", "CrossColorLightBackground", "#A5FFFF");
QStringList penLightBackgroundColors;
penLightBackgroundColors << "#000000" << "#FF0000" <<"#004080" << "#008000" << "#FFDD00" << "#C87400" << "#800040" << "#008080" << "#5F2D0A" << "#FFFFFF";
boardPenLightBackgroundColors = new UBColorListSetting(this, "Board", "PenLightBackgroundColors", penLightBackgroundColors, 1.0);

@ -160,8 +160,6 @@ class UBSettings : public QObject
static int pointerDiameter;
static int boardMargin;
static QColor crossDarkBackground;
static QColor crossLightBackground;
static QColor paletteColor;
static QColor opaquePaletteColor;
@ -275,6 +273,9 @@ class UBSettings : public QObject
UBSetting* featureSliderPosition;
UBSetting* boardCrossColorDarkBackground;
UBSetting* boardCrossColorLightBackground;
UBColorListSetting* boardPenLightBackgroundColors;
UBColorListSetting* boardPenLightBackgroundSelectedColors;

@ -2391,9 +2391,9 @@ void UBGraphicsScene::drawBackground(QPainter *painter, const QRectF &rect)
QColor bgCrossColor;
if (darkBackground)
bgCrossColor = UBSettings::crossDarkBackground;
bgCrossColor = QColor(UBSettings::settings()->boardCrossColorDarkBackground->get().toString());
else
bgCrossColor = UBSettings::crossLightBackground;
bgCrossColor = QColor(UBSettings::settings()->boardCrossColorLightBackground->get().toString());
if (mZoomFactor < 1.0)
{
int alpha = 255 * mZoomFactor / 2;

Loading…
Cancel
Save