From b7fe4087a6b8461f029969a38222dd941e0b298d Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 16 Aug 2013 15:38:18 -0300 Subject: Change bg of edited parts of the dive on the interface Change the background color of edited parts of the dive on the interface. Specially util if you are editing multi dives in a single step, and went to eat something or did anything else for five minutes, then come back and don't quite remember what did you changed. now it's in a cute yellowish background. Signed-off-by: Tomaz Canabrava --- qt-ui/maintab.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index ca1be6963..9f962be8b 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -19,6 +19,7 @@ #include #include #include +#include MainTab::MainTab(QWidget *parent) : QTabWidget(parent), ui(new Ui::MainTab()), @@ -438,6 +439,12 @@ void MainTab::on_editAccept_clicked(bool edit) } editMode = NONE; } + QPalette p; + ui->buddy->setPalette(p); + ui->notes->setPalette(p); + ui->location->setPalette(p); + ui->divemaster->setPalette(p); + ui->suit->setPalette(p); } #define EDIT_TEXT2(what, text) \ @@ -501,6 +508,12 @@ void MainTab::on_editReset_clicked() ui->editAccept->hide(); ui->editReset->hide(); notesBackup.clear(); + QPalette p; + ui->buddy->setPalette(p); + ui->notes->setPalette(p); + ui->location->setPalette(p); + ui->divemaster->setPalette(p); + ui->suit->setPalette(p); editMode = NONE; } #undef EDIT_TEXT2 @@ -518,6 +531,10 @@ void MainTab::on_buddy_textChanged(const QString& text) EDIT_TEXT(mydive->buddy, text); } + + QPalette p; + p.setBrush(QPalette::Base, QColor(Qt::yellow).lighter()); + ui->buddy->setPalette(p); } void MainTab::on_divemaster_textChanged(const QString& text) @@ -534,6 +551,9 @@ void MainTab::on_divemaster_textChanged(const QString& text) EDIT_TEXT(mydive->divemaster, text); } + QPalette p; + p.setBrush(QPalette::Base, QColor(Qt::yellow).lighter()); + ui->divemaster->setPalette(p); } void MainTab::on_location_textChanged(const QString& text) @@ -555,6 +575,10 @@ void MainTab::on_location_textChanged(const QString& text) EDIT_TEXT(mydive->location, text); } } + + QPalette p; + p.setBrush(QPalette::Base, QColor(Qt::yellow).lighter()); + ui->location->setPalette(p); } void MainTab::on_suit_textChanged(const QString& text) @@ -571,6 +595,10 @@ void MainTab::on_suit_textChanged(const QString& text) EDIT_TEXT(mydive->suit, text); } + + QPalette p; + p.setBrush(QPalette::Base, QColor(Qt::yellow).lighter()); + ui->suit->setPalette(p); } void MainTab::on_notes_textChanged() @@ -593,6 +621,10 @@ void MainTab::on_notes_textChanged() EDIT_TEXT(mydive->notes, ui->notes->toPlainText()); } } + + QPalette p; + p.setBrush(QPalette::Base, QColor(Qt::yellow).lighter()); + ui->notes->setPalette(p); } #undef EDIT_TEXT -- cgit v1.2.3-70-g09d2