-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNightWidget.cpp
More file actions
42 lines (34 loc) · 1.02 KB
/
Copy pathNightWidget.cpp
File metadata and controls
42 lines (34 loc) · 1.02 KB
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
#include "NightWidget.h"
#include "ui_NightWidget.h"
#include "HardwareLayer.h"
#include "WidgetSelector.h"
CNightWidget::CNightWidget(QWidget *parent) :
CWidgetBase(parent),
ui(new Ui::CNightWidget)
{
ui->setupUi(this);
setObjectName("CNightWidget");
//ui->clockWidget->ShadeColor=0x909050;
ui->clockWidget->TextColor=0x808080;
ui->clockWidget->TimeFont.setFamily("Sans Serif");
ui->clockWidget->TimeFont.setPixelSize(60);
ui->clockWidget->TimeFont.setItalic(true);
ui->clockWidget->TimeFont.setBold(true);
}
CNightWidget::~CNightWidget()
{
delete ui;
}
void CNightWidget::showEvent(QShowEvent *)
{
CHardwareLayer::GetInstance()->SetBrightness(nightBrightness);
}
void CNightWidget::hideEvent(QHideEvent *)
{
CHardwareLayer::GetInstance()->SetBrightness(brightness);
}
void CNightWidget::OnSettingsChanged()
{
brightness=pSelector->GetSettings()->value("General/Brightness",100).toInt();
nightBrightness=pSelector->GetSettings()->value("General/NightBrightness",2).toInt();
}