From aa86e8b73e71179fc0a7050c6c6fcbd55df3b796 Mon Sep 17 00:00:00 2001 From: italo-capasso Date: Tue, 17 Dec 2024 09:46:59 -0500 Subject: [PATCH 1/3] Put the release notes description label inside a Gtk.Grid This is the same issue that we had for issues, but now for the description label itself. It seems that in a Gtk.Box with wrapped labels will not do its height correctly, if there are grids abound. Putting the label inside a Gtk.Grid will make it also respect the natural height and will fix another set of problems found in other description labels. --- src/Widgets/ReleaseRow.vala | 41 ++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/Widgets/ReleaseRow.vala b/src/Widgets/ReleaseRow.vala index 9d9b4b029..8155ecc85 100644 --- a/src/Widgets/ReleaseRow.vala +++ b/src/Widgets/ReleaseRow.vala @@ -29,8 +29,17 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { } construct { - var header_icon = new Gtk.Image.from_icon_name ("tag-symbolic"); + orientation = Gtk.Orientation.VERTICAL; + spacing = 6; + margin_bottom = 6; + + create_header (); + create_description (); + create_issues (); + } + private void create_header () { + var header_icon = new Gtk.Image.from_icon_name ("tag-symbolic"); var header_label = new Gtk.Label (format_version (release.get_version ())) { use_markup = true }; @@ -42,32 +51,40 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { }; date_label.add_css_class (Granite.STYLE_CLASS_DIM_LABEL); + var header_grid = new Gtk.Grid () { + column_spacing = 6, + row_spacing = 6, + margin_bottom = 6 + }; + header_grid.attach (header_icon, 0, 0); + header_grid.attach (header_label, 1, 0); + header_grid.attach (date_label, 2, 0); + + append (header_grid); + } + + private void create_description () { 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 + xalign = 0, }; description_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL); - var grid = new Gtk.Grid () { + var description_grid = new Gtk.Grid () { column_spacing = 6, row_spacing = 6, margin_bottom = 6 }; - grid.attach (header_icon, 0, 0); - grid.attach (header_label, 1, 0); - grid.attach (date_label, 2, 0); - grid.attach (description_label, 0, 1, 3); + description_grid.attach (description_label, 0, 0); - orientation = Gtk.Orientation.VERTICAL; - spacing = 6; - - append (grid); + append (description_grid); + } + private void create_issues () { var issues = release.get_issues (); - if (issues.length > 0) { var issue_header = new Gtk.Label (_("Fixed Issues")) { halign = Gtk.Align.START, From 25f7fbabcbb692d67d674f947f7780f5122bed08 Mon Sep 17 00:00:00 2001 From: "Italo F. Capasso B." <44873757+edwood-grant@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:40:19 -0500 Subject: [PATCH 2/3] Remove extra comma in description label parameters Co-authored-by: Leo --- src/Widgets/ReleaseRow.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Widgets/ReleaseRow.vala b/src/Widgets/ReleaseRow.vala index 8155ecc85..cd0373334 100644 --- a/src/Widgets/ReleaseRow.vala +++ b/src/Widgets/ReleaseRow.vala @@ -69,7 +69,7 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { use_markup = true, max_width_chars = 55, wrap = true, - xalign = 0, + xalign = 0 }; description_label.add_css_class (Granite.STYLE_CLASS_H3_LABEL); From dba0ef514dda5f119d15908dc3799e9797308fe3 Mon Sep 17 00:00:00 2001 From: italo-capasso Date: Tue, 17 Dec 2024 12:42:43 -0500 Subject: [PATCH 3/3] Removed split constructor methods in ReleaseRow --- src/Widgets/ReleaseRow.vala | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/Widgets/ReleaseRow.vala b/src/Widgets/ReleaseRow.vala index cd0373334..324bf3386 100644 --- a/src/Widgets/ReleaseRow.vala +++ b/src/Widgets/ReleaseRow.vala @@ -33,12 +33,6 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { spacing = 6; margin_bottom = 6; - create_header (); - create_description (); - create_issues (); - } - - private void create_header () { var header_icon = new Gtk.Image.from_icon_name ("tag-symbolic"); var header_label = new Gtk.Label (format_version (release.get_version ())) { use_markup = true @@ -59,11 +53,8 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { header_grid.attach (header_icon, 0, 0); header_grid.attach (header_label, 1, 0); header_grid.attach (date_label, 2, 0); - append (header_grid); - } - private void create_description () { var description_label = new Gtk.Label (format_release_description (release.get_description ())) { selectable = true, use_markup = true, @@ -79,11 +70,8 @@ public class AppCenter.Widgets.ReleaseRow : Gtk.Box { margin_bottom = 6 }; description_grid.attach (description_label, 0, 0); - append (description_grid); - } - private void create_issues () { var issues = release.get_issues (); if (issues.length > 0) { var issue_header = new Gtk.Label (_("Fixed Issues")) {