new preferences and bug fixes
This commit is contained in:
@@ -319,24 +319,41 @@ class ParamSection(QWidget):
|
||||
self.dependencies = []
|
||||
self.selected_path = None
|
||||
|
||||
self.param_rows = []
|
||||
self.header_widgets = []
|
||||
|
||||
# Title label
|
||||
title_label = QLabel(section_data["title"])
|
||||
title_label.setStyleSheet("font-weight: bold; font-size: 14px; margin-top: 10px; margin-bottom: 5px;")
|
||||
layout.addWidget(title_label)
|
||||
self.header_widgets.append(title_label)
|
||||
|
||||
# Horizontal line
|
||||
line = QFrame()
|
||||
line.setFrameShape(QFrame.Shape.HLine)
|
||||
line.setFrameShadow(QFrame.Shadow.Sunken)
|
||||
layout.addWidget(line)
|
||||
self.header_widgets.append(line)
|
||||
|
||||
for param in section_data["params"]:
|
||||
h_layout = QHBoxLayout()
|
||||
|
||||
label = QLabel(param["name"])
|
||||
is_advanced = param.get("advanced", False)
|
||||
|
||||
label.setToolTip(param.get("help", ""))
|
||||
# Build label text and tooltips
|
||||
param_name = param["name"]
|
||||
if is_advanced:
|
||||
label_text = f"⚠️ {param_name}"
|
||||
else:
|
||||
label_text = param_name
|
||||
|
||||
label = QLabel(label_text)
|
||||
|
||||
# Set hover tooltip
|
||||
if is_advanced:
|
||||
label.setToolTip(f"ADVANCED: {param.get("help", "")}")
|
||||
else:
|
||||
label.setToolTip(param.get("help", ""))
|
||||
|
||||
help_text = param.get("help", "")
|
||||
|
||||
@@ -346,7 +363,6 @@ class ParamSection(QWidget):
|
||||
help_btn.clicked.connect(lambda _, text=help_text: self.show_help_popup(text))
|
||||
|
||||
h_layout.addWidget(help_btn)
|
||||
|
||||
h_layout.addWidget(label)
|
||||
h_layout.setStretch(0, 1)
|
||||
h_layout.setStretch(1, 6)
|
||||
@@ -421,8 +437,32 @@ class ParamSection(QWidget):
|
||||
"h_layout": h_layout
|
||||
}
|
||||
|
||||
row_widgets = [help_btn, label, widget]
|
||||
is_advanced = param.get("advanced", False)
|
||||
self.param_rows.append((row_widgets, h_layout, is_advanced))
|
||||
|
||||
self.update_dependencies()
|
||||
|
||||
def set_advanced_visible(self, show_advanced: bool):
|
||||
"""Shows/hides advanced parameters and adjusts header visibility dynamically."""
|
||||
has_visible_rows = False
|
||||
|
||||
for row_widgets, h_layout, is_advanced in self.param_rows:
|
||||
visible = show_advanced or not is_advanced
|
||||
|
||||
# Toggle visibility of all child widgets in the row
|
||||
for w in row_widgets:
|
||||
w.setVisible(visible)
|
||||
|
||||
if visible:
|
||||
has_visible_rows = True
|
||||
|
||||
# Hide or show section header title and horizontal rule if section is completely empty
|
||||
for hw in self.header_widgets:
|
||||
hw.setVisible(has_visible_rows)
|
||||
|
||||
self.setVisible(has_visible_rows)
|
||||
|
||||
|
||||
def has_any_changes(self):
|
||||
"""Returns True if any parameter in this section differs from its default."""
|
||||
@@ -473,16 +513,10 @@ class ParamSection(QWidget):
|
||||
else:
|
||||
is_changed = str(current_value) != str(default)
|
||||
|
||||
# Update Font
|
||||
font = label.font()
|
||||
font.setBold(is_changed)
|
||||
label.setFont(font)
|
||||
|
||||
# Optional: Change color to make it even more obvious
|
||||
if is_changed:
|
||||
label.setStyleSheet("color: #3498db; font-weight: bold;") # Nice Blue
|
||||
else:
|
||||
label.setStyleSheet("color: none; font-weight: normal;")
|
||||
label.setStyleSheet("")
|
||||
|
||||
def notify_global_update(self):
|
||||
"""
|
||||
|
||||
@@ -13,7 +13,7 @@ import sys
|
||||
import platform
|
||||
|
||||
|
||||
CURRENT_VERSION = "1.5.0"
|
||||
CURRENT_VERSION = "1.5.2"
|
||||
APP_NAME = "flares"
|
||||
APP_NAME_EXPANDED = "fNIRS Lightweight Analysis, Research, & Evaluation Suite"
|
||||
API_URL = f"https://git.research.dezeeuw.ca/api/v1/repos/tyler/{APP_NAME}/releases"
|
||||
|
||||
Reference in New Issue
Block a user