diff --git a/requirements.txt b/requirements.txt index 93334fe..84b88c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,4 +17,4 @@ pillow qasync requests obs-websocket-py -pyvda \ No newline at end of file +pip install git+https://github.com/amnweb/pyvda.git \ No newline at end of file diff --git a/src/core/validation/widgets/yasb/windows_desktops.py b/src/core/validation/widgets/yasb/windows_desktops.py index c6cd602..d0377eb 100644 --- a/src/core/validation/widgets/yasb/windows_desktops.py +++ b/src/core/validation/widgets/yasb/windows_desktops.py @@ -1,6 +1,7 @@ DEFAULTS = { 'label_workspace_btn': '{index}', 'label_workspace_active_btn': '{index}', + 'switch_workspace_animation': True, 'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0}, } VALIDATION_SCHEMA = { @@ -12,6 +13,11 @@ 'type': 'string', 'default': DEFAULTS['label_workspace_active_btn'] }, + 'switch_workspace_animation': { + 'type': 'boolean', + 'required': False, + 'default': DEFAULTS['switch_workspace_animation'] + }, 'container_padding': { 'type': 'dict', 'default': DEFAULTS['container_padding'], diff --git a/src/core/widgets/yasb/windows_desktops.py b/src/core/widgets/yasb/windows_desktops.py index 2eee970..71fe1a9 100644 --- a/src/core/widgets/yasb/windows_desktops.py +++ b/src/core/widgets/yasb/windows_desktops.py @@ -10,6 +10,7 @@ class WorkspaceButton(QPushButton): def __init__(self, workspace_index: int, label: str = None, active_label: str = None, parent=None): super().__init__(parent) + self.workspace_index = workspace_index self.setProperty("class", "ws-btn") self.default_label = label if label else str(workspace_index) @@ -17,11 +18,12 @@ def __init__(self, workspace_index: int, label: str = None, active_label: str = self.setText(self.default_label) self.clicked.connect(self.activate_workspace) self.parent_widget = parent + self.workspace_animation = self.parent_widget._switch_workspace_animation self.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) def activate_workspace(self): try: - VirtualDesktop(self.workspace_index).go() + VirtualDesktop(self.workspace_index).go(self.workspace_animation) if isinstance(self.parent_widget, WorkspaceWidget): # Emit event to update desktops on all monitors self.parent_widget._event_service.emit_event( @@ -40,6 +42,7 @@ def __init__( self, label_workspace_btn: str, label_workspace_active_btn: str, + switch_workspace_animation: bool, container_padding: dict, ): super().__init__(class_name="windows-desktops") @@ -54,7 +57,7 @@ def __init__( self._label_workspace_btn = label_workspace_btn self._label_workspace_active_btn = label_workspace_active_btn self._padding = container_padding - + self._switch_workspace_animation = switch_workspace_animation self._virtual_desktops = range(1, len(get_virtual_desktops()) + 1) self._prev_workspace_index = None self._curr_workspace_index = VirtualDesktop.current().number