-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui_Main.py
163 lines (110 loc) · 5.54 KB
/
ui_Main.py
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Main(QtWidgets.QWidget):
def setupUi(self, Main):
Main.setObjectName("Main")
Main.resize(600, 480)
self.QtStack = QtWidgets.QStackedLayout()
self.stack1 = QtWidgets.QWidget()
self.stack2 = QtWidgets.QWidget()
self.Window1UI()
self.Window2UI()
self.QtStack.addWidget(self.stack1)
self.QtStack.addWidget(self.stack2)
def Window1UI(self):
self.stack1.resize(400, 120)
layout = QtWidgets.QGridLayout()
self.query = QtWidgets.QLineEdit()
self.geo = QtWidgets.QLineEdit()
queryLabel = QtWidgets.QLabel("Query:")
geoLabel = QtWidgets.QLabel("Geo:")
self.submitBtn = QtWidgets.QPushButton(self.stack1)
self.submitBtn.setText("Submit")
self.submitBtn.setGeometry(QtCore.QRect(10, 10, 100, 100))
layout.addWidget(queryLabel, 0, 0)
layout.addWidget(self.query, 0, 1)
layout.addWidget(geoLabel, 1, 0)
layout.addWidget(self.geo, 1, 1)
layout.addWidget(self.submitBtn, 1, 2)
self.stack1.setLayout(layout)
def Window2UI(self):
self.FontColor = ""
self.BackColor = ""
self.stack2.setFixedSize(800, 480)
self.stack2.setStyleSheet(self.BackColor)
self.darkBtn = QtWidgets.QPushButton('Dark')
self.darkBtn.setCheckable(True)
layout = QtWidgets.QGridLayout()
self.linkBtn = QtWidgets.QPushButton(self.stack2)
self.linkBtn.setText("Link")
self.linkBtn.setGeometry(QtCore.QRect(10, 10, 100, 100))
self.nextBtn = QtWidgets.QPushButton(self.stack2)
self.nextBtn.setText("Next")
self.nextBtn.setGeometry(QtCore.QRect(10, 10, 100, 100))
self.prevBtn = QtWidgets.QPushButton(self.stack2)
self.prevBtn.setText("Previous")
self.prevBtn.setGeometry(QtCore.QRect(10, 10, 100, 100))
self.showPic = QtWidgets.QPushButton(self.stack2)
self.showPic.setText("ScreenCap")
self.showPic.setCheckable(True)
self.showPic.setGeometry(QtCore.QRect(10, 10, 100, 100))
userT = QtWidgets.QLabel("User:")
usernameT = QtWidgets.QLabel("Username:")
bioT = QtWidgets.QLabel("Bio:")
self.homeTownT = QtWidgets.QLabel("Home:")
self.dateT = QtWidgets.QLabel("Date:")
self.geoT = QtWidgets.QLabel("Geo:")
self.labelSheets = "color: #dc322f;"
userT.setStyleSheet(self.labelSheets)
usernameT.setStyleSheet(self.labelSheets)
bioT.setStyleSheet(self.labelSheets)
self.geoT.setStyleSheet(self.labelSheets)
self.homeTownT.setStyleSheet(self.labelSheets)
self.dateT.setStyleSheet(self.labelSheets)
layout.addWidget(userT, 0, 1, 0, 1, QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)
layout.addWidget(usernameT, 1, 1, 1, 1, QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)
layout.addWidget(bioT, 2, 1, 2, 1, QtCore.Qt.AlignTop| QtCore.Qt.AlignRight)
layout.addWidget(self.dateT, 0, 2, 0, 2, QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)
layout.addWidget(self.homeTownT, 1, 2, 1, 2, QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)
layout.addWidget(self.geoT, 2, 2, 2, 2, QtCore.Qt.AlignTop | QtCore.Qt.AlignRight)
self.userL = QtWidgets.QLabel()
self.usernameL = QtWidgets.QLabel()
self.homeTownL = QtWidgets.QLabel()
self.bioL = QtWidgets.QLabel()
self.dateL = QtWidgets.QLabel()
self.textL = QtWidgets.QLabel()
self.geoL = QtWidgets.QLabel()
self.textL.setFixedWidth(350)
self.bioL.setFixedWidth(150)
self.userL.setWordWrap(True)
self.usernameL.setWordWrap(True)
self.homeTownL.setWordWrap(True)
self.bioL.setWordWrap(True)
self.dateL.setWordWrap(True)
self.textL.setWordWrap(True)
self.textL.setFont(QtGui.QFont("Helvetica", 16))
self.picL = QtWidgets.QLabel()
self.picL.show()
layout.addWidget(self.picL, 3, 0)
layout.addWidget(self.textL, 0, 0, 0, 0, QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
layout.addWidget(self.usernameL, 1, 2, 1, 2, QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
layout.addWidget(self.userL, 0, 2, 0, 2, QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
layout.addWidget(self.bioL, 2, 2, 2, 2, QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
layout.addWidget(self.homeTownL, 1, 4, 1, 4, QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
layout.addWidget(self.dateL, 0, 4, 0, 4, QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
layout.addWidget(self.geoL, 2, 4, 2, 4, QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft)
self.linkBtn.setStyleSheet("QPushButton { background-color: blue }"
"QPushButton:pressed { background-color: red }")
self.nextBtn.setStyleSheet("QPushButton { background-color: blue }"
"QPushButton:pressed { background-color: red }")
self.prevBtn.setStyleSheet("QPushButton { background-color: blue }"
"QPushButton:pressed { background-color: red }")
layout.addWidget(self.linkBtn, 5, 0)
layout.addWidget(self.nextBtn, 5, 2)
layout.addWidget(self.prevBtn, 5, 1)
layout.addWidget(self.showPic, 4, 0)
layout.setColumnMinimumWidth(0, 450)
layout.setColumnMinimumWidth(2, 150)
layout.setColumnMinimumWidth(4, 100)
layout.setColumnMinimumWidth(1, 50)
layout.setColumnMinimumWidth(3, 50)
self.stack2.setLayout(layout)