[libadwaita/wip/exalm/tab-fixes: 1/4] tab-box: Measure the background gizmo




commit 5100a3e3621466f0ec24db660cf252f6fa0f24ab
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Dec 27 15:01:48 2021 +0500

    tab-box: Measure the background gizmo

 src/adw-tab-box.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index 6b895a8a..5660cfcf 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -2799,12 +2799,15 @@ adw_tab_box_measure (GtkWidget      *widget,
   AdwTabBox *self = ADW_TAB_BOX (widget);
   int min, nat;
 
+  gtk_widget_measure (self->background, orientation, -1,
+                      &min, &nat, NULL, NULL);
+
   if (self->n_tabs == 0) {
     if (minimum)
-      *minimum = 0;
+      *minimum = min;
 
     if (natural)
-      *natural = 0;
+      *natural = nat;
 
     if (minimum_baseline)
       *minimum_baseline = -1;
@@ -2832,7 +2835,10 @@ adw_tab_box_measure (GtkWidget      *widget,
     if (!self->pinned)
       width -= OVERLAP;
 
-    min = nat = MAX (self->last_width, width);
+    width = MAX (self->last_width, width);
+
+    min = MAX (min, width);
+    nat = MAX (nat, width);
   } else {
     GList *l;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]