mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
0a6c16f35a
commit
94937d2ad9
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue