-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.cpp
69 lines (62 loc) · 2.5 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "settings.h"
#include "choicebutton.h"
#include "pushbutton.h"
#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QPalette>
#include <QPixmap>
#include <QSlider>
#include <QVBoxLayout>
Settings::Settings(QWidget* parent) : QWidget(parent) {
setWindowFlag(Qt::FramelessWindowHint);
QPalette pal = palette();
pal.setBrush(QPalette::Background,
QBrush(QPixmap(":/background/settingsbg")));
setPalette(pal);
// setStyleSheet("QGroupBox{border:none;}");
QGroupBox* windowSet = new QGroupBox(tr("窗口"), this);
windowSet->setStyleSheet(
"color:navy;font-family:华康少女文字W5-A;font-size:25px;");
normal = new ChoiceButton(":/widget/windowN", ":/widget/windowT", this);
fullscreen =
new ChoiceButton(":/widget/fullscreanN", ":/widget/fullscreanT", this);
QHBoxLayout* windowLayout = new QHBoxLayout(windowSet);
windowLayout->addWidget(normal);
windowLayout->addWidget(fullscreen);
normal->setChecked(true);
QGroupBox* shapeSet = new QGroupBox(tr("显示碰撞区域"), this);
shapeSet->setStyleSheet(
"color:navy;font-family:华康少女文字W5-A;font-size:25px;");
showShape = new ChoiceButton(":/widget/showN", ":/widget/showT", this);
noShowShape =
new ChoiceButton(":/widget/noshowN", ":/widget/noshowT", this);
QHBoxLayout* shapeLayout = new QHBoxLayout(shapeSet);
shapeLayout->addWidget(showShape);
shapeLayout->addWidget(noShowShape);
noShowShape->setChecked(true);
QGroupBox* volumeSet = new QGroupBox(this);
QHBoxLayout* vollayout = new QHBoxLayout(volumeSet);
vol = new QLabel(tr("音量"), this);
vol->setStyleSheet(
"color:navy;font-family:华康少女文字W5-A;font-size:25px;");
vollayout->addWidget(vol);
volume = new QSlider(this);
volume->setOrientation(Qt::Horizontal);
volume->setMinimum(0);
volume->setMaximum(100);
volume->setValue(80);
vollayout->addWidget(volume);
QGroupBox* confirmSet = new QGroupBox(this);
QHBoxLayout* conlayout = new QHBoxLayout(confirmSet);
cancel = new PushButton(":/widget/cancelN", ":/widget/cancelT", this);
confirm = new PushButton(":/widget/confirmN", ":/widget/confirmT", this);
conlayout->addWidget(confirm);
conlayout->addWidget(cancel);
QVBoxLayout* vlayout = new QVBoxLayout(this);
vlayout->addWidget(windowSet);
vlayout->addWidget(shapeSet);
vlayout->addWidget(volumeSet);
vlayout->addWidget(confirmSet);
}