From ec81b8fea6b21862b06e29fd4c33fa049683e856 Mon Sep 17 00:00:00 2001 From: IgorTatarnikov Date: Fri, 24 May 2024 15:12:03 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Changed=20collapsed=20icon=20to=20=E2=96=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- brainglobe_utils/qtpy/collapsible_widget.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/brainglobe_utils/qtpy/collapsible_widget.py b/brainglobe_utils/qtpy/collapsible_widget.py index feeab84..8c15b46 100644 --- a/brainglobe_utils/qtpy/collapsible_widget.py +++ b/brainglobe_utils/qtpy/collapsible_widget.py @@ -29,6 +29,7 @@ def __init__( self, title: str = "", parent: Optional[QWidget] = None, + collapsed_icon: Optional[str] = "▶", ): """ Initializes a new CollapsibleWidget instance. @@ -40,7 +41,7 @@ def __init__( parent : QWidget or None, optional The parent widget. """ - super().__init__(title, parent) + super().__init__(title, parent, collapsedIcon=collapsed_icon) self.currently_expanded = False self.toggled.connect(self._on_toggle) From a7b7c73f94dd625f010f1a5c492443d13e9be0a6 Mon Sep 17 00:00:00 2001 From: IgorTatarnikov Date: Fri, 24 May 2024 15:11:53 +0100 Subject: [PATCH 2/2] Expose the expanded icon in the constructor as well --- brainglobe_utils/qtpy/collapsible_widget.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/brainglobe_utils/qtpy/collapsible_widget.py b/brainglobe_utils/qtpy/collapsible_widget.py index 8c15b46..ee22bd4 100644 --- a/brainglobe_utils/qtpy/collapsible_widget.py +++ b/brainglobe_utils/qtpy/collapsible_widget.py @@ -29,6 +29,7 @@ def __init__( self, title: str = "", parent: Optional[QWidget] = None, + expanded_icon: Optional[str] = "▼", collapsed_icon: Optional[str] = "▶", ): """ @@ -41,7 +42,12 @@ def __init__( parent : QWidget or None, optional The parent widget. """ - super().__init__(title, parent, collapsedIcon=collapsed_icon) + super().__init__( + title, + parent, + expandedIcon=expanded_icon, + collapsedIcon=collapsed_icon, + ) self.currently_expanded = False self.toggled.connect(self._on_toggle)