Обновить интерфейс: улучшить стиль и добавить статусную строку
This commit is contained in:
1 parent
53dcb06b11
commit
dc1d7be0f4
1 file changed
+57
-22
+57
-22
@@ -1,22 +1,57 @@
|
|||||||
from PyQt6.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QApplication, QVBoxLayout, QHBoxLayout, QPushButton, QCheckBox, QLabel, QWidget, QFileDialog
|
QApplication, QVBoxLayout, QHBoxLayout, QPushButton,
|
||||||
|
QCheckBox, QLabel, QWidget, QFileDialog, QStatusBar
|
||||||
)
|
)
|
||||||
|
from PyQt5.QtCore import Qt
|
||||||
|
from PyQt5.QtGui import QIcon
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class MainWindow(QWidget):
|
class MainWindow(QWidget):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setWindowTitle("Шифрование")
|
self.setWindowTitle("Безопасное шифрование файлов")
|
||||||
self.setFixedSize(400, 200)
|
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 = 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()
|
button_layout = QHBoxLayout()
|
||||||
self.encrypt_button = QPushButton("ЗАШИФРОВАТЬ")
|
button_layout.setSpacing(10)
|
||||||
self.encrypt_folder_button = QPushButton("ЗАШИФРОВАТЬ папку")
|
|
||||||
self.decrypt_button = QPushButton("ДЕШИФРОВАТЬ")
|
self.encrypt_button = QPushButton("🔒 Зашифровать")
|
||||||
|
self.encrypt_folder_button = QPushButton("📁 Зашифровать папку")
|
||||||
|
self.decrypt_button = QPushButton("🔓 Дешифровать")
|
||||||
|
|
||||||
button_layout.addWidget(self.encrypt_button)
|
button_layout.addWidget(self.encrypt_button)
|
||||||
button_layout.addWidget(self.encrypt_folder_button)
|
button_layout.addWidget(self.encrypt_folder_button)
|
||||||
@@ -24,21 +59,21 @@ class MainWindow(QWidget):
|
|||||||
|
|
||||||
main_layout.addLayout(button_layout)
|
main_layout.addLayout(button_layout)
|
||||||
|
|
||||||
# Checkboxes
|
# Checkbox with modern style
|
||||||
self.delete_original_checkbox = QCheckBox("Удалять оригинал")
|
self.delete_original_checkbox = QCheckBox("🗑️ Удалять оригинал")
|
||||||
self.create_vault_checkbox = QCheckBox("Создать VAULT")
|
self.delete_original_checkbox.setStyleSheet("""
|
||||||
|
QCheckBox::indicator {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
""")
|
||||||
main_layout.addWidget(self.delete_original_checkbox)
|
main_layout.addWidget(self.delete_original_checkbox)
|
||||||
main_layout.addWidget(self.create_vault_checkbox)
|
|
||||||
|
|
||||||
# Save folder label
|
# Status bar
|
||||||
self.save_folder_label = QLabel("ПАПКА ДЛЯ СОХРАНЕНИЯ")
|
self.status_bar = QStatusBar()
|
||||||
main_layout.addWidget(self.save_folder_label)
|
self.status_bar.setStyleSheet("color: #666;")
|
||||||
|
self.status_bar.showMessage("Готов к работе")
|
||||||
# Add functionality for selecting save folder
|
main_layout.addWidget(self.status_bar)
|
||||||
self.save_folder_button = QPushButton("Выбрать папку")
|
|
||||||
self.save_folder_button.clicked.connect(self.select_save_folder)
|
|
||||||
main_layout.addWidget(self.save_folder_button)
|
|
||||||
|
|
||||||
self.setLayout(main_layout)
|
self.setLayout(main_layout)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user