fix: Fix lambda function argument errors in overlay_window.py
BUG: TypeError: missing 1 required positional argument: 'checked' The lambda functions were expecting a 'checked' argument that wasn't being passed by the signals: - QShortcut.activated doesn't pass any arguments - SidebarButton.clicked doesn't pass any arguments Fix: Removed 'checked' parameter from both lambda functions.
This commit is contained in:
parent
e62419a9fd
commit
539f07e713
|
|
@ -528,7 +528,7 @@ class OverlayWindow(QMainWindow):
|
|||
# Ctrl+1-9 to switch plugins
|
||||
for i in range(1, 10):
|
||||
shortcut = QShortcut(QKeySequence(f"Ctrl+{i}"), self)
|
||||
shortcut.activated.connect(lambda checked, idx=i-1: self._switch_to_plugin(idx))
|
||||
shortcut.activated.connect(lambda idx=i-1: self._switch_to_plugin(idx))
|
||||
|
||||
def _setup_animations(self):
|
||||
"""Setup window animations."""
|
||||
|
|
@ -559,7 +559,7 @@ class OverlayWindow(QMainWindow):
|
|||
|
||||
# Create sidebar button
|
||||
btn = SidebarButton(plugin.name, icon_name, self.icon_manager)
|
||||
btn.clicked.connect(lambda checked, i=idx: self._on_plugin_selected(i))
|
||||
btn.clicked.connect(lambda i=idx: self._on_plugin_selected(i))
|
||||
|
||||
# Insert before stretch
|
||||
self.sidebar_buttons_layout.insertWidget(idx, btn)
|
||||
|
|
|
|||
Loading…
Reference in New Issue