irecorder 0.0.4-linux

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,354 @@
1
+ #---------------------------------------------------------------------------------------------------
2
+ #
3
+ # Task Window
4
+ #
5
+ class TaskWindow < Qt::Widget
6
+
7
+ # column
8
+ SOURCE = 0
9
+ FILE = 1
10
+ LAPSE = 2
11
+ STATUS = 3
12
+
13
+ class TaskItem
14
+ attr_reader :sourceUrlItem, :savePathItem, :savePath
15
+ attr_reader :timeItem, :statusItem
16
+ attr_reader :process
17
+ alias :id :sourceUrlItem
18
+
19
+ def initialize(process, src, save, time, status)
20
+ @sourceUrlItem = Item.new(src)
21
+ @savePathItem = Item.new(File.basename(save))
22
+ @timeItem = Item.new(lapseText(time))
23
+ @statusItem = Item.new(status)
24
+ @process = process
25
+ @savePath = save
26
+ end
27
+
28
+ def sourceUrl
29
+ @sourceUrlItem.text
30
+ end
31
+
32
+ def time
33
+ @timeItem.text
34
+ end
35
+
36
+ def status
37
+ @statusItem.text
38
+ end
39
+
40
+ def updateTime(lapse)
41
+ @timeItem.text = lapseText(lapse)
42
+ end
43
+
44
+ def status=(str)
45
+ @statusItem.text = str
46
+ end
47
+
48
+ def lapseText(lapse)
49
+ a = Time.at(lapse).getgm.to_a
50
+ "%02d:%02d:%02d" % [a[2], a[1], a[0]]
51
+ end
52
+
53
+ end
54
+
55
+
56
+ #--------------------------------------------
57
+ #
58
+ #
59
+ class TaskTable < Qt::TableWidget
60
+
61
+ def initialize
62
+ super(0,4)
63
+
64
+ # Hash table : key column_0_item => TaskItem
65
+ @taskItemTbl = {}
66
+ end
67
+
68
+ public
69
+ def taskItemAtRow(row)
70
+ i0 = item(row,0) # column_0_item is key to taskItem ID
71
+ i0 && taskItemFromId(i0)
72
+ end
73
+
74
+ def taskItemFromId(id)
75
+ @taskItemTbl[id]
76
+ end
77
+
78
+ def insertTaskItem(taskItem)
79
+ sortFlag = sortingEnabled
80
+ self.sortingEnabled = false
81
+
82
+ insertRow(0)
83
+ setItem(0,SOURCE, taskItem.sourceUrlItem)
84
+ setItem(0,FILE, taskItem.savePathItem)
85
+ setItem(0,LAPSE, taskItem.timeItem)
86
+ setItem(0,STATUS, taskItem.statusItem)
87
+ @taskItemTbl[taskItem.id] = taskItem
88
+
89
+ self.sortingEnabled = sortFlag
90
+ end
91
+
92
+ def each(&block)
93
+ a = []
94
+ rowCount.times do |r|
95
+ i = taskItemAtRow(r)
96
+ a << i if i
97
+ end
98
+ a.each do |i| block.call( i ) end
99
+ end
100
+
101
+ def deleteItem(i)
102
+ removeRow(i.id.row)
103
+ @taskItemTbl.delete(i.id)
104
+ end
105
+
106
+
107
+ # context menu : right click popup menu.
108
+ protected
109
+ def contextMenuEvent(e)
110
+ $log.misc { "right button is clicked." }
111
+ wItem = itemAt(e.pos)
112
+ if wItem
113
+ openContextPopup(e.globalPos, wItem)
114
+ end
115
+ end
116
+
117
+
118
+
119
+
120
+ # open & exec contextMenu
121
+ def openContextPopup(pos, wItem)
122
+ poRow = wItem.row
123
+ poColumn = wItem.column
124
+ $log.misc { "right clicked item (row:#{poRow}, column:#{poColumn})" }
125
+ url = getContextUrl(wItem)
126
+ sts = taskItemAtRow(wItem.row).status
127
+
128
+ menu = Qt::Menu.new
129
+ insertDefaultActions(menu, poColumn, url, sts)
130
+ if url then
131
+ menu.addSeparator
132
+ insertPlayerActions(menu, url)
133
+ menu.addSeparator
134
+ insertMPlayerAction(menu)
135
+ end
136
+ action = menu.exec(pos)
137
+ if action then
138
+ $log.code { "execute : '#{action.data.toString}'" }
139
+ cmd, exe = action.data.toString.split(/@/, 2)
140
+ $log.code { "cmd(#{cmd}), exe(#{exe})" }
141
+ case cmd
142
+ when 'play'
143
+ playMedia(exe, wItem)
144
+ else
145
+ self.method(cmd).call(wItem)
146
+ end
147
+ end
148
+ menu.deleteLater
149
+ end
150
+
151
+ def insertDefaultActions(menu, poColumn, url, sts)
152
+ a = menu.addAction(KDE::Icon.new('edit-copy'), 'Copy Text')
153
+ a.setVData('copyText@')
154
+ if poColumn == FILE
155
+ a = menu.addAction(KDE::Icon.new('kfm'), 'Open Folder')
156
+ a.setVData('openFolder@')
157
+ a = menu.addAction(KDE::Icon.new('kfm'), 'Open Temp Folder')
158
+ a.setVData('openTempFolder@')
159
+ end
160
+ if sts =~ /Error/i
161
+ a = menu.addAction(KDE::Icon.new('view-refresh'), 'Retry')
162
+ a.setVData('retryTask@')
163
+ a = menu.addAction(KDE::Icon.new('list-remove'), 'Remove')
164
+ a.setVData('removeTask@')
165
+ end
166
+ if sts =~ /\w+ing\b/i
167
+ a = menu.addAction(KDE::Icon.new('edit-delete'), 'Cancel')
168
+ a.setVData('cancelTask@')
169
+ end
170
+ a = menu.addAction(KDE::Icon.new('edit-clear-list'), 'Clear All Finished.')
171
+ a.setVData('clearAllFinished@')
172
+ a = menu.addAction(KDE::Icon.new('edit-clear-list'), 'Clear All Errors.')
173
+ a.setVData('clearAllErrors@')
174
+ end
175
+
176
+
177
+ def insertMPlayerAction(menu)
178
+ player = 'mplayer'
179
+ mplayerPath = %x(which #{player})
180
+ return if mplayerPath =~ /no #{player}/
181
+ insertPlayer(menu, player, player + ' %U')
182
+ end
183
+
184
+ def insertPlayerActions(menu, url)
185
+ Mime::services(url).each do |s|
186
+ if s.exec then
187
+ exeName = s.exec[/\w+/]
188
+ insertPlayer(menu, exeName, s.exec)
189
+ end
190
+ end
191
+ end
192
+
193
+ def insertPlayer(menu, exeName, exec = exeName)
194
+ a = menu.addAction(KDE::Icon.new(exeName), 'Play with ' + exeName)
195
+ a.setVData('play@' + exec)
196
+ end
197
+
198
+
199
+ def getContextUrl(wItem)
200
+ ti = taskItemAtRow(wItem.row)
201
+ return nil unless ti
202
+ rawFilePath = File.join(IRecSettings.rawDownloadDir.path, ti.savePath)
203
+ filePath = File.join(IRecSettings.downloadDir.path, ti.savePath)
204
+ url = case wItem.column
205
+ when SOURCE
206
+ ti.sourceUrl
207
+ when FILE
208
+ ti.process.rawDownloaded? ? filePath : rawFilePath
209
+ else
210
+ nil
211
+ end
212
+ end
213
+
214
+
215
+ # contextMenu Event
216
+ def playMedia(exe, wItem)
217
+ url = getContextUrl(wItem)
218
+ return unless url
219
+ cmd, args = exe.split(/\s+/, 2)
220
+ args = args.split(/\s+/).map do |a|
221
+ a.gsub(/%\w/, url)
222
+ end
223
+ # cmd = 'test/testarg.rb' # debug test
224
+ $log.debug { "execute cmd '#{cmd}', args '#{args.inspect}'" }
225
+ proc = Qt::Process.new(self)
226
+ proc.start(cmd, args)
227
+ end
228
+
229
+ # contextMenu Event
230
+ def copyText(wItem)
231
+ $app.clipboard.setText(wItem.text)
232
+ end
233
+
234
+ # contextMenu Event
235
+ def retryTask(wItem)
236
+ ti = taskItemAtRow(wItem.row)
237
+ if ti and ti.process.error? then
238
+ ti.process.retryTask
239
+ $log.info { "task restarted." }
240
+ end
241
+ end
242
+
243
+ # contextMenu Event
244
+ def cancelTask(wItem)
245
+ ti = taskItemAtRow(wItem.row)
246
+ if ti and ti.process.running? then
247
+ ti.process.cancelTask
248
+ $log.info { "task canceled." }
249
+ end
250
+ end
251
+
252
+ # contextMenu Event
253
+ def removeTask(wItem)
254
+ ti = taskItemAtRow(wItem.row)
255
+ if ti and ti.process.running? then
256
+ ti.process.cancelTask
257
+ $log.info { "task canceled." }
258
+ end
259
+ deleteItem(ti)
260
+ end
261
+
262
+ # contextMenu Event
263
+ def openFolder(wItem)
264
+ ti = taskItemAtRow(wItem.row)
265
+ return unless ti
266
+ filePath = File.join(IRecSettings.downloadDir.path, File.dirname(ti.savePath))
267
+ proc = Qt::Process.new(self)
268
+ proc.start('dolphin', [filePath])
269
+ end
270
+
271
+ # contextMenu Event
272
+ def openTempFolder(wItem)
273
+ ti = taskItemAtRow(wItem.row)
274
+ return unless ti
275
+ rawFilePath = File.join(IRecSettings.rawDownloadDir.path, File.dirname(ti.savePath))
276
+ proc = Qt::Process.new(self)
277
+ proc.start('dolphin', [rawFilePath])
278
+ end
279
+
280
+ # contextMenu Event
281
+ def clearAllFinished(wItem)
282
+ self.each do |i|
283
+ deleteItem(i) if i.process.finished?
284
+ end
285
+ end
286
+
287
+ # contextMenu Event
288
+ def clearAllErrors(wItem)
289
+ self.each do |i|
290
+ deleteItem(i) if i.process.error?
291
+ end
292
+ end
293
+
294
+ end
295
+
296
+ #--------------------------------------------
297
+ #
298
+ #
299
+ class Item < Qt::TableWidgetItem
300
+ def initialize(text)
301
+ super(text)
302
+ self.flags = Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled
303
+ end
304
+ end
305
+
306
+
307
+ #--------------------------------------------
308
+ #
309
+ def initialize()
310
+ super
311
+
312
+ # create widgets
313
+ tvLayout = Qt::VBoxLayout.new
314
+ @table = TaskTable.new
315
+ tvLayout.addWidget(@table)
316
+ @table.setHorizontalHeaderLabels(['Source', 'File', 'Lapse', 'Status'])
317
+ @table.horizontalHeader.stretchLastSection = true
318
+ @table.selectionBehavior = Qt::AbstractItemView::SelectRows
319
+ @table.alternatingRowColors = true
320
+
321
+ setLayout(tvLayout)
322
+
323
+ # initialize variables
324
+ #
325
+ end
326
+
327
+ GroupName = "TaskWindow"
328
+ def writeSettings
329
+ config = $config.group(GroupName)
330
+ config.writeEntry('Header', @table.horizontalHeader.saveState)
331
+ end
332
+
333
+ def readSettings
334
+ config = $config.group(GroupName)
335
+ @table.horizontalHeader.restoreState(config.readEntry('Header', @table.horizontalHeader.saveState))
336
+ end
337
+
338
+ # return : added TaskItem
339
+ public
340
+ def addTask(process)
341
+ # insert at the top
342
+ src = process.sourceUrl
343
+ save = process.rawFileName
344
+ taskItem = TaskItem.new(process, src, save, 0, 'prepare')
345
+ @table.insertTaskItem(taskItem)
346
+
347
+ taskItem
348
+ end
349
+
350
+ def each(&block)
351
+ @table.each(&block)
352
+ end
353
+ end
354
+
@@ -0,0 +1,424 @@
1
+ * {
2
+ color: white;
3
+ background: rgb(10,10,10);
4
+ alternate-background-color: rgb(80,80,80);
5
+ border-color: rgb(82,0,45);
6
+ }
7
+ *:selected {
8
+ color: white;
9
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
10
+ stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
11
+ stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
12
+ }
13
+
14
+ *:hover {
15
+ color: rgb(255, 84, 174);
16
+ }
17
+
18
+ *:disabled {
19
+ color: rgb(40, 20, 255);
20
+ }
21
+
22
+ *:selected {
23
+ border: 1px solid rgb(255,84,174);
24
+ }
25
+
26
+
27
+ /*
28
+ Popup & Menu
29
+ */
30
+
31
+ QMenu {
32
+ border: 1px solid rgb(124,124,124);
33
+ background: rgb(60,60,60);
34
+ }
35
+
36
+ QMenu::item {
37
+ /* border: 1px solid red; */
38
+ /* background: rgb(60,60,60); */
39
+ }
40
+
41
+ QMenu::item:selected {
42
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
43
+ stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
44
+ stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
45
+ }
46
+
47
+ QMenu::separator {
48
+ height: 1px;
49
+ background: rgb(124,124,124);
50
+ margin: 1px 15px;
51
+ }
52
+
53
+ QMenu::icon {
54
+ border: 4px solid red;
55
+ selection-background-color: yellow;
56
+ selection-color: yellow;
57
+ background: green;
58
+ }
59
+ /*
60
+ QMenu::icon:pressed
61
+ QMenu::icon:selected
62
+ QMenu::icon:focus
63
+ */
64
+ QMenu::icon:checked {
65
+ border: 4px solid red;
66
+ selection-background-color: yellow;
67
+ selection-color: yellow;
68
+ background: green;
69
+ }
70
+
71
+ /*
72
+ TextEdit
73
+ */
74
+ QTextEdit {
75
+ border: 1px solid rgb(124,124,124);
76
+ background: rgb(30,30,30);
77
+ }
78
+
79
+ /*
80
+ PushButton
81
+ */
82
+ QPushButton {
83
+ color: white;
84
+ font: bold normal "Nimbus Sans L";
85
+ border: 2px solid rgb(0,0,0);
86
+ border-radius: 4px;
87
+ padding: 4px 8px;
88
+ margin: 1px;
89
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
90
+ stop:0 rgb(0, 0, 0), stop:0.48 rgb(0, 0, 0),
91
+ stop:0.5 rgb(59, 59, 59), stop:1 rgb(125, 125, 125));
92
+ min-width: 3em;
93
+ }
94
+
95
+ QPushButton:checked {
96
+ color: white;
97
+ border-color: rgb(139,0,76);
98
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
99
+ stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
100
+ stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
101
+ }
102
+
103
+ QPushButton:hover {
104
+ color: rgb(255, 84, 174);
105
+ }
106
+
107
+ /*
108
+ disabled button's font color is not changable.
109
+ */
110
+ QPushButton:disabled {
111
+ color: rgb(40, 200, 255);
112
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(11, 11, 11, 255), stop:0.427083 rgba(33, 33, 33, 255), stop:0.536458 rgba(61, 61, 61, 255), stop:1 rgba(75, 75, 75, 255))
113
+ }
114
+
115
+
116
+ /*
117
+ table
118
+ */
119
+ QTableView {
120
+ border: 1px solid rgb(124,124,124);
121
+ background: rgb(30,30,30);
122
+ margin: 0px;
123
+ }
124
+
125
+ QTableView QTableCornerButton::section {
126
+ border: 1px solid rgb(40,40,40);
127
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
128
+ stop:0 rgb(40, 40, 40), stop:0.68 rgb(40, 40, 40),
129
+ stop:0.7 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
130
+ }
131
+
132
+ QTableView QHeaderView {
133
+ border: 1px solid rgb(40,40,40);
134
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
135
+ stop:0 rgb(40, 40, 40), stop:0.68 rgb(40, 40, 40),
136
+ stop:0.7 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
137
+ }
138
+
139
+ QTableView QHeaderView::section {
140
+ border: 1px solid rgb(120,120,120);
141
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
142
+ stop:0 rgb(40, 40, 40), stop:0.68 rgb(40, 40, 40),
143
+ stop:0.7 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
144
+ }
145
+
146
+ QTableView QHeaderView::section:checked {
147
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
148
+ stop:0 rgb(40, 40, 40), stop:0.68 rgb(40, 40, 40),
149
+ stop:0.7 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
150
+ }
151
+
152
+
153
+ QTableView {
154
+ selection-background-color: rgb(148,0,86);
155
+ /*
156
+ selection-background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
157
+ stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
158
+ stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
159
+ */
160
+ }
161
+
162
+
163
+ /*
164
+ LineEdit
165
+ */
166
+ QLineEdit, QLineEdit:hover {
167
+ color: white;
168
+ margin: 1px;
169
+ border: 1px solid rgb(180,180,180);
170
+ background: rgb(30,30,30);
171
+ }
172
+ QLineEdit:hover{
173
+ margin: 1px;
174
+ border: 1px solid rgb(220,220,220);
175
+ }
176
+
177
+ QLineEdit:focus {
178
+ margin: 0px;
179
+ border: 2px solid rgb(220,220,220);
180
+ }
181
+
182
+
183
+ /*
184
+ ScrollBar
185
+ vertical
186
+ */
187
+ QScrollBar:vertical {
188
+ border: 1px solid rgb(60,60,60);
189
+ background: rgb(40,40,40);
190
+ width: 18px;
191
+ margin: 17px 0 17px 0;
192
+ }
193
+ QScrollBar::handle:vertical {
194
+ /* background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0.00520833 rgba(14, 14, 14, 255), stop:0.25 rgba(47, 47, 47, 255), stop:0.75 rgba(64, 64, 64, 255), stop:1 rgba(156, 156, 156, 255));
195
+ */
196
+ background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
197
+ stop:0 rgba(71, 71, 71, 255), stop:0.25 rgba(84, 84, 84, 255),
198
+ stop:0.75 rgba(109, 109, 109, 255), stop:1 rgba(156, 156, 156, 255));
199
+ min-height: 16px;
200
+ }
201
+
202
+ QScrollBar::sub-line:vertical, QScrollBar::add-line:vertical {
203
+ border: 1px solid rgb(40,40,40);
204
+ background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0,
205
+ stop:0 rgba(71, 71, 71, 255), stop:0.25 rgba(84, 84, 84, 255),
206
+ stop:0.75 rgba(109, 109, 109, 255), stop:1 rgba(156, 156, 156, 255));
207
+ height: 16px;
208
+ subcontrol-origin: margin;
209
+ }
210
+
211
+ QScrollBar::sub-line:vertical {
212
+ subcontrol-position: top;
213
+ }
214
+
215
+ QScrollBar::add-line:vertical {
216
+ subcontrol-position: bottom;
217
+ }
218
+
219
+ QScrollBar::up-arrow:vertical {
220
+ image: url(resources/up-arrow.png);
221
+ }
222
+ QScrollBar::down-arrow:vertical {
223
+ image: url(resources/down-arrow.png);
224
+ }
225
+
226
+ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
227
+ background: none;
228
+ }
229
+
230
+
231
+ /*
232
+ ScrollBar
233
+ Horizontal
234
+ */
235
+ QScrollBar:horizontal {
236
+ border: 1px solid rgb(60,60,60);
237
+ background: rgb(40,40,40);
238
+ height: 18px;
239
+ margin: 0 17px 0 17px;
240
+ }
241
+ QScrollBar::handle:horizontal {
242
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
243
+ stop:0 rgba(71, 71, 71, 255), stop:0.25 rgba(84, 84, 84, 255),
244
+ stop:0.75 rgba(109, 109, 109, 255), stop:1 rgba(156, 156, 156, 255));
245
+ min-width: 16px;
246
+ }
247
+
248
+ QScrollBar::sub-line:horizontal, QScrollBar::add-line:horizontal {
249
+ border: 1px solid rgb(40,40,40);
250
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
251
+ stop:0 rgba(71, 71, 71, 255), stop:0.25 rgba(84, 84, 84, 255),
252
+ stop:0.75 rgba(109, 109, 109, 255), stop:1 rgba(156, 156, 156, 255));
253
+ width: 16px;
254
+ subcontrol-origin: margin;
255
+ }
256
+
257
+ QScrollBar::sub-line:horizontal {
258
+ subcontrol-position: left;
259
+ }
260
+
261
+ QScrollBar::add-line:horizontal {
262
+ subcontrol-position: right;
263
+ }
264
+
265
+ QScrollBar::left-arrow:horizontal {
266
+ image: url(resources/left-arrow.png);
267
+ }
268
+ QScrollBar::right-arrow:horizontal {
269
+ image: url(resources/right-arrow.png);
270
+ }
271
+
272
+ QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
273
+ background: none;
274
+ }
275
+
276
+
277
+
278
+
279
+
280
+ /*
281
+ TabWidget. borrowed from qt4 manual example.
282
+ */
283
+ QTabWidget::pane { /* The tab widget frame */
284
+ background: rgb(50,50,50);
285
+ border-top: 2px solid rgb(70,70,70);
286
+ }
287
+
288
+ QTabWidget::tab-bar {
289
+ left: 5px; /* move to the right by 5px */
290
+ }
291
+
292
+ /* Style the tab using the tab sub-control. Note that
293
+ it reads QTabBar _not_ QTabWidget */
294
+ QTabBar::tab {
295
+ color: white;
296
+ font: bold normal "Nimbus Sans L";
297
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
298
+ stop:0 rgb(0, 0, 0), stop:0.48 rgb(0, 0, 0),
299
+ stop:0.5 rgb(59, 59, 59), stop:1 rgb(140, 140, 140));
300
+ border: 2px solid rgb(0,0,0);
301
+ border-bottom-color: rgb(50,50,50); /* same as the pane color */
302
+ border-top-left-radius: 6px;
303
+ border-top-right-radius: 6px;
304
+ min-width: 4.5em;
305
+ padding: 2px;
306
+ }
307
+
308
+ QTabBar::tab:selected {
309
+ color: rgb(255, 84, 174);
310
+ background: rgb(50,50,50);
311
+ border-color: rgb(140,140,140) rgb(100,100,100) rgb(50,50,50);
312
+ }
313
+
314
+ QTabBar::tab:hover {
315
+ color: rgb(255, 84, 174);
316
+ }
317
+
318
+ QTabBar::tab:!selected {
319
+ margin-top: 2px; /* make non-selected tabs look smaller */
320
+ }
321
+
322
+ /* make use of negative margins for overlapping tabs */
323
+ QTabBar::tab:selected {
324
+ /* expand/overlap to the left and right by 4px */
325
+ margin-left: -4px;
326
+ margin-right: -4px;
327
+ }
328
+
329
+ QTabBar::tab:first:selected {
330
+ margin-left: 0; /* the first selected tab has nothing to overlap with on the left */
331
+ }
332
+
333
+ QTabBar::tab:last:selected {
334
+ margin-right: 0; /* the last selected tab has nothing to overlap with on the right */
335
+ }
336
+
337
+ QTabBar::tab:only-one {
338
+ margin: 0; /* if there is only one tab, we don't want overlapping margins */
339
+ }
340
+
341
+ /*
342
+ Channel ToolBox
343
+ */
344
+ QToolBox#channelToolBox {
345
+ border: 0px solid rgb(42,40,41); /* rgb(171,164,169); */
346
+ }
347
+
348
+ /*
349
+ channel list
350
+ */
351
+ QListWidget {
352
+ show-decoration-selected: 1;
353
+ border: 1px solid rgb(124,124,124);
354
+ background: rgb(30,30,30);
355
+ }
356
+
357
+ QListWidget::item:selected {
358
+ color: white;
359
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
360
+ stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
361
+ stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
362
+ }
363
+
364
+ QListWidget::item:hover {
365
+ color: rgb(255, 84, 174);
366
+ }
367
+
368
+
369
+
370
+ /*
371
+ [All/Hightlights/Most Popular] Switch Button
372
+ */
373
+ QPushButton#switchButton, QToolBox#channelToolBox::tab {
374
+ color: white;
375
+ font: bold normal "Nimbus Sans L";
376
+ border: 2px solid rgb(0,0,0);
377
+ border-radius: 4px;
378
+ padding: 4px 4px;
379
+ margin: 1px;
380
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
381
+ stop:0 rgb(0, 0, 0), stop:0.48 rgb(0, 0, 0),
382
+ stop:0.5 rgb(59, 59, 59), stop:1 rgb(125, 125, 125));
383
+ min-width: 1.2em;
384
+ }
385
+
386
+ QPushButton#switchButton:checked, QToolBox#channelToolBox::tab:selected {
387
+ color: white;
388
+ border-color: rgb(139,0,76);
389
+ background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
390
+ stop:0 rgb(148, 0, 84), stop:0.48 rgb(148, 0, 84),
391
+ stop:0.5 rgb(167, 46, 114), stop:1 rgb(195, 113, 155));
392
+ }
393
+
394
+ QPushButton#switchButton:hover, QToolBox#channelToolBox::tab:hover {
395
+ color: rgb(255, 84, 174);
396
+ }
397
+
398
+
399
+ /*
400
+ play & download button
401
+ */
402
+ QPushButton#downloadButton, #playButton {
403
+ color: white;
404
+ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
405
+ stop:0 rgb(0, 0, 0), stop:0.48 rgb(0, 0, 0),
406
+ stop:0.5 rgb(59, 59, 59), stop:1 rgb(125, 125, 125));
407
+ border-radius: 14px;
408
+ border: 2px solid rgb(0, 229, 65);
409
+ font: bold 10pt "Nimbus Sans L";
410
+ padding: 5px 20px;
411
+ }
412
+
413
+ QPushButton#downloadButton:hover, #playButton:hover {
414
+ color: rgb(170, 255, 0);
415
+ }
416
+
417
+ QPushButton#pushButtonDownLoad:pressed, #playButton:pressed {
418
+ color: rgb(255, 84, 174);
419
+ border-color: rgb(230, 0, 246);
420
+ }
421
+
422
+ QWebView {
423
+ color: white;
424
+ }