Compare commits

..

1 Commits

Author SHA1 Message Date
8912134827 increased rounding when selecting buttons 2025-08-06 11:52:50 +06:00

View File

@ -56,15 +56,14 @@ class WineHelperGUI(QMainWindow):
) )
# Стили для оберток кнопок (для рамки выделения) # Стили для оберток кнопок (для рамки выделения)
self.FRAME_STYLE_DEFAULT = "QFrame { border: 2px solid transparent; border-radius: 2px; padding: 0px; }" self.FRAME_STYLE_DEFAULT = "QFrame { border: 2px solid transparent; border-radius: 8px; padding: 0px; }"
self.FRAME_STYLE_SELECTED = "QFrame { border: 2px solid #0078d7; border-radius: 2px; padding: 0px; }" self.FRAME_STYLE_SELECTED = "QFrame { border: 2px solid #0078d7; border-radius: 8px; padding: 0px; }"
# Основные переменные # Основные переменные
self.winehelper_path = Var.RUN_SCRIPT self.winehelper_path = Var.RUN_SCRIPT
self.process = None self.process = None
self.current_script = None self.current_script = None
self.install_process = None self.install_process = None
self.current_display_name = None
self.install_dialog = None self.install_dialog = None
self.current_active_button = None self.current_active_button = None
self.installed_buttons = [] self.installed_buttons = []
@ -163,7 +162,7 @@ class WineHelperGUI(QMainWindow):
# Заголовок # Заголовок
self.script_title = QLabel("Выберите программу") self.script_title = QLabel("Выберите программу")
self.script_title.setFont(QFont('Arial', 12, QFont.Bold)) # Шрифт и размер шрифта в заголовке инф. панели self.script_title.setFont(QFont('Arial', 14, QFont.Bold)) # Шрифт и размер шрифта в заголовке инф. панели
self.script_title.setAlignment(Qt.AlignCenter) self.script_title.setAlignment(Qt.AlignCenter)
self.info_panel_layout.addWidget(self.script_title) self.info_panel_layout.addWidget(self.script_title)
@ -199,7 +198,7 @@ class WineHelperGUI(QMainWindow):
install_action_layout = QVBoxLayout() install_action_layout = QVBoxLayout()
install_action_layout.setContentsMargins(0, 0, 0, 0) install_action_layout.setContentsMargins(0, 0, 0, 0)
self.install_button = QPushButton("Установить") self.install_button = QPushButton("Установить")
self.install_button.setFont(QFont('Arial', 12, QFont.Bold)) # Шрифт и размер шрифта в кнопке Установить self.install_button.setFont(QFont('Arial', 13, QFont.Bold))
self.install_button.setStyleSheet("background-color: #4CAF50; color: white;") self.install_button.setStyleSheet("background-color: #4CAF50; color: white;")
self.install_button.clicked.connect(self.install_current_script) self.install_button.clicked.connect(self.install_current_script)
install_action_layout.addWidget(self.install_button) install_action_layout.addWidget(self.install_button)
@ -834,11 +833,6 @@ class WineHelperGUI(QMainWindow):
print(f"Error getting prefix name from {desktop_file}: {e}") print(f"Error getting prefix name from {desktop_file}: {e}")
return None return None
def _get_current_app_title(self):
"""Возвращает отображаемое имя для текущей выбранной программы."""
# Если display_name не установлено (например, при ошибке), используем имя скрипта
return self.current_display_name or self.current_script
def backup_prefix_for_app(self): def backup_prefix_for_app(self):
"""Создает резервную копию префикса для выбранного приложения.""" """Создает резервную копию префикса для выбранного приложения."""
prefix_name = self._get_prefix_name_for_selected_app() prefix_name = self._get_prefix_name_for_selected_app()
@ -1212,7 +1206,6 @@ class WineHelperGUI(QMainWindow):
prog_name = self.extract_prog_name_from_script(script_path) prog_name = self.extract_prog_name_from_script(script_path)
prog_url = self.extract_prog_url_from_script(script_path) prog_url = self.extract_prog_url_from_script(script_path)
display_name = prog_name if prog_name else script_name display_name = prog_name if prog_name else script_name
self.current_display_name = display_name
if icon_names: if icon_names:
# Для заголовка используем первую иконку из списка # Для заголовка используем первую иконку из списка
@ -1235,7 +1228,7 @@ class WineHelperGUI(QMainWindow):
self.install_action_widget.setVisible(True) self.install_action_widget.setVisible(True)
self.installed_action_widget.setVisible(False) self.installed_action_widget.setVisible(False)
self.installed_global_action_widget.setVisible(False) self.installed_global_action_widget.setVisible(False)
self.install_button.setText(f"Установить «{display_name}»") self.install_button.setText(f"Установить {display_name}")
def install_current_script(self): def install_current_script(self):
"""Устанавливает текущий выбранный скрипт""" """Устанавливает текущий выбранный скрипт"""
@ -1249,8 +1242,7 @@ class WineHelperGUI(QMainWindow):
# Создаем диалоговое окно установки # Создаем диалоговое окно установки
self.install_dialog = QDialog(self) self.install_dialog = QDialog(self)
title_name = self._get_current_app_title() self.install_dialog.setWindowTitle(f"Установка {self.current_script}")
self.install_dialog.setWindowTitle(f"Установка «{title_name}»")
self.install_dialog.setMinimumSize(750, 400) self.install_dialog.setMinimumSize(750, 400)
self.install_dialog.setWindowModality(Qt.WindowModal) self.install_dialog.setWindowModality(Qt.WindowModal)
@ -1385,8 +1377,7 @@ class WineHelperGUI(QMainWindow):
if install_file: if install_file:
args.append(install_file) args.append(install_file)
title_name = self._get_current_app_title() self.append_log(f"=== Начало установки {self.current_script} ===")
self.append_log(f"=== Начало установки «{title_name}» ===")
self.append_log(f"Исполняемый файл: {winehelper_path}") self.append_log(f"Исполняемый файл: {winehelper_path}")
self.append_log(f"Аргументы: {' '.join(shlex.quote(a) for a in args)}") self.append_log(f"Аргументы: {' '.join(shlex.quote(a) for a in args)}")
@ -1427,8 +1418,7 @@ class WineHelperGUI(QMainWindow):
# Создаем кастомный диалог, чтобы кнопка была на русском # Создаем кастомный диалог, чтобы кнопка была на русском
success_box = QMessageBox(self.install_dialog) success_box = QMessageBox(self.install_dialog)
success_box.setWindowTitle("Успех") success_box.setWindowTitle("Успех")
title_name = self._get_current_app_title() success_box.setText(f"Программа {self.current_script} установлена успешно!")
success_box.setText(f"Программа «{title_name}» установлена успешно!")
success_box.setIcon(QMessageBox.Information) success_box.setIcon(QMessageBox.Information)
success_box.addButton("Готово", QMessageBox.AcceptRole) success_box.addButton("Готово", QMessageBox.AcceptRole)
success_box.exec_() success_box.exec_()