-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetting.cpp
More file actions
111 lines (96 loc) · 2.74 KB
/
setting.cpp
File metadata and controls
111 lines (96 loc) · 2.74 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include "setting.h"
#include "ui_setting.h"
#include "memo.h"
#include "ui_memo.h"
#include "function.h"
Setting::Setting(Memo &ref,QWidget *parent) :
QDialog(parent),
ui(new Ui::Setting),
Noteref(ref)
{
ui->setupUi(this);
SettingData SetData;
ui->horizontalSlider->setValue(SetData.Opcity);
ui->spinBox->setValue(SetData.Font_Size);
}
Setting::~Setting()
{
delete ui;
}
QPalette qpalette; // Color Changer Var
int RED,GREEN,BLUE; // Color Value
void Setting::on_theme_white_clicked()
{
SettingData SetData;
RED = 255, GREEN = 255, BLUE = 255;
qpalette.setColor(QPalette::Base,QColor(RED,GREEN,BLUE,255));
Noteref.ui->MainText->setPalette(qpalette);
qpalette.setColor(QPalette::Window,QColor(RED,GREEN,BLUE,230));
Noteref.setPalette(qpalette);
SetData.Color = 1;
SetData.SAVE();
}
void Setting::on_theme_yellow_clicked()
{
SettingData SetData;
RED = 255, GREEN = 239, BLUE = 133;
qpalette.setColor(QPalette::Base,QColor(RED,GREEN,BLUE,255));
Noteref.ui->MainText->setPalette(qpalette);
qpalette.setColor(QPalette::Window,QColor(RED,GREEN,BLUE,230));
Noteref.setPalette(qpalette);
SetData.Color = 2;
SetData.SAVE();
}
void Setting::on_theme_pink_clicked()
{
SettingData SetData;
RED = 255, GREEN = 178, BLUE = 245;
qpalette.setColor(QPalette::Base,QColor(RED,GREEN,BLUE,255));
Noteref.ui->MainText->setPalette(qpalette);
qpalette.setColor(QPalette::Window,QColor(RED,GREEN,BLUE,230));
Noteref.setPalette(qpalette);
SetData.Color = 3;
SetData.SAVE();
}
void Setting::on_theme_blue_clicked()
{
SettingData SetData;
RED = 178, GREEN = 204, BLUE = 255;
qpalette.setColor(QPalette::Base,QColor(RED,GREEN,BLUE,255));
Noteref.ui->MainText->setPalette(qpalette);
qpalette.setColor(QPalette::Window,QColor(RED,GREEN,BLUE,230));
Noteref.setPalette(qpalette);
SetData.Color = 4;
SetData.SAVE();
}
void Setting::on_theme_green_clicked()
{
SettingData SetData;
RED = 228, GREEN = 247, BLUE = 186;
qpalette.setColor(QPalette::Base,QColor(RED,GREEN,BLUE,255));
Noteref.ui->MainText->setPalette(qpalette);
qpalette.setColor(QPalette::Window,QColor(RED,GREEN,BLUE,230));
Noteref.setPalette(qpalette);
SetData.Color = 5;
SetData.SAVE();
}
void Setting::on_horizontalSlider_sliderMoved(int position)
{
SettingData SetData;
float Opcity = ((float)position/100);
if(position > 30)
{
Noteref.setWindowOpacity(Opcity);
SetData.Opcity = position;
SetData.SAVE();
}
}
void Setting::on_spinBox_valueChanged(int arg1)
{
SettingData SetData;
QFont font;
font.setPixelSize(arg1);
Noteref.ui->MainText->setFont(font);
SetData.Font_Size = arg1;
SetData.SAVE();
}