diff --git a/src/Views/AppInfoView.vala b/src/Views/AppInfoView.vala index 8b676ea76..5373dbebd 100644 --- a/src/Views/AppInfoView.vala +++ b/src/Views/AppInfoView.vala @@ -942,7 +942,22 @@ public class AppCenter.Views.AppInfoView : Adw.NavigationPage { var scale = get_scale_factor (); var min_screenshot_width = MAX_WIDTH * scale; + var prefer_dark_theme = Gtk.Settings.get_default ().gtk_application_prefer_dark_theme; screenshots.foreach ((screenshot) => { + var environment_id = screenshot.get_environment (); + if (environment_id != null) { + var environment_split = environment_id.split (":", 2); + if (prefer_dark_theme && environment_split.length != 2) { + return; + } + + var color_scheme = AppStream.ColorSchemeKind.from_string (environment_split[1]); + if ((prefer_dark_theme && color_scheme != AppStream.ColorSchemeKind.DARK) || + (!prefer_dark_theme && color_scheme == AppStream.ColorSchemeKind.DARK)) { + return; + } + } + AppStream.Image? best_image = null; screenshot.get_images ().foreach ((image) => { // Image is better than no image 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); }