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
52 changes: 52 additions & 0 deletions files/style.qss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/* style.qss */
QMainWindow, QDialog {
background-color: #F3F3F3;
}

QWidget {
font-family: "Segoe UI", sans-serif;
font-size: 10pt;
color: #000000;
}

QPushButton {
background-color: #E1E1E1;
border: 1px solid #ADADAD;
padding: 5px 15px;
border-radius: 4px;
}

QPushButton:hover {
background-color: #E5F1FB;
border: 1px solid #0078D4;
}

QPushButton:pressed {
background-color: #CCE4F7;
border: 1px solid #005499;
}

QLineEdit, QTextEdit, QComboBox, QDateEdit {
background-color: #FFFFFF;
border: 1px solid #CCCCCC;
padding: 3px;
border-radius: 2px;
}

QLineEdit:focus, QTextEdit:focus, QComboBox:focus, QDateEdit:focus {
border: 1px solid #0078D4;
}

QTableView, QTableWidget {
background-color: #FFFFFF;
alternate-background-color: #F9F9F9;
border: 1px solid #CCCCCC;
gridline-color: #E0E0E0;
}

QHeaderView::section {
background-color: #F0F0F0;
padding: 4px;
border: 1px solid #CCCCCC;
font-weight: bold;
}
26 changes: 18 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ def show_main_window():
None: Функция не возвращает значений, а лишь выполняет отображение главного окна.
"""
window = MainWindow()
QtWidgets.QApplication.instance().main_window = window
window.showMaximized()
user_full_name = f"{system.user.last_name} {system.user.first_name}"
window.setWindowTitle(
f"PyMASL ver. {system.software_version}. Пользователь: {user_full_name}. БД: {system.database}"
)
window.main_button_all_sales()
window.exec_()



Expand Down Expand Up @@ -429,7 +429,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 +2344,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 +2523,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 @@ -2835,7 +2835,7 @@ def main_edit_client(self) -> None:
# Сохраняем параметры данных об уже существующем клиенте
system.client_update = 1
logger.info(f"Обновляем информацию о клиенте")
client.exec_()
client.exec()

def main_filter_clear(self) -> None:
"""
Expand Down Expand Up @@ -3130,7 +3130,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 +3316,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 +3556,17 @@ class Payment:
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
app.setStyle("Fusion")

# Загрузка и применение стилей
qss_path = Path(__file__).parent / "files" / "style.qss"
try:
with open(qss_path, "r", encoding="utf-8") as f:
app.setStyleSheet(f.read())
except Exception as e:
logger.warning(f"Не удалось загрузить файл стилей: {e}")

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