Skip to content

Commit

Permalink
installed-page: Use AdwPreferences* widgets
Browse files Browse the repository at this point in the history
The current layout is mostly the same as the one we can achieve with them.
Despite their name, they can be used outside of AdwPreferencesDialog
resulting in a simpler widget tree.

Took the chance to run Blueprint's formatter.
  • Loading branch information
oscfdezdz committed Apr 5, 2024
1 parent fec37b2 commit 69483f7
Showing 1 changed file with 104 additions and 114 deletions.
218 changes: 104 additions & 114 deletions src/exm-installed-page.blp
Original file line number Diff line number Diff line change
@@ -1,118 +1,108 @@
using Gtk 4.0;
using Adw 1;

template $ExmInstalledPage : Gtk.Widget {
notify::manager => $on_bind_manager();

Gtk.Box {
orientation: vertical;

Gtk.ScrolledWindow {
vexpand: true;

Gtk.Box {
orientation: vertical;

Adw.Clamp {
Gtk.Box {
styles ["content"]
orientation: vertical;
spacing: 10;

Gtk.ListBox {
styles ["boxed-list"]
valign: start;
selection-mode: none;

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

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

Gtk.Label {
styles ["heading"]
xalign: 0;
margin-top: 20;
label: _("User-Installed Extensions");
}

Gtk.ListBox user_list_box {
styles ["boxed-list", "boxed-list-placeholder"]
valign: start;
selection-mode: none;
}

Gtk.Label {
styles ["heading"]
xalign: 0;
margin-top: 20;
label: _("System Extensions");
}

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

Gtk.Revealer updates_action_bar {
reveal-child: false;
transition-type: slide_up;

Gtk.Box {
styles ["actionbar", "update-bar"]
spacing: 12;

Gtk.Image update_icon {
styles ["update"]

icon-name: "software-update-available-symbolic";
pixel-size: 24;

valign: center;
halign: center;
}

Gtk.Box {
orientation: vertical;
valign: center;
hexpand: true;

Gtk.Label {
styles ["heading"]

xalign: 0;
label: _("Updates are available");
ellipsize: end;
}

Gtk.Label num_updates_label {
xalign: 0;
ellipsize: end;
}
}

[end]
Gtk.Button {
styles ["suggested-action"]

valign: center;
halign: center;

label: _("Log Out");
action-name: "app.logout";
}
}
}
}
template $ExmInstalledPage: Gtk.Widget {
notify::manager => $on_bind_manager();

Gtk.Box {
orientation: vertical;

Adw.PreferencesPage {
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.PreferencesGroup {
title: _("User-Installed Extensions");

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

selection-mode: none;
}
}

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

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

selection-mode: none;
}
}
}

Gtk.Revealer updates_action_bar {
reveal-child: false;
transition-type: slide_up;

Gtk.Box {
styles [
"actionbar",
"update-bar"
]

spacing: 12;

Gtk.Image update_icon {
styles [
"update"
]

icon-name: "software-update-available-symbolic";
pixel-size: 24;
valign: center;
halign: center;
}

Gtk.Box {
orientation: vertical;
valign: center;
hexpand: true;

Gtk.Label {
styles [
"heading"
]

xalign: 0;
label: _("Updates are available");
ellipsize: end;
}

Gtk.Label num_updates_label {
xalign: 0;
ellipsize: end;
}
}

[end]
Gtk.Button {
styles [
"suggested-action"
]

valign: center;
halign: center;
label: _("Log Out");
action-name: "app.logout";
}
}
}
}
}

0 comments on commit 69483f7

Please sign in to comment.