From be2fb50b617e609b12f7e6c1713e70d446e49467 Mon Sep 17 00:00:00 2001 From: "Italo F. Capasso B." <44873757+edwood-grant@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:24:41 -0500 Subject: [PATCH] Made issue_box widget a grid (#2227) The grid actually detects height natural size changes when enabling wrap within a LinkedButton Label. Aslo changed some alginment, wrapping and margin values to separate better the issues section and wrap the issue text and description. Co-authored-by: italo-capasso --- src/Widgets/ReleaseRow.vala | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Widgets/ReleaseRow.vala b/src/Widgets/ReleaseRow.vala index e8876e7d0..9d9b4b029 100644 --- a/src/Widgets/ReleaseRow.vala +++ b/src/Widgets/ReleaseRow.vala @@ -45,6 +45,7 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { var description_label = new Gtk.Label (format_release_description (release.get_description ())) { selectable = true, use_markup = true, + max_width_chars = 55, wrap = true, xalign = 0 }; @@ -69,7 +70,8 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { if (issues.length > 0) { var issue_header = new Gtk.Label (_("Fixed Issues")) { - halign = Gtk.Align.START + halign = Gtk.Align.START, + margin_top = 9 }; issue_header.add_css_class (Granite.STYLE_CLASS_H3_LABEL); @@ -78,10 +80,11 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { foreach (unowned AppStream.Issue issue in issues) { var issue_image = new Gtk.Image.from_icon_name ("bug-symbolic") { - valign = Gtk.Align.START + valign = Gtk.Align.BASELINE_CENTER }; var issue_label = new Gtk.Label (issue.get_id ()) { + max_width_chars = 35, wrap = true, xalign = 0 }; @@ -90,9 +93,9 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { issue_linkbutton.get_child ().destroy (); issue_linkbutton.child = issue_label; - var issue_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 3); - issue_box.append (issue_image); - issue_box.append (issue_linkbutton); + var issue_box = new Gtk.Grid (); + issue_box.attach (issue_image, 0, 0); + issue_box.attach (issue_linkbutton, 1, 0); append (issue_box); }