Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions files/style.qss
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/* style.qss - Windows 10/11 Light Theme */

/* Global settings */
QWidget {
font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
color: #000000;
}

/* Main Windows and Dialogs Background */
QMainWindow, QDialog {
background-color: #F3F3F3;
}

/* Buttons */
QPushButton {
background-color: #0078D4; /* Windows blue accent */
color: #FFFFFF;
border: 1px solid #005A9E;
border-radius: 4px;
padding: 6px 12px;
}

QPushButton:hover {
background-color: #005A9E; /* Slightly darker on hover */
}

QPushButton:pressed {
background-color: #004578; /* Even darker on press */
}

QPushButton:disabled {
background-color: #CCCCCC;
color: #666666;
border: 1px solid #AAAAAA;
}

/* Input Fields (QLineEdit, QTextEdit, QComboBox) */
QLineEdit, QTextEdit, QComboBox, QDateEdit, QTimeEdit, QDateTimeEdit {
background-color: #FFFFFF;
border: 1px solid #CCCCCC;
border-radius: 4px;
padding: 4px;
selection-background-color: #0078D4;
selection-color: #FFFFFF;
}

QLineEdit:focus, QTextEdit:focus, QComboBox:focus, QDateEdit:focus, QTimeEdit:focus, QDateTimeEdit:focus {
border: 1px solid #0078D4; /* Accent color border on focus */
}

QLineEdit:disabled, QTextEdit:disabled, QComboBox:disabled, QDateEdit:disabled {
background-color: #E6E6E6;
color: #888888;
}

/* Table Widget */
QTableWidget {
background-color: #FFFFFF;
alternate-background-color: #F9F9F9;
border: 1px solid #CCCCCC;
gridline-color: #E0E0E0;
selection-background-color: #0078D4;
selection-color: #FFFFFF;
}

QHeaderView::section {
background-color: #F0F0F0;
border: 1px solid #CCCCCC;
padding: 4px;
font-weight: bold;
}

/* Group Boxes */
QGroupBox {
border: 1px solid #CCCCCC;
border-radius: 4px;
margin-top: 1ex; /* leave space at the top for the title */
padding-top: 10px;
}

QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top left; /* position at the top left */
padding: 0 3px;
color: #0078D4;
}

/* Labels */
QLabel {
background: transparent;
}

/* Tab Widget */
QTabWidget::pane {
border: 1px solid #CCCCCC;
background-color: #FFFFFF;
}

QTabBar::tab {
background-color: #E1E1E1;
border: 1px solid #CCCCCC;
border-bottom-color: #CCCCCC; /* same as the pane color */
border-top-left-radius: 4px;
border-top-right-radius: 4px;
min-width: 8ex;
padding: 6px 12px;
}

QTabBar::tab:selected, QTabBar::tab:hover {
background-color: #FFFFFF;
}

QTabBar::tab:selected {
border-color: #CCCCCC;
border-bottom-color: #FFFFFF; /* same as pane color */
}
31 changes: 24 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ def show_main_window():
f"PyMASL ver. {system.software_version}. Пользователь: {user_full_name}. БД: {system.database}"
)
window.main_button_all_sales()
window.exec_()
# Сохраняем ссылку на окно, чтобы сборщик мусора не удалил его
QtWidgets.QApplication.instance().main_window = window
window.showMaximized()



Expand Down Expand Up @@ -429,7 +431,7 @@ def edit_client_in_sale(self) -> None:
# Сохраняем параметры данных об уже существующем клиенте
system.client_update = 1
logger.info(f"Обновляем инф. клиента {system.client_id}")
client.exec_()
client.exec()

def adding_new_client_to_sale(self) -> None:
"""
Expand Down Expand Up @@ -2344,7 +2346,7 @@ def open_pay_form(self, txt):
# Передаем текст в форму PayForm
pay.setText(txt)

res: int = pay.exec_()
res: int = pay.exec()
# если пользователь нажал крестик или кнопку Escape,
# то по-умолчанию возвращается QDialog.Rejected
if res == QDialog.Rejected:
Expand Down Expand Up @@ -2523,7 +2525,7 @@ def get_slip(self) -> None:
slip.ui.lineEdit.setText(rrn_value)
slip.ui.textEdit.setText(load_slip)
slip.show()
slip.exec_()
slip.exec()


class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
Expand Down Expand Up @@ -3130,7 +3132,7 @@ def main_search_selected_sale(self) -> None:
system.sale_id = int(sale_number)
system.sale_tickets = client_in_sale
logger.debug(f"Билеты сохраненной продажи: {system.sale_tickets}")
sale.exec_()
sale.exec()

@logger_wraps(entry=True, exit=True, level="DEBUG")
def main_button_all_sales(self) -> None:
Expand Down Expand Up @@ -3316,7 +3318,7 @@ def main_open_sale(self) -> None:
system.sale_id = None
system.sale_status = 0 # Т.е. новая продажа
system.sale_tickets = None
sale.exec_()
sale.exec()

def main_get_statistic(self) -> None:
"""
Expand Down Expand Up @@ -3556,7 +3558,22 @@ class Payment:
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
app.setStyle("Fusion")

# Загружаем QSS стили
try:
style_path = Path(__file__).parent / "files" / "style.qss"
if style_path.exists():
with open(style_path, "r", encoding="utf-8") as style_file:
app.setStyleSheet(style_file.read())
else:
logger.warning(f"Файл стилей не найден: {style_path}")
except Exception as e:
logger.error(f"Ошибка при загрузке стилей: {e}")

auth = AuthForm()
auth.show()
auth.ui.label_9.setText(system.database)
sys.exit(app.exec())

exit_code = app.exec()
logger.complete()
sys.exit(exit_code)
Loading