[libhandy] headerbar: Fix css min size
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy] headerbar: Fix css min size
- Date: Tue, 14 Jul 2020 07:03:45 +0000 (UTC)
commit 3ea2c732a95f4676386d31601720374532e66600
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Jul 14 03:01:50 2020 +0500
headerbar: Fix css min size
min-width and min-height should be added to border + padding + margin size.
This time it was different by 1px because of the border.
Fixes https://gitlab.gnome.org/GNOME/libhandy/-/issues/194
Signed-off-by: Alexander Mikhaylenko <alexm gnome org>
src/hdy-header-bar.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/src/hdy-header-bar.c b/src/hdy-header-bar.c
index 899843a8..1b2a17cd 100644
--- a/src/hdy-header-bar.c
+++ b/src/hdy-header-bar.c
@@ -998,21 +998,19 @@ hdy_header_bar_measure (GtkWidget *widget,
gtk_style_context_get_margin (style_context, state_flags, &margin);
gtk_style_context_get_padding (style_context, state_flags, &padding);
if (orientation == GTK_ORIENTATION_VERTICAL) {
- *minimum += border.top + margin.top + padding.top +
- border.bottom + margin.bottom + padding.bottom;
- *natural += border.top + margin.top + padding.top +
- border.bottom + margin.bottom + padding.bottom;
-
- *minimum = MAX (*minimum, css_height);
- *natural = MAX (*natural, css_height);
+ *minimum = MAX (*minimum, css_height) +
+ border.top + margin.top + padding.top +
+ border.bottom + margin.bottom + padding.bottom;
+ *natural = MAX (*natural, css_height) +
+ border.top + margin.top + padding.top +
+ border.bottom + margin.bottom + padding.bottom;
} else {
- *minimum += border.left + margin.left + padding.left +
- border.right + margin.right + padding.right;
- *natural += border.left + margin.left + padding.left +
- border.right + margin.right + padding.right;
-
- *minimum = MAX (*minimum, css_width);
- *natural = MAX (*natural, css_width);
+ *minimum = MAX (*minimum, css_width) +
+ border.left + margin.left + padding.left +
+ border.right + margin.right + padding.right;
+ *natural = MAX (*natural, css_width) +
+ border.left + margin.left + padding.left +
+ border.right + margin.right + padding.right;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]