Skip to content

Commit

Permalink
Merge branch 'main' into italo-capasso/issue-2140
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Dec 10, 2024
2 parents dea2a05 + be2fb50 commit e62fcae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
15 changes: 15 additions & 0 deletions src/Views/AppInfoView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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 e62fcae

Please sign in to comment.