-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmiddleview.h
87 lines (70 loc) · 2.3 KB
/
middleview.h
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
#ifndef MIDDLEVIEW_H
#define MIDDLEVIEW_H
#include "leftbar.h"
#include "artistview.h"
#include "tableview.h"
class EmptyMessage : public QWidget{
Q_OBJECT
public:
QVBoxLayout *layout = new QVBoxLayout(this);
CropLabel *text = new CropLabel("Library Empty","font-size:40px;font-weight:bold;color:#CCC");
EmptyMessage(){
hide();
layout->addWidget(text);
text->setAlignment(Qt::AlignCenter);
}
};
class ArtistsList : public QFrame
{
Q_OBJECT
public:
ArtistsList()
{
hide();
setAutoFillBackground(true);
setMinimumWidth(190);
setFixedWidth(190);
QPalette pal = palette();
pal.setColor(QPalette::Background, QColor("#FFF"));
frame->setObjectName("fr");
frame->setPalette(pal);
frame->setStyleSheet("#fr{border-right:1px solid #F4F4F4;border-radius: 0px;background:#FFF}");
scrollLayout->addWidget(scroll);
scrollLayout->setMargin(0);
scrollLayout->setSpacing(0);
scroll->setWidget(frame);
scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
scroll->setWidgetResizable( true );
scroll->setStyleSheet("QScrollArea{border:none}");
layout->setMargin(0);
layout->setSpacing(0);
layout->setAlignment(Qt::AlignTop);
}
QBoxLayout *scrollLayout = new QBoxLayout(QBoxLayout::TopToBottom, this);
QScrollArea *scroll = new QScrollArea();
QFrame *frame = new QFrame();
QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom,frame);
};
class MiddleView : public QWidget
{
Q_OBJECT
public:
QHBoxLayout *layout = new QHBoxLayout(this);
LeftBar *leftBar = new LeftBar();
ArtistsList *artistsList = new ArtistsList();
EmptyMessage *msg = new EmptyMessage();
ArtistView *artistView = new ArtistView();
TableView *songView = new TableView();
MiddleView()
{
layout->setMargin(0);
layout->setSpacing(0);
layout->setAlignment(Qt::AlignLeft);
layout->addWidget(msg,10);
layout->addWidget(leftBar);
layout->addWidget(artistsList);
layout->addWidget(artistView);
layout->addWidget(songView);
}
};
#endif // MIDDLEVIEW_H