-
Notifications
You must be signed in to change notification settings - Fork 0
/
clipboardUIv02.py
240 lines (196 loc) · 6.26 KB
/
clipboardUIv02.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
import PyQt4.QtGui as QtGui
import PyQt4.QtCore as QtCore
import sys
class Signaux(QtCore.QObject):
def __init__(self):
super(Signaux,self, ).__init__()
def click(self):
print 'Yeaahh you create a Click \o/'
def quitApp(self):
return
"""python quit()"""
def nukeTheme(self):
#import a text file with style sheet
#text = open("style.txt")
#self.setStylesheet(text)
return """
*{
font : bold 11px;
color : rgb(224,224,224);
}
QComboBox{
background : rgb(60,60,60);
}
QPushButton{
color : black;
background-color: orange;
border-style: inset;
border-width: 1.6px;
border-radius: 5px;
border-color: black;
font: bold 10px ;
min-width: 10em;
padding: 2px;
}
QPushButton::pressed{
background-color : black;
border-style: inset;
border-width: 1px;
color : white;
}
sceneGraph{
background: rgb(80,80,80);
border-color: black;
}
QLineEdit{
color : white;
font : bold 10px;
background: rgb(112,112,112);
}
QLineEdit{
color : white;
font : bold 10px;
background: rgb(96,96,96);
}
QLineEdit:hover{
background: rgb(8,8,8);
}
QListWidget,QPlainTextEdit,QListView {
background : rgb(70,70,70);
}
QLCDNumber{
background : rgb(40,40,40);
}
"""
def defaultTheme(self):
return """ """
class sceneGraph(QtGui.QMainWindow):
def __init__(self, parent =None):
super(sceneGraph,self, ).__init__(parent)
#self.setMouseTracking(True)
#Init Signaux class
self.clickAction = Signaux()
#Init MainWindow
self.setObjectName("mainWindow")
self.setWindowTitle("XRender")
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
self.sizeHint()
self.setMinimumSize(500,200)
self.setStyleSheet(self.nukeTheme())
"""Menu Actions"""
#Exit
self.exitAction = QtGui.QAction('Exit',self)
self.exitAction.setShortcut('Ctrl+Q')
self.exitAction.setStatusTip('Quit App')
self.exitAction.triggered.connect(self.close)
#Edit menu
self.editAction = QtGui.QAction('Edit',self)
#Render Menu
self.renderAction = QtGui.QAction('Render',self)
#Tools Menu
self.renderAction = QtGui.QAction('Tools',self)
#Help Menu
self.renderAction = QtGui.QAction('Help',self)
#Set Menu Bar
self.statusBar()
self.menubar = self.menuBar()
self.fileMenu = self.menubar.addMenu('File')
self.editMenu = self.menubar.addMenu('Edit')
self.renderMenu = self.menubar.addMenu('Render')
self.ToolsMenu = self.menubar.addMenu('Tools')
self.ToolsMenu = self.menubar.addMenu('Help')
#Set Action Menu
self.fileMenu.addAction(self.exitAction )
#Create Widgets
#---SCENEGRAPH WIDGETS---
#Add sceneGraph Tab widget
self.sceneGraphlabel = QtGui.QLabel("Scenegraph")
self.sceneGraphTab = QtGui.QTabWidget()
#Add scene List widget---
self.sceneListlabel = QtGui.QLabel("Scenes")
self.sceneListWidget = QtGui.QListView()
self.sceneListWidget.setDragEnabled(True)
#--- LAYOUT---
#Set Right Splitter
self.rightSplitter = QtGui.QSplitter(QtCore.Qt.Vertical)
self.rightSplitter.addWidget(self.sceneListlabel)
self.rightSplitter.addWidget(self.sceneListWidget )
#Set Main Splitter
self.mainSplitter = QtGui.QSplitter(QtCore.Qt.Horizontal)
self.mainSplitter.addWidget(self.sceneGraphTab)
self.mainSplitter.addWidget(self.rightSplitter)
#Set Central widget
self.setCentralWidget(self.mainSplitter)
#--- UI THEMES
def nukeTheme(self):
#import a text file with style sheet
#text = open("style.txt")
#self.setStylesheet(text)
return """
*{
font : bold 12px;
color : orange;
}
QMenuBar{
spacing: 6px;
border-width: 0.5px;
border-radius: 3px;
border-color: orange;
background-color : rgb(25,25,25);
}
QMenu::item{
font = 9px;
border-radius: 5px;
background-color : black;
color: orange;
}
QTabWidget{
background-color : rgb(20,20,20);
}
"""
def defaultTheme(self):
return """ """
class customSlider(QtGui.QSlider):
def __init__(self, mini=0, maxi=100, color=None):
super(customSlider, self).__init__(QtCore.Qt.Horizontal)
#self.ticks = Ticks(mini, maxi)
self.setValue(mini)
self.mini = mini
self.maxi = maxi
self.setMinimum(mini *10)
self.setMaximum(maxi * 10)
self.setTickPosition(QtGui.QSlider.TicksAbove)
#self.setTickInterval((maxi - mini) / 10)
self.setMouseTracking(True)
self.setStyleSheet(self.sliderStylesheet())
#Layout
def sliderLayout(self):
self.slider = customSlider()
sliderLayout = QtGui.QVBoxLayout()
sliderLayout.addWidget(self.slider)
self.setLayout(sliderLayout)
def sliderStylesheet(self):
return """
QSlider::groove:horizontal {
height: 4px;
border: 1px solid black;
border-radius: 3px;
background: orange;
}
QSlider::handle:horizontal {
border: 1px solid black;
height: 4px;
width: 3px;
border-radius: 1px ;
background: darkGray;
margin-top: -4px;
margin-bottom: -4px;
}
QSlider::sub-page:horizontal {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 white, stop: 1 orange);
background: qlineargradient(x1: 0, y1: 0.2, x2: 1, y2: 1, stop: 0 white, stop: 1 orange);
height: 5px;
border: 1px solid black;
border-radius: 3px;
}
"""