Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNOME 48 #758

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-aux/com.mattjakeman.ExtensionManager.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id" : "com.mattjakeman.ExtensionManager",
"runtime" : "org.gnome.Platform",
"runtime-version" : "47",
"runtime-version" : "48",
"sdk" : "org.gnome.Sdk",
"command" : "extension-manager",
"finish-args" : [
Expand Down
Binary file modified data/screenshot-browse-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot-browse-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot-details-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot-details-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot-installed-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot-installed-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot-upgrade-assistant-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshot-upgrade-assistant-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/exm-browse-page.blp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ template $ExmBrowsePage: Gtk.Widget {

child: Adw.Spinner {
styles [
"dim-label"
"dimmed"
]

margin-top: 30;
Expand Down Expand Up @@ -119,7 +119,7 @@ template $ExmBrowsePage: Gtk.Widget {

Gtk.Image {
styles [
"dim-label"
"dimmed"
]

icon-name: "edit-find-symbolic";
Expand Down Expand Up @@ -160,7 +160,7 @@ template $ExmBrowsePage: Gtk.Widget {

Gtk.Image {
styles [
"dim-label"
"dimmed"
]

icon-name: "offline-symbolic";
Expand Down
11 changes: 9 additions & 2 deletions src/exm-comment-tile.blp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Gtk 4.0;

template $ExmCommentTile: Gtk.Widget {
focusable: true;

Gtk.Box {
orientation: vertical;

Expand All @@ -12,8 +14,11 @@ template $ExmCommentTile: Gtk.Widget {
"heading"
]

xalign: 0;
label: bind template.comment as <$ExmComment>.author;
max-width-chars: 20;
wrap: true;
wrap-mode: word;
xalign: 0;
}

Gtk.Label author_badge {
Expand All @@ -22,6 +27,7 @@ template $ExmCommentTile: Gtk.Widget {
]

label: _("Author");
valign: center;
visible: bind template.comment as <$ExmComment>.is_extension_creator;
}

Expand All @@ -44,11 +50,12 @@ template $ExmCommentTile: Gtk.Widget {
wrap: true;
wrap-mode: word_char;
xalign: 0;
max-width-chars: 30;
}

Gtk.Label date {
styles [
"dim-label"
"dimmed"
]

margin-top: 6;
Expand Down
6 changes: 4 additions & 2 deletions src/exm-comment-tile.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* exm-comment-tile.c
/*
* exm-comment-tile.c
*
* Copyright 2022-2024 Matthew Jakeman <[email protected]>
* Copyright 2022-2025 Matthew Jakeman <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -158,6 +159,7 @@ exm_comment_tile_class_init (ExmCommentTileClass *klass)

gtk_widget_class_set_css_name (widget_class, "comment-tile");
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_COMMENT);
}

static void
Expand Down
17 changes: 7 additions & 10 deletions src/exm-detail-view.blp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ template $ExmDetailView: Adw.NavigationPage {
header_suffix.orientation: vertical;
header_suffix.spacing: 12;
ext_install.halign: start;
comment_box.min-children-per-line: 1;
}

apply => $breakpoint_apply_cb() swapped;
Expand Down Expand Up @@ -118,7 +117,7 @@ template $ExmDetailView: Adw.NavigationPage {

Gtk.Label ext_author {
styles [
"dim-label"
"dimmed"
]

xalign: 0;
Expand Down Expand Up @@ -324,19 +323,17 @@ template $ExmDetailView: Adw.NavigationPage {
child: Gtk.Box {
orientation: vertical;

Gtk.FlowBox comment_box {
min-children-per-line: 2;
max-children-per-line: 2;
homogeneous: true;
selection-mode: none;
row-spacing: 12;
column-spacing: 12;
Adw.WrapBox comment_box {
orientation: vertical;
child-spacing: 12;
line-homogeneous: true;
line-spacing: 12;
}

Gtk.Button show_more_btn {
label: _("_Show All Reviews");
halign: center;
margin-top: 10;
margin-top: 12;
use-underline: true;
}
};
Expand Down
53 changes: 26 additions & 27 deletions src/exm-detail-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct _ExmDetailView
ExmInfoBar *ext_info_bar;
GtkScrolledWindow *scroll_area;
GtkStack *comment_stack;
GtkFlowBox *comment_box;
AdwWrapBox *comment_box;
GtkButton *show_more_btn;

AdwActionRow *link_homepage;
Expand Down Expand Up @@ -210,17 +210,13 @@ queue_resolve_image (ExmDetailView *self,
g_object_ref (self));
}

static GtkWidget *
comment_factory (ExmComment *comment,
gpointer user_data G_GNUC_UNUSED)
static void
delete_comment_tiles (ExmDetailView *self)
{
GtkWidget *tile;

tile = gtk_flow_box_child_new ();
gtk_widget_add_css_class (tile, "card");
gtk_flow_box_child_set_child (GTK_FLOW_BOX_CHILD (tile), GTK_WIDGET (exm_comment_tile_new (comment)));
GtkWidget *child;

return tile;
while ((child = gtk_widget_get_first_child (GTK_WIDGET (self->comment_box))) != NULL)
adw_wrap_box_remove (self->comment_box, child);
}

static void
Expand Down Expand Up @@ -252,9 +248,16 @@ on_get_comments (GObject *source,
else
gtk_stack_set_visible_child_name (self->comment_stack, "page_comments");

gtk_flow_box_bind_model (self->comment_box, model,
(GtkFlowBoxCreateWidgetFunc) comment_factory,
g_object_ref (self), g_object_unref);
delete_comment_tiles (self);

for (guint i = 0; i < g_list_model_get_n_items (model); i++)
{
ExmComment *comment = g_list_model_get_item (model, i);
GtkWidget *tile = GTK_WIDGET (exm_comment_tile_new (comment));
gtk_widget_add_css_class (tile, "card");
adw_wrap_box_append (self->comment_box, tile);
g_object_unref (comment);
}
}

static void
Expand Down Expand Up @@ -296,20 +299,6 @@ install_remote (GtkButton *button,
"(sb)", self->uuid, warn);
}

static void
delete_donation_rows (ExmDetailView *self)
{
GtkWidget *row;

for (GList *iter = self->donation_rows_list; iter != NULL; iter = g_list_next (iter)) {
row = GTK_WIDGET (iter->data);
adw_expander_row_remove (self->links_donations, row);
}

g_list_free (self->donation_rows_list);
self->donation_rows_list = NULL;
}

static void
new_donation_row (ExmDetailView *self,
int num_donation)
Expand All @@ -333,6 +322,16 @@ new_donation_row (ExmDetailView *self,
self->donation_rows_list = g_list_append (self->donation_rows_list, row);
}

static void
delete_donation_rows (ExmDetailView *self)
{
for (GList *iter = self->donation_rows_list; iter != NULL; iter = g_list_next (iter))
adw_expander_row_remove (self->links_donations, GTK_WIDGET (iter->data));

g_list_free (self->donation_rows_list);
self->donation_rows_list = NULL;
}

static void
update_donation_rows (ExmDetailView *self,
gchar **donation_urls)
Expand Down
119 changes: 58 additions & 61 deletions src/exm-installed-page.blp
Original file line number Diff line number Diff line change
Expand Up @@ -11,86 +11,83 @@ template $ExmInstalledPage: Gtk.Widget {
Gtk.StackPage page_list {
name: "page_list";

child: Gtk.Box {
orientation: vertical;

Adw.Banner updates_banner {
child: Adw.PreferencesPage {
banner: Adw.Banner updates_banner {
button-label: _("_Log Out…");
button-style: suggested;
action-name: "app.logout";
};

Adw.PreferencesGroup {
Adw.SwitchRow global_toggle {
[prefix]
Gtk.Image {
icon-name: 'puzzle-piece-symbolic';
}

title: _("Use Extensions");
subtitle: _("Extensions can cause performance and stability issues");
}
}

Adw.PreferencesPage {
Adw.PreferencesGroup {
Adw.SwitchRow global_toggle {
Adw.PreferencesGroup user_list {
title: _("User-Installed Extensions");

Gtk.ListBox user_list_box {
styles [
"boxed-list",
"boxed-list-placeholder"
]

selection-mode: none;

[placeholder]
Adw.ActionRow {
[prefix]
Gtk.Image {
icon-name: 'puzzle-piece-symbolic';
icon-name: "globe-symbolic";
}

title: _("Use Extensions");
subtitle: _("Extensions can cause performance and stability issues");
}
}
title: _("No User Extensions Installed");

Adw.PreferencesGroup user_list {
title: _("User-Installed Extensions");

Gtk.ListBox user_list_box {
styles [
"boxed-list",
"boxed-list-placeholder"
]

selection-mode: none;

[placeholder]
Adw.ActionRow {
[prefix]
Gtk.Image {
icon-name: "globe-symbolic";
}

title: _("No User Extensions Installed");

[suffix]
Gtk.Button {
label: _("Browse");
action-name: "win.show-page";
action-target: "\"browse\"";
valign: center;
}
[suffix]
Gtk.Button {
label: _("Browse");
action-name: "win.show-page";
action-target: "\"browse\"";
valign: center;
}
}

accessibility {
labelled-by: user_list;
}
accessibility {
labelled-by: user_list;
}
}
}

Adw.PreferencesGroup system_list {
title: _("System Extensions");

Gtk.ListBox system_list_box {
styles [
"boxed-list",
"boxed-list-placeholder"
]
Adw.PreferencesGroup system_list {
title: _("System Extensions");

selection-mode: none;
Gtk.ListBox system_list_box {
styles [
"boxed-list",
"boxed-list-placeholder"
]

[placeholder]
Adw.ActionRow {
[prefix]
Gtk.Image {
icon-name: "settings-symbolic";
}
selection-mode: none;

title: _("No System Extensions Installed");
[placeholder]
Adw.ActionRow {
[prefix]
Gtk.Image {
icon-name: "settings-symbolic";
}

accessibility {
labelled-by: system_list;
}
title: _("No System Extensions Installed");
}

accessibility {
labelled-by: system_list;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/exm-search-row.blp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ template $ExmSearchRow: Gtk.ListBoxRow {

Gtk.Label description_label {
styles [
"dim-label"
"dimmed"
]

ellipsize: end;
Expand Down
1 change: 1 addition & 0 deletions src/exm-window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ template $ExmWindow: Adw.ApplicationWindow {
}

content: Adw.ViewStack view_stack {
enable-transitions: true;
notify::visible-child => $on_visible_page_changed();

Adw.ViewStackPage installed_stack {
Expand Down