Skip to content

Commit

Permalink
Made issue_box widget a grid (#2227)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
edwood-grant and italo-capasso authored Dec 10, 2024
1 parent 5e99390 commit be2fb50
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Widgets/ReleaseRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand All @@ -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);

Expand All @@ -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
};
Expand All @@ -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);
}
Expand Down

0 comments on commit be2fb50

Please sign in to comment.