diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-08-16 15:38:18 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-08-16 15:38:18 -0300 |
commit | b7fe4087a6b8461f029969a38222dd941e0b298d (patch) | |
tree | bd6761008a4c9cd04078637ab2f3f02d63b74377 /qt-ui/maintab.cpp | |
parent | 225b13a22da446860c1f1b5cceeb52ba366ae77d (diff) | |
download | subsurface-b7fe4087a6b8461f029969a38222dd941e0b298d.tar.gz |
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 <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
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 <QDebug> #include <QSet> #include <QSettings> +#include <QPalette> 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 |