meccatronis commited on
Commit
9bf0f20
·
verified ·
1 Parent(s): 70a9e6b

Upload gui/styles.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. gui/styles.py +626 -0
gui/styles.py ADDED
@@ -0,0 +1,626 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ GUI Styles Module
3
+ =================
4
+
5
+ Defines styles and themes for the Android Data Recovery GUI.
6
+ """
7
+
8
+ # Dark theme stylesheet
9
+ DARK_THEME = """
10
+ QMainWindow {
11
+ background-color: #1e1e1e;
12
+ }
13
+
14
+ QWidget {
15
+ background-color: #1e1e1e;
16
+ color: #ffffff;
17
+ font-family: 'Segoe UI', 'Ubuntu', sans-serif;
18
+ font-size: 13px;
19
+ }
20
+
21
+ QLabel {
22
+ color: #ffffff;
23
+ padding: 2px;
24
+ }
25
+
26
+ QLabel#title {
27
+ font-size: 18px;
28
+ font-weight: bold;
29
+ color: #4fc3f7;
30
+ }
31
+
32
+ QLabel#subtitle {
33
+ font-size: 14px;
34
+ color: #b0b0b0;
35
+ }
36
+
37
+ QLabel#status {
38
+ color: #81c784;
39
+ font-weight: bold;
40
+ }
41
+
42
+ QLabel#error {
43
+ color: #ef5350;
44
+ font-weight: bold;
45
+ }
46
+
47
+ QPushButton {
48
+ background-color: #2196f3;
49
+ color: white;
50
+ border: none;
51
+ padding: 10px 20px;
52
+ border-radius: 5px;
53
+ font-weight: bold;
54
+ min-width: 100px;
55
+ }
56
+
57
+ QPushButton:hover {
58
+ background-color: #1976d2;
59
+ }
60
+
61
+ QPushButton:pressed {
62
+ background-color: #0d47a1;
63
+ }
64
+
65
+ QPushButton:disabled {
66
+ background-color: #424242;
67
+ color: #757575;
68
+ }
69
+
70
+ QPushButton#primary {
71
+ background-color: #4caf50;
72
+ }
73
+
74
+ QPushButton#primary:hover {
75
+ background-color: #388e3c;
76
+ }
77
+
78
+ QPushButton#danger {
79
+ background-color: #f44336;
80
+ }
81
+
82
+ QPushButton#danger:hover {
83
+ background-color: #d32f2f;
84
+ }
85
+
86
+ QPushButton#secondary {
87
+ background-color: #607d8b;
88
+ }
89
+
90
+ QPushButton#secondary:hover {
91
+ background-color: #455a64;
92
+ }
93
+
94
+ QLineEdit {
95
+ background-color: #2d2d2d;
96
+ border: 2px solid #424242;
97
+ border-radius: 5px;
98
+ padding: 8px;
99
+ color: #ffffff;
100
+ }
101
+
102
+ QLineEdit:focus {
103
+ border-color: #2196f3;
104
+ }
105
+
106
+ QTextEdit {
107
+ background-color: #2d2d2d;
108
+ border: 2px solid #424242;
109
+ border-radius: 5px;
110
+ padding: 8px;
111
+ color: #ffffff;
112
+ }
113
+
114
+ QComboBox {
115
+ background-color: #2d2d2d;
116
+ border: 2px solid #424242;
117
+ border-radius: 5px;
118
+ padding: 8px;
119
+ color: #ffffff;
120
+ min-width: 150px;
121
+ }
122
+
123
+ QComboBox:hover {
124
+ border-color: #2196f3;
125
+ }
126
+
127
+ QComboBox::drop-down {
128
+ border: none;
129
+ width: 30px;
130
+ }
131
+
132
+ QComboBox::down-arrow {
133
+ image: none;
134
+ border-left: 5px solid transparent;
135
+ border-right: 5px solid transparent;
136
+ border-top: 8px solid #ffffff;
137
+ margin-right: 10px;
138
+ }
139
+
140
+ QComboBox QAbstractItemView {
141
+ background-color: #2d2d2d;
142
+ border: 2px solid #424242;
143
+ selection-background-color: #2196f3;
144
+ }
145
+
146
+ QCheckBox {
147
+ spacing: 10px;
148
+ }
149
+
150
+ QCheckBox::indicator {
151
+ width: 20px;
152
+ height: 20px;
153
+ border-radius: 4px;
154
+ border: 2px solid #424242;
155
+ background-color: #2d2d2d;
156
+ }
157
+
158
+ QCheckBox::indicator:checked {
159
+ background-color: #4caf50;
160
+ border-color: #4caf50;
161
+ }
162
+
163
+ QCheckBox::indicator:hover {
164
+ border-color: #2196f3;
165
+ }
166
+
167
+ QRadioButton {
168
+ spacing: 10px;
169
+ }
170
+
171
+ QRadioButton::indicator {
172
+ width: 20px;
173
+ height: 20px;
174
+ border-radius: 10px;
175
+ border: 2px solid #424242;
176
+ background-color: #2d2d2d;
177
+ }
178
+
179
+ QRadioButton::indicator:checked {
180
+ background-color: #4caf50;
181
+ border-color: #4caf50;
182
+ }
183
+
184
+ QProgressBar {
185
+ background-color: #2d2d2d;
186
+ border: none;
187
+ border-radius: 5px;
188
+ height: 20px;
189
+ text-align: center;
190
+ }
191
+
192
+ QProgressBar::chunk {
193
+ background-color: #4caf50;
194
+ border-radius: 5px;
195
+ }
196
+
197
+ QTableWidget {
198
+ background-color: #2d2d2d;
199
+ border: 2px solid #424242;
200
+ border-radius: 5px;
201
+ gridline-color: #424242;
202
+ }
203
+
204
+ QTableWidget::item {
205
+ padding: 8px;
206
+ }
207
+
208
+ QTableWidget::item:selected {
209
+ background-color: #2196f3;
210
+ }
211
+
212
+ QHeaderView::section {
213
+ background-color: #424242;
214
+ color: #ffffff;
215
+ padding: 10px;
216
+ border: none;
217
+ font-weight: bold;
218
+ }
219
+
220
+ QTreeWidget {
221
+ background-color: #2d2d2d;
222
+ border: 2px solid #424242;
223
+ border-radius: 5px;
224
+ }
225
+
226
+ QTreeWidget::item {
227
+ padding: 5px;
228
+ }
229
+
230
+ QTreeWidget::item:selected {
231
+ background-color: #2196f3;
232
+ }
233
+
234
+ QTreeWidget::branch:has-children:!has-siblings:closed,
235
+ QTreeWidget::branch:closed:has-children:has-siblings {
236
+ border-image: none;
237
+ image: none;
238
+ }
239
+
240
+ QTreeWidget::branch:open:has-children:!has-siblings,
241
+ QTreeWidget::branch:open:has-children:has-siblings {
242
+ border-image: none;
243
+ image: none;
244
+ }
245
+
246
+ QListWidget {
247
+ background-color: #2d2d2d;
248
+ border: 2px solid #424242;
249
+ border-radius: 5px;
250
+ }
251
+
252
+ QListWidget::item {
253
+ padding: 10px;
254
+ border-bottom: 1px solid #424242;
255
+ }
256
+
257
+ QListWidget::item:selected {
258
+ background-color: #2196f3;
259
+ }
260
+
261
+ QListWidget::item:hover {
262
+ background-color: #3d3d3d;
263
+ }
264
+
265
+ QTabWidget::pane {
266
+ border: 2px solid #424242;
267
+ border-radius: 5px;
268
+ background-color: #2d2d2d;
269
+ }
270
+
271
+ QTabBar::tab {
272
+ background-color: #2d2d2d;
273
+ color: #b0b0b0;
274
+ padding: 12px 20px;
275
+ border-top-left-radius: 5px;
276
+ border-top-right-radius: 5px;
277
+ margin-right: 2px;
278
+ }
279
+
280
+ QTabBar::tab:selected {
281
+ background-color: #424242;
282
+ color: #ffffff;
283
+ }
284
+
285
+ QTabBar::tab:hover:!selected {
286
+ background-color: #3d3d3d;
287
+ }
288
+
289
+ QScrollBar:vertical {
290
+ background-color: #2d2d2d;
291
+ width: 12px;
292
+ border-radius: 6px;
293
+ }
294
+
295
+ QScrollBar::handle:vertical {
296
+ background-color: #424242;
297
+ border-radius: 6px;
298
+ min-height: 30px;
299
+ }
300
+
301
+ QScrollBar::handle:vertical:hover {
302
+ background-color: #616161;
303
+ }
304
+
305
+ QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {
306
+ height: 0px;
307
+ }
308
+
309
+ QScrollBar:horizontal {
310
+ background-color: #2d2d2d;
311
+ height: 12px;
312
+ border-radius: 6px;
313
+ }
314
+
315
+ QScrollBar::handle:horizontal {
316
+ background-color: #424242;
317
+ border-radius: 6px;
318
+ min-width: 30px;
319
+ }
320
+
321
+ QScrollBar::handle:horizontal:hover {
322
+ background-color: #616161;
323
+ }
324
+
325
+ QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal {
326
+ width: 0px;
327
+ }
328
+
329
+ QGroupBox {
330
+ border: 2px solid #424242;
331
+ border-radius: 5px;
332
+ margin-top: 15px;
333
+ padding-top: 15px;
334
+ font-weight: bold;
335
+ }
336
+
337
+ QGroupBox::title {
338
+ subcontrol-origin: margin;
339
+ subcontrol-position: top left;
340
+ padding: 5px 10px;
341
+ color: #4fc3f7;
342
+ }
343
+
344
+ QSplitter::handle {
345
+ background-color: #424242;
346
+ }
347
+
348
+ QSplitter::handle:horizontal {
349
+ width: 2px;
350
+ }
351
+
352
+ QSplitter::handle:vertical {
353
+ height: 2px;
354
+ }
355
+
356
+ QToolTip {
357
+ background-color: #424242;
358
+ color: #ffffff;
359
+ border: 1px solid #616161;
360
+ border-radius: 4px;
361
+ padding: 5px;
362
+ }
363
+
364
+ QMessageBox {
365
+ background-color: #2d2d2d;
366
+ }
367
+
368
+ QMessageBox QLabel {
369
+ color: #ffffff;
370
+ }
371
+
372
+ QDialog {
373
+ background-color: #2d2d2d;
374
+ }
375
+
376
+ QStatusBar {
377
+ background-color: #1e1e1e;
378
+ color: #b0b0b0;
379
+ }
380
+
381
+ QMenuBar {
382
+ background-color: #1e1e1e;
383
+ color: #ffffff;
384
+ }
385
+
386
+ QMenuBar::item:selected {
387
+ background-color: #424242;
388
+ }
389
+
390
+ QMenu {
391
+ background-color: #2d2d2d;
392
+ border: 1px solid #424242;
393
+ }
394
+
395
+ QMenu::item {
396
+ padding: 8px 30px;
397
+ }
398
+
399
+ QMenu::item:selected {
400
+ background-color: #2196f3;
401
+ }
402
+
403
+ QMenu::separator {
404
+ height: 1px;
405
+ background-color: #424242;
406
+ margin: 5px 0px;
407
+ }
408
+ """
409
+
410
+ # Light theme stylesheet
411
+ LIGHT_THEME = """
412
+ QMainWindow {
413
+ background-color: #f5f5f5;
414
+ }
415
+
416
+ QWidget {
417
+ background-color: #f5f5f5;
418
+ color: #212121;
419
+ font-family: 'Segoe UI', 'Ubuntu', sans-serif;
420
+ font-size: 13px;
421
+ }
422
+
423
+ QLabel {
424
+ color: #212121;
425
+ padding: 2px;
426
+ }
427
+
428
+ QLabel#title {
429
+ font-size: 18px;
430
+ font-weight: bold;
431
+ color: #1976d2;
432
+ }
433
+
434
+ QLabel#subtitle {
435
+ font-size: 14px;
436
+ color: #757575;
437
+ }
438
+
439
+ QLabel#status {
440
+ color: #388e3c;
441
+ font-weight: bold;
442
+ }
443
+
444
+ QLabel#error {
445
+ color: #d32f2f;
446
+ font-weight: bold;
447
+ }
448
+
449
+ QPushButton {
450
+ background-color: #2196f3;
451
+ color: white;
452
+ border: none;
453
+ padding: 10px 20px;
454
+ border-radius: 5px;
455
+ font-weight: bold;
456
+ min-width: 100px;
457
+ }
458
+
459
+ QPushButton:hover {
460
+ background-color: #1976d2;
461
+ }
462
+
463
+ QPushButton:pressed {
464
+ background-color: #0d47a1;
465
+ }
466
+
467
+ QPushButton:disabled {
468
+ background-color: #bdbdbd;
469
+ color: #757575;
470
+ }
471
+
472
+ QPushButton#primary {
473
+ background-color: #4caf50;
474
+ }
475
+
476
+ QPushButton#primary:hover {
477
+ background-color: #388e3c;
478
+ }
479
+
480
+ QPushButton#danger {
481
+ background-color: #f44336;
482
+ }
483
+
484
+ QPushButton#danger:hover {
485
+ background-color: #d32f2f;
486
+ }
487
+
488
+ QLineEdit {
489
+ background-color: #ffffff;
490
+ border: 2px solid #e0e0e0;
491
+ border-radius: 5px;
492
+ padding: 8px;
493
+ color: #212121;
494
+ }
495
+
496
+ QLineEdit:focus {
497
+ border-color: #2196f3;
498
+ }
499
+
500
+ QProgressBar {
501
+ background-color: #e0e0e0;
502
+ border: none;
503
+ border-radius: 5px;
504
+ height: 20px;
505
+ text-align: center;
506
+ }
507
+
508
+ QProgressBar::chunk {
509
+ background-color: #4caf50;
510
+ border-radius: 5px;
511
+ }
512
+
513
+ QTableWidget {
514
+ background-color: #ffffff;
515
+ border: 2px solid #e0e0e0;
516
+ border-radius: 5px;
517
+ gridline-color: #e0e0e0;
518
+ }
519
+
520
+ QTableWidget::item:selected {
521
+ background-color: #2196f3;
522
+ color: white;
523
+ }
524
+
525
+ QHeaderView::section {
526
+ background-color: #e0e0e0;
527
+ color: #212121;
528
+ padding: 10px;
529
+ border: none;
530
+ font-weight: bold;
531
+ }
532
+
533
+ QTreeWidget {
534
+ background-color: #ffffff;
535
+ border: 2px solid #e0e0e0;
536
+ border-radius: 5px;
537
+ }
538
+
539
+ QTreeWidget::item:selected {
540
+ background-color: #2196f3;
541
+ color: white;
542
+ }
543
+
544
+ QListWidget {
545
+ background-color: #ffffff;
546
+ border: 2px solid #e0e0e0;
547
+ border-radius: 5px;
548
+ }
549
+
550
+ QListWidget::item:selected {
551
+ background-color: #2196f3;
552
+ color: white;
553
+ }
554
+
555
+ QTabWidget::pane {
556
+ border: 2px solid #e0e0e0;
557
+ border-radius: 5px;
558
+ background-color: #ffffff;
559
+ }
560
+
561
+ QTabBar::tab {
562
+ background-color: #e0e0e0;
563
+ color: #757575;
564
+ padding: 12px 20px;
565
+ border-top-left-radius: 5px;
566
+ border-top-right-radius: 5px;
567
+ margin-right: 2px;
568
+ }
569
+
570
+ QTabBar::tab:selected {
571
+ background-color: #ffffff;
572
+ color: #212121;
573
+ }
574
+
575
+ QGroupBox {
576
+ border: 2px solid #e0e0e0;
577
+ border-radius: 5px;
578
+ margin-top: 15px;
579
+ padding-top: 15px;
580
+ font-weight: bold;
581
+ }
582
+
583
+ QGroupBox::title {
584
+ subcontrol-origin: margin;
585
+ subcontrol-position: top left;
586
+ padding: 5px 10px;
587
+ color: #1976d2;
588
+ }
589
+ """
590
+
591
+ # Icon paths (using emoji as fallback)
592
+ ICONS = {
593
+ 'device': '📱',
594
+ 'android': '🤖',
595
+ 'scan': '🔍',
596
+ 'recover': '💾',
597
+ 'settings': '⚙️',
598
+ 'folder': '📁',
599
+ 'file': '📄',
600
+ 'image': '🖼️',
601
+ 'video': '🎬',
602
+ 'audio': '🎵',
603
+ 'document': '📝',
604
+ 'database': '🗄️',
605
+ 'contact': '👤',
606
+ 'message': '💬',
607
+ 'call': '📞',
608
+ 'whatsapp': '💬',
609
+ 'success': '✅',
610
+ 'error': '❌',
611
+ 'warning': '⚠️',
612
+ 'info': 'ℹ️',
613
+ 'refresh': '🔄',
614
+ 'connect': '🔗',
615
+ 'disconnect': '🔌',
616
+ 'start': '▶️',
617
+ 'stop': '⏹️',
618
+ 'pause': '⏸️',
619
+ 'export': '📤',
620
+ 'help': '❓',
621
+ 'exit': '🚪',
622
+ }
623
+
624
+ def get_icon(name: str) -> str:
625
+ """Get icon for the given name."""
626
+ return ICONS.get(name, '•')