-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.cpp
48 lines (37 loc) · 967 Bytes
/
settings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "settings.h"
#include "ui_settings.h"
#include <memory>
Settings::Settings(QWidget *parent) :
QWidget(parent),
ui(new Ui::Settings)
{
ui->setupUi(this);
}
Settings::~Settings()
{
delete ui;
}
void Settings::setSetting(std::shared_ptr<Setting> setting){
setting_ = setting;
ui->brightnessSlider->setValue(setting->ambiBrightness());
ui->satFacSlider->setValue(setting->ambiSatFactor());
ui->opacitySlider->setValue(setting->opacity());
ui->transistionSlider->setValue(setting->transistion());
}
void Settings::on_transistionSlider_valueChanged(int value)
{
setting_->setTransistion(value);
}
void Settings::on_opacitySlider_valueChanged(int value)
{
setting_->setOpacity(value);
opacityChanged();
}
void Settings::on_brightnessSlider_valueChanged(int value)
{
setting_->setAmbiBrightness(value);
}
void Settings::on_satFacSlider_valueChanged(int value)
{
setting_->setAmbiSatFactor(value);
}