diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-05-07 15:14:01 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-07 15:17:58 -0700 |
commit | 94937d2ad9a5781c1b1d134a87cfc459c3b48cd0 (patch) | |
tree | d49c3f9cede40d5d18f98b45f8d1c6b2fcf8dbe1 /qt-ui/maintab.cpp | |
parent | 0a6c16f35af230d9d38629507dc51070f236e009 (diff) | |
download | subsurface-94937d2ad9a5781c1b1d134a87cfc459c3b48cd0.tar.gz |
Improve the color coding when editing coordinates
This still gets it wrong (i.e. marks things as edited when they are not or
not edited when they are) but at least they are no longer incorrectly
marked as incorrectly parsed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index a84c0ecec..8bb0d6630 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -1021,13 +1021,14 @@ void MainTab::on_coordinates_textChanged(const QString &text) { bool gpsChanged = false; bool parsed = false; + QPalette p; + ui.coordinates->setPalette(p); // reset palette EDIT_SELECTED_DIVES(gpsChanged |= gpsHasChanged(mydive, current_dive, text, &parsed)); - if (gpsChanged) { - markChangedWidget(ui.coordinates); - } else if (!parsed) { - QPalette p; + if (gpsChanged) + markChangedWidget(ui.coordinates); // marks things yellow + if (!parsed) { p.setBrush(QPalette::Base, QColor(Qt::red).lighter()); - ui.coordinates->setPalette(p); + ui.coordinates->setPalette(p); // marks things red } } |