From c1bbb16dad481c628e7680180d7250ba8a560c46 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Fri, 11 Apr 2025 01:40:24 +0200 Subject: [PATCH] fix(round_frame): orientation can be vertical --- bec_widgets/utils/round_frame.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bec_widgets/utils/round_frame.py b/bec_widgets/utils/round_frame.py index 03bf5920..51ec3497 100644 --- a/bec_widgets/utils/round_frame.py +++ b/bec_widgets/utils/round_frame.py @@ -16,6 +16,7 @@ class RoundedFrame(QFrame): parent=None, content_widget: QWidget = None, background_color: str = None, + orientation: str = "horizontal", radius: int = 10, ): QFrame.__init__(self, parent) @@ -28,8 +29,12 @@ class RoundedFrame(QFrame): self.setObjectName("roundedFrame") # Create a layout for the frame - self.layout = QHBoxLayout(self) - self.layout.setContentsMargins(5, 5, 5, 5) # Set 5px margin + if orientation == "vertical": + self.layout = QVBoxLayout(self) + self.layout.setContentsMargins(5, 5, 5, 5) + else: + self.layout = QHBoxLayout(self) + self.layout.setContentsMargins(5, 5, 5, 5) # Set 5px margin # Add the content widget to the layout if content_widget: