meccatronis's picture
Upload gui/styles.py with huggingface_hub
9bf0f20 verified
Raw History Blame Contribute Delete
10.3 kB
"""
GUI Styles Module
=================
Defines styles and themes for the Android Data Recovery GUI.
"""
# Dark theme stylesheet
DARK_THEME = """
QMainWindow {
background-color: #1e1e1e;
}
QWidget {
background-color: #1e1e1e;
color: #ffffff;
font-family: 'Segoe UI', 'Ubuntu', sans-serif;
font-size: 13px;
}
QLabel {
color: #ffffff;
padding: 2px;
}
QLabel#title {
font-size: 18px;
font-weight: bold;
color: #4fc3f7;
}
QLabel#subtitle {
font-size: 14px;
color: #b0b0b0;
}
QLabel#status {
color: #81c784;
font-weight: bold;
}
QLabel#error {
color: #ef5350;
font-weight: bold;
}
QPushButton {
background-color: #2196f3;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
font-weight: bold;
min-width: 100px;
}
QPushButton:hover {
background-color: #1976d2;
}
QPushButton:pressed {
background-color: #0d47a1;
}
QPushButton:disabled {
background-color: #424242;
color: #757575;
}
QPushButton#primary {
background-color: #4caf50;
}
QPushButton#primary:hover {
background-color: #388e3c;
}
QPushButton#danger {
background-color: #f44336;
}
QPushButton#danger:hover {
background-color: #d32f2f;
}
QPushButton#secondary {
background-color: #607d8b;
}
QPushButton#secondary:hover {
background-color: #455a64;
}
QLineEdit {
background-color: #2d2d2d;
border: 2px solid #424242;
border-radius: 5px;
padding: 8px;
color: #ffffff;
}
QLineEdit:focus {
border-color: #2196f3;
}
QTextEdit {
background-color: #2d2d2d;
border: 2px solid #424242;
border-radius: 5px;
padding: 8px;
color: #ffffff;
}
QComboBox {
background-color: #2d2d2d;
border: 2px solid #424242;
border-radius: 5px;
padding: 8px;
color: #ffffff;
min-width: 150px;
}
QComboBox:hover {
border-color: #2196f3;
}
QComboBox::drop-down {
border: none;
width: 30px;
}
QComboBox::down-arrow {
image: none;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 8px solid #ffffff;
margin-right: 10px;
}
QComboBox QAbstractItemView {
background-color: #2d2d2d;
border: 2px solid #424242;
selection-background-color: #2196f3;
}
QCheckBox {
spacing: 10px;
}
QCheckBox::indicator {
width: 20px;
height: 20px;
border-radius: 4px;
border: 2px solid #424242;
background-color: #2d2d2d;
}
QCheckBox::indicator:checked {
background-color: #4caf50;
border-color: #4caf50;
}
QCheckBox::indicator:hover {
border-color: #2196f3;
}
QRadioButton {
spacing: 10px;
}
QRadioButton::indicator {
width: 20px;
height: 20px;
border-radius: 10px;
border: 2px solid #424242;
background-color: #2d2d2d;
}
QRadioButton::indicator:checked {
background-color: #4caf50;
border-color: #4caf50;
}
QProgressBar {
background-color: #2d2d2d;
border: none;
border-radius: 5px;
height: 20px;
text-align: center;
}
QProgressBar::chunk {
background-color: #4caf50;
border-radius: 5px;
}
QTableWidget {
background-color: #2d2d2d;
border: 2px solid #424242;
border-radius: 5px;
gridline-color: #424242;
}
QTableWidget::item {
padding: 8px;
}
QTableWidget::item:selected {
background-color: #2196f3;
}
QHeaderView::section {
background-color: #424242;
color: #ffffff;
padding: 10px;
border: none;
font-weight: bold;
}
QTreeWidget {
background-color: #2d2d2d;
border: 2px solid #424242;
border-radius: 5px;
}
QTreeWidget::item {
padding: 5px;
}
QTreeWidget::item:selected {
background-color: #2196f3;
}
QTreeWidget::branch:has-children:!has-siblings:closed,
QTreeWidget::branch:closed:has-children:has-siblings {
border-image: none;
image: none;
}
QTreeWidget::branch:open:has-children:!has-siblings,
QTreeWidget::branch:open:has-children:has-siblings {
border-image: none;
image: none;
}
QListWidget {
background-color: #2d2d2d;
border: 2px solid #424242;
border-radius: 5px;
}
QListWidget::item {
padding: 10px;
border-bottom: 1px solid #424242;
}
QListWidget::item:selected {
background-color: #2196f3;
}
QListWidget::item:hover {
background-color: #3d3d3d;
}
QTabWidget::pane {
border: 2px solid #424242;
border-radius: 5px;
background-color: #2d2d2d;
}
QTabBar::tab {
background-color: #2d2d2d;
color: #b0b0b0;
padding: 12px 20px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
margin-right: 2px;
}
QTabBar::tab:selected {
background-color: #424242;
color: #ffffff;
}
QTabBar::tab:hover:!selected {
background-color: #3d3d3d;
}
QScrollBar:vertical {
background-color: #2d2d2d;
width: 12px;
border-radius: 6px;
}
QScrollBar::handle:vertical {
background-color: #424242;
border-radius: 6px;
min-height: 30px;
}
QScrollBar::handle:vertical:hover {
background-color: #616161;
}
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {
height: 0px;
}
QScrollBar:horizontal {
background-color: #2d2d2d;
height: 12px;
border-radius: 6px;
}
QScrollBar::handle:horizontal {
background-color: #424242;
border-radius: 6px;
min-width: 30px;
}
QScrollBar::handle:horizontal:hover {
background-color: #616161;
}
QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal {
width: 0px;
}
QGroupBox {
border: 2px solid #424242;
border-radius: 5px;
margin-top: 15px;
padding-top: 15px;
font-weight: bold;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top left;
padding: 5px 10px;
color: #4fc3f7;
}
QSplitter::handle {
background-color: #424242;
}
QSplitter::handle:horizontal {
width: 2px;
}
QSplitter::handle:vertical {
height: 2px;
}
QToolTip {
background-color: #424242;
color: #ffffff;
border: 1px solid #616161;
border-radius: 4px;
padding: 5px;
}
QMessageBox {
background-color: #2d2d2d;
}
QMessageBox QLabel {
color: #ffffff;
}
QDialog {
background-color: #2d2d2d;
}
QStatusBar {
background-color: #1e1e1e;
color: #b0b0b0;
}
QMenuBar {
background-color: #1e1e1e;
color: #ffffff;
}
QMenuBar::item:selected {
background-color: #424242;
}
QMenu {
background-color: #2d2d2d;
border: 1px solid #424242;
}
QMenu::item {
padding: 8px 30px;
}
QMenu::item:selected {
background-color: #2196f3;
}
QMenu::separator {
height: 1px;
background-color: #424242;
margin: 5px 0px;
}
"""
# Light theme stylesheet
LIGHT_THEME = """
QMainWindow {
background-color: #f5f5f5;
}
QWidget {
background-color: #f5f5f5;
color: #212121;
font-family: 'Segoe UI', 'Ubuntu', sans-serif;
font-size: 13px;
}
QLabel {
color: #212121;
padding: 2px;
}
QLabel#title {
font-size: 18px;
font-weight: bold;
color: #1976d2;
}
QLabel#subtitle {
font-size: 14px;
color: #757575;
}
QLabel#status {
color: #388e3c;
font-weight: bold;
}
QLabel#error {
color: #d32f2f;
font-weight: bold;
}
QPushButton {
background-color: #2196f3;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
font-weight: bold;
min-width: 100px;
}
QPushButton:hover {
background-color: #1976d2;
}
QPushButton:pressed {
background-color: #0d47a1;
}
QPushButton:disabled {
background-color: #bdbdbd;
color: #757575;
}
QPushButton#primary {
background-color: #4caf50;
}
QPushButton#primary:hover {
background-color: #388e3c;
}
QPushButton#danger {
background-color: #f44336;
}
QPushButton#danger:hover {
background-color: #d32f2f;
}
QLineEdit {
background-color: #ffffff;
border: 2px solid #e0e0e0;
border-radius: 5px;
padding: 8px;
color: #212121;
}
QLineEdit:focus {
border-color: #2196f3;
}
QProgressBar {
background-color: #e0e0e0;
border: none;
border-radius: 5px;
height: 20px;
text-align: center;
}
QProgressBar::chunk {
background-color: #4caf50;
border-radius: 5px;
}
QTableWidget {
background-color: #ffffff;
border: 2px solid #e0e0e0;
border-radius: 5px;
gridline-color: #e0e0e0;
}
QTableWidget::item:selected {
background-color: #2196f3;
color: white;
}
QHeaderView::section {
background-color: #e0e0e0;
color: #212121;
padding: 10px;
border: none;
font-weight: bold;
}
QTreeWidget {
background-color: #ffffff;
border: 2px solid #e0e0e0;
border-radius: 5px;
}
QTreeWidget::item:selected {
background-color: #2196f3;
color: white;
}
QListWidget {
background-color: #ffffff;
border: 2px solid #e0e0e0;
border-radius: 5px;
}
QListWidget::item:selected {
background-color: #2196f3;
color: white;
}
QTabWidget::pane {
border: 2px solid #e0e0e0;
border-radius: 5px;
background-color: #ffffff;
}
QTabBar::tab {
background-color: #e0e0e0;
color: #757575;
padding: 12px 20px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
margin-right: 2px;
}
QTabBar::tab:selected {
background-color: #ffffff;
color: #212121;
}
QGroupBox {
border: 2px solid #e0e0e0;
border-radius: 5px;
margin-top: 15px;
padding-top: 15px;
font-weight: bold;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top left;
padding: 5px 10px;
color: #1976d2;
}
"""
# Icon paths (using emoji as fallback)
ICONS = {
'device': '📱',
'android': '🤖',
'scan': '🔍',
'recover': '💾',
'settings': '⚙️',
'folder': '📁',
'file': '📄',
'image': '🖼️',
'video': '🎬',
'audio': '🎵',
'document': '📝',
'database': '🗄️',
'contact': '👤',
'message': '💬',
'call': '📞',
'whatsapp': '💬',
'success': '✅',
'error': '❌',
'warning': '⚠️',
'info': 'ℹ️',
'refresh': '🔄',
'connect': '🔗',
'disconnect': '🔌',
'start': '▶️',
'stop': '⏹️',
'pause': '⏸️',
'export': '📤',
'help': '❓',
'exit': '🚪',
}
def get_icon(name: str) -> str:
"""Get icon for the given name."""
return ICONS.get(name, '•')