mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Clone a bit of code to mark the Location Widget changed
This code is the same that is used on the MainTab, but since they are different objects, I can't just call it. so I'm duplicating them for the time being. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6fbf5b33cc
commit
30c5a027ca
2 changed files with 20 additions and 2 deletions
|
@ -667,7 +667,7 @@ void MultiFilter::closeFilter()
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QShowEvent>
|
#include <QShowEvent>
|
||||||
|
|
||||||
LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBox(parent)
|
LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBox(parent), modified(false)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
ui.diveSiteMessage->setText("You are editing the Dive Site");
|
ui.diveSiteMessage->setText("You are editing the Dive Site");
|
||||||
|
@ -755,3 +755,19 @@ void LocationInformationWidget::rejectChanges()
|
||||||
void LocationInformationWidget::showEvent(QShowEvent *ev) {
|
void LocationInformationWidget::showEvent(QShowEvent *ev) {
|
||||||
ui.diveSiteMessage->setCloseButtonVisible(false);
|
ui.diveSiteMessage->setCloseButtonVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LocationInformationWidget::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;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LocationInformationWidget::enableEdition()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -230,13 +230,15 @@ public slots:
|
||||||
|
|
||||||
void setLocationId(uint32_t uuid);
|
void setLocationId(uint32_t uuid);
|
||||||
void updateGpsCoordinates(void);
|
void updateGpsCoordinates(void);
|
||||||
|
void markChangedWidget(QWidget *w);
|
||||||
|
void enableEdition();
|
||||||
signals:
|
signals:
|
||||||
void informationManagementEnded();
|
void informationManagementEnded();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct dive_site *currentDs;
|
struct dive_site *currentDs;
|
||||||
Ui::LocationInformation ui;
|
Ui::LocationInformation ui;
|
||||||
|
bool modified;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool isGnome3Session();
|
bool isGnome3Session();
|
||||||
|
|
Loading…
Reference in a new issue