diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-24 21:31:34 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | c4ad477d079d31d24f68b14bda621e0a245fdf1c (patch) | |
tree | cbaf559f29f069469988c0e1dd6226e96bc72fff /desktop-widgets/tab-widgets | |
parent | d7d408a99e7459ec1a5fc2d9953e72924054b834 (diff) | |
download | subsurface-c4ad477d079d31d24f68b14bda621e0a245fdf1c.tar.gz |
Cleanup: remove field-coloring code in MainTab
Since all fields on the maintab are now directly edited,
there is no point in marking fields as changed. Remove
unused functions MainTab::markChangedWidget() and
MainTab::resetPalette().
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 33 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.h | 2 |
2 files changed, 0 insertions, 35 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 5509a5c93..83fec7d92 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -773,7 +773,6 @@ void MainTab::acceptChanges() emit addDiveFinished(); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING); MainWindow::instance()->diveList->setFocus(); - resetPallete(); displayed_dive.divetrip = nullptr; // Should not be necessary, just in case! return; } else { @@ -871,7 +870,6 @@ void MainTab::acceptChanges() DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING); } int scrolledBy = MainWindow::instance()->diveList->verticalScrollBar()->sliderPosition(); - resetPallete(); if (lastMode == MANUALLY_ADDED_DIVE) { MainWindow::instance()->diveList->reload(); int newDiveNr = get_divenr(get_dive_by_uniq_id(addedId)); @@ -897,25 +895,6 @@ void MainTab::acceptChanges() editMode = NONE; } -void MainTab::resetPallete() -{ - QPalette p; - ui.buddy->setPalette(p); - ui.notes->setPalette(p); - ui.location->setPalette(p); - ui.divemaster->setPalette(p); - ui.suit->setPalette(p); - ui.airtemp->setPalette(p); - ui.DiveType->setPalette(p); - ui.watertemp->setPalette(p); - ui.dateEdit->setPalette(p); - ui.timeEdit->setPalette(p); - ui.tagWidget->setPalette(p); - ui.diveTripLocation->setPalette(p); - ui.duration->setPalette(p); - ui.depth->setPalette(p); -} - void MainTab::rejectChanges() { EditMode lastMode = editMode; @@ -935,7 +914,6 @@ void MainTab::rejectChanges() tabBar()->setTabIcon(0, QIcon()); // Notes tabBar()->setTabIcon(1, QIcon()); // Equipment hideMessage(); - resetPallete(); // no harm done to call cancelPlan even if we were not in ADD or PLAN mode... DivePlannerPointsModel::instance()->cancelPlan(); if(lastMode == ADD) @@ -965,17 +943,6 @@ void MainTab::rejectChanges() ui.editDiveSiteButton->setEnabled(!ui.location->text().isEmpty()); } -void MainTab::markChangedWidget(QWidget *w) -{ - QPalette p; - qreal h, s, l, a; - enableEdition(); - qApp->palette().color(QPalette::Text).getHslF(&h, &s, &l, &a); - p.setBrush(QPalette::Base, (l <= 0.3) ? QColor(Qt::yellow).lighter() : (l <= 0.6) ? QColor(Qt::yellow).light() : /* else */ QColor(Qt::yellow).darker(300)); - w->setPalette(p); - modified = true; -} - static QStringList stringToList(const QString &s) { QStringList res = s.split(",", QString::SkipEmptyParts); diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h index 6a41a1f64..2108b7b42 100644 --- a/desktop-widgets/tab-widgets/maintab.h +++ b/desktop-widgets/tab-widgets/maintab.h @@ -114,9 +114,7 @@ private: bool lastSelectedDive; int lastTabSelectedDive; int lastTabSelectedDiveTrip; - void resetPallete(); void copyTagsToDisplayedDive(); - void markChangedWidget(QWidget *w); dive_trip_t *currentTrip; QList<TabBase*> extraWidgets; }; |