[libadwaita/wip/exalm/indicator-bin-warning] indicator-bin: Measure mask too
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/indicator-bin-warning] indicator-bin: Measure mask too
- Date: Tue, 2 Nov 2021 11:23:07 +0000 (UTC)
commit df8bd1c7b2ac2345e80e35190e4f47271ff753a7
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Nov 2 16:20:24 2021 +0500
indicator-bin: Measure mask too
Fixes https://gitlab.gnome.org/GNOME/libadwaita/-/issues/260
src/adw-indicator-bin.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-indicator-bin.c b/src/adw-indicator-bin.c
index 3e60d67e..ae5243c2 100644
--- a/src/adw-indicator-bin.c
+++ b/src/adw-indicator-bin.c
@@ -124,13 +124,17 @@ adw_indicator_bin_size_allocate (GtkWidget *widget,
int baseline)
{
AdwIndicatorBin *self = ADW_INDICATOR_BIN (widget);
- GtkRequisition size;
+ GtkRequisition mask_size, indicator_size, size;
float x, y;
if (self->child)
gtk_widget_allocate (self->child, width, height, baseline, NULL);
- gtk_widget_get_preferred_size (self->indicator, NULL, &size);
+ gtk_widget_get_preferred_size (self->mask, NULL, &mask_size);
+ gtk_widget_get_preferred_size (self->indicator, NULL, &indicator_size);
+
+ size.width = MAX (mask_size.width, indicator_size.width);
+ size.height = MAX (mask_size.height, indicator_size.height);
if (size.width > width * 2)
x = (width - size.width) / 2.0f;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]