Обновить интерфейс: улучшить стиль и добавить статусную строку
This commit is contained in:
1 parent
53dcb06b11
commit
dc1d7be0f4
1 file changed
+57
-22
+57
-22
@@ -1,44 +1,79 @@
|
||||
from PyQt6.QtWidgets import (
|
||||
QApplication, QVBoxLayout, QHBoxLayout, QPushButton, QCheckBox, QLabel, QWidget, QFileDialog
|
||||
from PyQt5.QtWidgets import (
|
||||
QApplication, QVBoxLayout, QHBoxLayout, QPushButton,
|
||||
QCheckBox, QLabel, QWidget, QFileDialog, QStatusBar
|
||||
)
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QIcon
|
||||
import sys
|
||||
|
||||
class MainWindow(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setWindowTitle("Шифрование")
|
||||
self.setFixedSize(400, 200)
|
||||
self.setWindowTitle("Безопасное шифрование файлов")
|
||||
self.setFixedSize(500, 250)
|
||||
self.setStyleSheet("""
|
||||
QWidget {
|
||||
background-color: #f0f0f0;
|
||||
font-family: 'Segoe UI', Arial;
|
||||
}
|
||||
QPushButton {
|
||||
background-color: #0d6efd;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
min-width: 150px;
|
||||
margin: 5px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: #0b5ed7;
|
||||
}
|
||||
QCheckBox {
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
""")
|
||||
|
||||
# Main layout
|
||||
# Main layout with margins
|
||||
main_layout = QVBoxLayout()
|
||||
main_layout.setContentsMargins(20, 20, 20, 20)
|
||||
main_layout.setSpacing(15)
|
||||
|
||||
# Buttons for encryption and decryption
|
||||
# Title
|
||||
title = QLabel("Шифрование файлов")
|
||||
title.setStyleSheet("font-size: 18px; font-weight: bold; color: #333;")
|
||||
title.setAlignment(Qt.AlignCenter)
|
||||
main_layout.addWidget(title)
|
||||
|
||||
# Buttons layout
|
||||
button_layout = QHBoxLayout()
|
||||
self.encrypt_button = QPushButton("ЗАШИФРОВАТЬ")
|
||||
self.encrypt_folder_button = QPushButton("ЗАШИФРОВАТЬ папку")
|
||||
self.decrypt_button = QPushButton("ДЕШИФРОВАТЬ")
|
||||
button_layout.setSpacing(10)
|
||||
|
||||
self.encrypt_button = QPushButton("🔒 Зашифровать")
|
||||
self.encrypt_folder_button = QPushButton("📁 Зашифровать папку")
|
||||
self.decrypt_button = QPushButton("🔓 Дешифровать")
|
||||
|
||||
button_layout.addWidget(self.encrypt_button)
|
||||
button_layout.addWidget(self.encrypt_folder_button)
|
||||
button_layout.addWidget(self.decrypt_button)
|
||||
|
||||
main_layout.addLayout(button_layout)
|
||||
|
||||
# Checkboxes
|
||||
self.delete_original_checkbox = QCheckBox("Удалять оригинал")
|
||||
self.create_vault_checkbox = QCheckBox("Создать VAULT")
|
||||
|
||||
# Checkbox with modern style
|
||||
self.delete_original_checkbox = QCheckBox("🗑️ Удалять оригинал")
|
||||
self.delete_original_checkbox.setStyleSheet("""
|
||||
QCheckBox::indicator {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
""")
|
||||
main_layout.addWidget(self.delete_original_checkbox)
|
||||
main_layout.addWidget(self.create_vault_checkbox)
|
||||
|
||||
# Save folder label
|
||||
self.save_folder_label = QLabel("ПАПКА ДЛЯ СОХРАНЕНИЯ")
|
||||
main_layout.addWidget(self.save_folder_label)
|
||||
|
||||
# Add functionality for selecting save folder
|
||||
self.save_folder_button = QPushButton("Выбрать папку")
|
||||
self.save_folder_button.clicked.connect(self.select_save_folder)
|
||||
main_layout.addWidget(self.save_folder_button)
|
||||
# Status bar
|
||||
self.status_bar = QStatusBar()
|
||||
self.status_bar.setStyleSheet("color: #666;")
|
||||
self.status_bar.showMessage("Готов к работе")
|
||||
main_layout.addWidget(self.status_bar)
|
||||
|
||||
self.setLayout(main_layout)
|
||||
|
||||
|
||||
Reference in new issue
Block a user