From 5fcf928f17a3998474cb20d8bcd9484c33d53f12 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Fri, 29 Dec 2023 12:25:18 -0800 Subject: [PATCH] qtutils: add a title layout to dock widgets Related-to: #1367 Signed-off-by: David Aguilar --- cola/qtutils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cola/qtutils.py b/cola/qtutils.py index dfe7c1de..3ca3391e 100644 --- a/cola/qtutils.py +++ b/cola/qtutils.py @@ -843,6 +843,7 @@ class DockTitleBarWidget(QtWidgets.QFrame): ) self.corner_layout = hbox(defs.no_margin, defs.spacing) + self.title_layout = hbox(defs.no_margin, defs.button_spacing, qlabel) if stretch: separator = STRETCH @@ -852,7 +853,7 @@ class DockTitleBarWidget(QtWidgets.QFrame): self.main_layout = hbox( defs.small_margin, defs.titlebar_spacing, - qlabel, + self.title_layout, separator, self.corner_layout, self.toggle_button, @@ -873,7 +874,12 @@ class DockTitleBarWidget(QtWidgets.QFrame): def set_title(self, title): self.label.setText(title) + def add_title_widget(self, widget): + """Add widgets to the title area""" + self.title_layout.addWidget(widget) + def add_corner_widget(self, widget): + """Add widgets to the corner area""" self.corner_layout.addWidget(widget) def update_tooltips(self): -- 2.11.4.GIT