mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix(round_frame): orientation can be vertical
This commit is contained in:
@ -16,6 +16,7 @@ class RoundedFrame(QFrame):
|
|||||||
parent=None,
|
parent=None,
|
||||||
content_widget: QWidget = None,
|
content_widget: QWidget = None,
|
||||||
background_color: str = None,
|
background_color: str = None,
|
||||||
|
orientation: str = "horizontal",
|
||||||
radius: int = 10,
|
radius: int = 10,
|
||||||
):
|
):
|
||||||
QFrame.__init__(self, parent)
|
QFrame.__init__(self, parent)
|
||||||
@ -28,8 +29,12 @@ class RoundedFrame(QFrame):
|
|||||||
self.setObjectName("roundedFrame")
|
self.setObjectName("roundedFrame")
|
||||||
|
|
||||||
# Create a layout for the frame
|
# Create a layout for the frame
|
||||||
self.layout = QHBoxLayout(self)
|
if orientation == "vertical":
|
||||||
self.layout.setContentsMargins(5, 5, 5, 5) # Set 5px margin
|
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
|
# Add the content widget to the layout
|
||||||
if content_widget:
|
if content_widget:
|
||||||
|
Reference in New Issue
Block a user