mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:13:25 +00:00
Make red ceiling work
The existing code for toggling the DC reported ceiling in red or "surface color" clearly had never been tested. This seems to create a reasonably attractive implementation - not exactly what we had in the past, but good enough. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a3aacfc6c2
commit
e5967dd193
4 changed files with 12 additions and 3 deletions
1
color.h
1
color.h
|
@ -51,6 +51,7 @@
|
||||||
|
|
||||||
// Yellows / BROWNS
|
// Yellows / BROWNS
|
||||||
#define SPRINGWOOD1 QColor::fromRgbF(0.95, 0.95, 0.9, 1)
|
#define SPRINGWOOD1 QColor::fromRgbF(0.95, 0.95, 0.9, 1)
|
||||||
|
#define SPRINGWOOD1_MED_TRANS QColor::fromRgbF(0.95, 0.95, 0.9, 0.5)
|
||||||
#define BROOM1_LOWER_TRANS QColor::fromRgbF(1.0, 1.0, 0.1, 0.9)
|
#define BROOM1_LOWER_TRANS QColor::fromRgbF(1.0, 1.0, 0.1, 0.9)
|
||||||
#define PEANUT QColor::fromRgbF(0.5, 0.2, 0.1, 1.0)
|
#define PEANUT QColor::fromRgbF(0.5, 0.2, 0.1, 1.0)
|
||||||
#define PEANUT_MED_TRANS QColor::fromRgbF(0.5, 0.2, 0.1, 0.5)
|
#define PEANUT_MED_TRANS QColor::fromRgbF(0.5, 0.2, 0.1, 0.5)
|
||||||
|
|
|
@ -51,6 +51,7 @@ void fill_profile_color()
|
||||||
profile_color[BOUNDING_BOX] = COLOR(WHITE1, BLACK1_LOW_TRANS, TUNDORA1_MED_TRANS);
|
profile_color[BOUNDING_BOX] = COLOR(WHITE1, BLACK1_LOW_TRANS, TUNDORA1_MED_TRANS);
|
||||||
profile_color[PRESSURE_TEXT] = COLOR(KILLARNEY1, BLACK1_LOW_TRANS, KILLARNEY1);
|
profile_color[PRESSURE_TEXT] = COLOR(KILLARNEY1, BLACK1_LOW_TRANS, KILLARNEY1);
|
||||||
profile_color[BACKGROUND] = COLOR(SPRINGWOOD1, WHITE1, SPRINGWOOD1);
|
profile_color[BACKGROUND] = COLOR(SPRINGWOOD1, WHITE1, SPRINGWOOD1);
|
||||||
|
profile_color[BACKGROUND_TRANS] = COLOR(SPRINGWOOD1_MED_TRANS, WHITE1_MED_TRANS, SPRINGWOOD1_MED_TRANS);
|
||||||
profile_color[CEILING_SHALLOW] = COLOR(REDORANGE1_HIGH_TRANS, BLACK1_HIGH_TRANS, REDORANGE1_HIGH_TRANS);
|
profile_color[CEILING_SHALLOW] = COLOR(REDORANGE1_HIGH_TRANS, BLACK1_HIGH_TRANS, REDORANGE1_HIGH_TRANS);
|
||||||
profile_color[CEILING_DEEP] = COLOR(RED1_MED_TRANS, BLACK1_HIGH_TRANS, RED1_MED_TRANS);
|
profile_color[CEILING_DEEP] = COLOR(RED1_MED_TRANS, BLACK1_HIGH_TRANS, RED1_MED_TRANS);
|
||||||
profile_color[CALC_CEILING_SHALLOW] = COLOR(FUNGREEN1_HIGH_TRANS, BLACK1_HIGH_TRANS, FUNGREEN1_HIGH_TRANS);
|
profile_color[CALC_CEILING_SHALLOW] = COLOR(FUNGREEN1_HIGH_TRANS, BLACK1_HIGH_TRANS, FUNGREEN1_HIGH_TRANS);
|
||||||
|
|
|
@ -62,6 +62,7 @@ typedef enum {
|
||||||
BOUNDING_BOX,
|
BOUNDING_BOX,
|
||||||
PRESSURE_TEXT,
|
PRESSURE_TEXT,
|
||||||
BACKGROUND,
|
BACKGROUND,
|
||||||
|
BACKGROUND_TRANS,
|
||||||
CEILING_SHALLOW,
|
CEILING_SHALLOW,
|
||||||
CEILING_DEEP,
|
CEILING_DEEP,
|
||||||
CALC_CEILING_SHALLOW,
|
CALC_CEILING_SHALLOW,
|
||||||
|
|
|
@ -581,8 +581,14 @@ void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QMo
|
||||||
}
|
}
|
||||||
setPolygon(p);
|
setPolygon(p);
|
||||||
QLinearGradient pat(0, p.boundingRect().top(), 0, p.boundingRect().bottom());
|
QLinearGradient pat(0, p.boundingRect().top(), 0, p.boundingRect().bottom());
|
||||||
|
// does the user want the ceiling in "surface color" or in red?
|
||||||
|
if (prefs.profile_red_ceiling) {
|
||||||
pat.setColorAt(0, getColor(CEILING_SHALLOW));
|
pat.setColorAt(0, getColor(CEILING_SHALLOW));
|
||||||
pat.setColorAt(1, getColor(CEILING_DEEP));
|
pat.setColorAt(1, getColor(CEILING_DEEP));
|
||||||
|
} else {
|
||||||
|
pat.setColorAt(0, getColor(BACKGROUND_TRANS));
|
||||||
|
pat.setColorAt(1, getColor(BACKGROUND_TRANS));
|
||||||
|
}
|
||||||
setPen(QPen(QBrush(Qt::NoBrush), 0));
|
setPen(QPen(QBrush(Qt::NoBrush), 0));
|
||||||
setBrush(pat);
|
setBrush(pat);
|
||||||
}
|
}
|
||||||
|
@ -605,7 +611,7 @@ void DiveReportedCeiling::preferencesChanged()
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup("TecDetails");
|
s.beginGroup("TecDetails");
|
||||||
setVisible(s.value("redceiling").toBool());
|
setVisible(s.value("dcceiling").toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveReportedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void DiveReportedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
|
|
Loading…
Add table
Reference in a new issue