mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Fix colors on the new profile.
This patch fixes the colors on the new profile, the init of the colors map was not being done. This fixes it. A few problems were spotted on the new profile dealing with the ruler graph and a newly added dive, when using the dive add dialog. I'll be on it later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
04382a1943
commit
5bba84e57f
4 changed files with 3 additions and 11 deletions
2
main.cpp
2
main.cpp
|
@ -21,7 +21,7 @@ int main(int argc, char **argv)
|
|||
|
||||
setup_system_prefs();
|
||||
prefs = default_prefs;
|
||||
|
||||
fill_profile_color();
|
||||
init_ui(&argc, &argv);
|
||||
parse_xml_init();
|
||||
taglist_init_global();
|
||||
|
|
|
@ -42,13 +42,6 @@ QString dpGasToStr(const divedatapoint &p)
|
|||
return gasToStr(p.o2, p.he);
|
||||
}
|
||||
|
||||
QColor getColor(const color_indice_t i)
|
||||
{
|
||||
if (profile_color.count() > i && i >= 0)
|
||||
return profile_color[i].at(0);
|
||||
return QColor(Qt::black);
|
||||
}
|
||||
|
||||
static DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
|
||||
|
||||
DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent),
|
||||
|
@ -65,7 +58,6 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent
|
|||
minDepth(M_OR_FT(40, 120)),
|
||||
dpMaxTime(0)
|
||||
{
|
||||
fill_profile_color();
|
||||
setBackgroundBrush(profile_color[BACKGROUND].at(0));
|
||||
setMouseTracking(true);
|
||||
setScene(new QGraphicsScene());
|
||||
|
|
|
@ -58,7 +58,7 @@ void fill_profile_color()
|
|||
#undef COLOR
|
||||
}
|
||||
|
||||
QColor getColor(const color_indice_t i, bool isGrayscale = false)
|
||||
QColor getColor(const color_indice_t i, bool isGrayscale)
|
||||
{
|
||||
if (profile_color.count() > i && i >= 0)
|
||||
return profile_color[i].at((isGrayscale) ? 1 : 0);
|
||||
|
|
|
@ -73,7 +73,7 @@ typedef enum {
|
|||
|
||||
extern QMap<color_indice_t, QVector<QColor> > profile_color;
|
||||
void fill_profile_color();
|
||||
QColor getColor(const color_indice_t i);
|
||||
QColor getColor(const color_indice_t i, bool isGrayscale = false);
|
||||
QColor getSacColor(int sac, int diveSac);
|
||||
struct text_render_options {
|
||||
double size;
|
||||
|
|
Loading…
Reference in a new issue