2 Commits

Author SHA1 Message Date
b0c4e943ae feat(settings): added blocked style to advanced tab
All checks were successful
Code check / Check code (push) Successful in 1m30s
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-11-22 00:05:46 +05:00
19e01bba17 Fix: normalize disabled value for PW_AMD_VULKAN_USE
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-11-21 23:43:36 +05:00

View File

@@ -2026,6 +2026,8 @@ class ExeSettingsDialog(QDialog):
for setting in advanced_settings:
row = self.advanced_table.rowCount()
self.advanced_table.insertRow(row)
is_blocked = setting.get("type") == "combo" and len(setting.get("options", [])) == 1
# Name column
name_item = QTableWidgetItem(setting['name'])
@@ -2042,7 +2044,7 @@ class ExeSettingsDialog(QDialog):
if setting['key'] == 'PW_WINE_CPU_TOPOLOGY':
current_val = disabled_text if current_raw == 'disabled' else (current_raw.split(':')[0] if isinstance(current_raw, str) and ':' in current_raw else current_raw)
elif setting['key'] == 'PW_AMD_VULKAN_USE':
current_val = disabled_text if not current_raw or current_raw == '' else current_raw
current_val = disabled_text if not current_raw or current_raw == '' or current_raw == 'disabled' else current_raw
else:
current_val = disabled_text if current_raw == 'disabled' else current_raw
@@ -2050,9 +2052,9 @@ class ExeSettingsDialog(QDialog):
combo.addItem(current_val)
combo.setCurrentText(current_val)
# Block if only disabled option
if len(setting['options']) == 1:
if is_blocked:
combo.setEnabled(False)
name_item.setForeground(QColor(128, 128, 128))
# Set focus policy for combo box
combo.setFocusPolicy(Qt.FocusPolicy.StrongFocus)
@@ -2066,6 +2068,10 @@ class ExeSettingsDialog(QDialog):
current_val = current.get(setting['key'], setting['default'])
line_edit.setText(current_val)
if is_blocked:
line_edit.setEnabled(False)
line_edit.setStyleSheet("background-color: #f0f0f0;")
self.advanced_table.setCellWidget(row, 1, line_edit)
self.advanced_widgets[setting['key']] = line_edit
self.original_display_values[setting['key']] = current_val
@@ -2075,6 +2081,8 @@ class ExeSettingsDialog(QDialog):
desc_item.setFlags(Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled)
desc_item.setToolTip(setting['description'])
desc_item.setTextAlignment(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter)
if is_blocked:
desc_item.setForeground(QColor(128, 128, 128))
self.advanced_table.setItem(row, 2, desc_item)
def init_virtual_keyboard(self):