-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
installed-page: Use AdwPreferences* widgets
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
Showing
1 changed file
with
104 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} | ||
} | ||
} | ||
} |