mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 07:37:21 -08:00
cinematicWarmth
(Libra H2O)
This commit is contained in:
parent
7e4b3b5d02
commit
f9a1fe6931
4 changed files with 35 additions and 8 deletions
|
@ -827,6 +827,23 @@ namespace {
|
|||
}
|
||||
string_writeconfig(sysfsWarmthPath, warmthValueStr);
|
||||
}
|
||||
void cinematicWarmth(int warmthValue) {
|
||||
int currentWarmth = get_warmth();
|
||||
if(warmthValue < currentWarmth) {
|
||||
while(warmthValue < currentWarmth) {
|
||||
currentWarmth--;
|
||||
set_warmth(currentWarmth);
|
||||
QThread::msleep(30);
|
||||
}
|
||||
}
|
||||
else if(warmthValue > currentWarmth) {
|
||||
while(warmthValue > currentWarmth) {
|
||||
currentWarmth++;
|
||||
set_warmth(currentWarmth);
|
||||
QThread::msleep(30);
|
||||
}
|
||||
}
|
||||
}
|
||||
void installUpdate() {
|
||||
log("Installing update package", "functions");
|
||||
writeFile("/mnt/onboard/onboard/.inkbox/can_really_update", "true\n");
|
||||
|
|
|
@ -721,7 +721,7 @@ void MainWindow::setInitialBrightness() {
|
|||
else {
|
||||
warmth = checkconfig_str_val.toInt();
|
||||
}
|
||||
set_warmth(warmth);
|
||||
cinematicWarmth(warmth);
|
||||
}
|
||||
int brightness_value = brightness_checkconfig(".config/03-brightness/config");
|
||||
if(global::deviceID != "n705\n" and global::deviceID != "n905\n" and global::deviceID != "kt\n") {
|
||||
|
|
|
@ -243,13 +243,7 @@ reader::reader(QWidget *parent) :
|
|||
|
||||
// Custom settings
|
||||
// Brightness
|
||||
if(global::reader::globalReadingSettings == false) {
|
||||
if(global::deviceID != "n705\n" and global::deviceID != "n905\n" and global::deviceID != "kt\n") {
|
||||
int brightness_value = brightness_checkconfig(".config/03-brightness/config");
|
||||
log("Local Reading Settings: Setting brightness to " + QString::number(brightness_value), className);
|
||||
cinematicBrightness(brightness_value, 2);
|
||||
}
|
||||
}
|
||||
QTimer::singleShot(0, this, SLOT(setCinematicBrightnessWarmthSlot()));
|
||||
// Font
|
||||
global::reader::font = readFile(".config/04-book/font");
|
||||
if(global::reader::font == "u001") {
|
||||
|
@ -2275,3 +2269,18 @@ void reader::on_brightnessBtn_clicked()
|
|||
brightnessDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||
brightnessDialogWindow->show();
|
||||
}
|
||||
|
||||
void reader::setCinematicBrightnessWarmthSlot() {
|
||||
if(global::reader::globalReadingSettings == false) {
|
||||
if(global::deviceID != "n705\n" and global::deviceID != "n905\n" and global::deviceID != "kt\n") {
|
||||
int brightness_value = brightness_checkconfig(".config/03-brightness/config");
|
||||
log("Local Reading Settings: Setting brightness to " + QString::number(brightness_value), className);
|
||||
cinematicBrightness(brightness_value, 2);
|
||||
}
|
||||
if(global::deviceID == "n873\n") {
|
||||
int warmthValue = readFile(".config/03-brightness/config-warmth").toInt();
|
||||
log("Local Reading Settings: Setting warmth to " + QString::number(warmthValue), className);
|
||||
cinematicWarmth(warmthValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,6 +169,7 @@ private slots:
|
|||
void on_lineSpacingSlider_valueChanged(int value);
|
||||
void on_marginsSlider_valueChanged(int value);
|
||||
void on_brightnessBtn_clicked();
|
||||
void setCinematicBrightnessWarmthSlot();
|
||||
|
||||
signals:
|
||||
void openBookFile(QString book, bool relativePath);
|
||||
|
|
Loading…
Reference in a new issue