99/* * AppList for the Updates View. Sorts update_available first and shows headers.
1010 * Does not show Uninstall Button **/
1111public class AppCenter.Views.AppListUpdateView : Adw .NavigationPage {
12- private Granite . HeaderLabel header_label;
1312 private Gtk . FlowBox installed_flowbox;
1413 private Gtk . ListBox list_box;
15- private Gtk . Revealer header_revealer;
1614 private Gtk . Revealer updated_revealer;
1715 private Gtk . Label updated_label;
1816 private Gtk . SizeGroup action_button_group;
@@ -23,18 +21,33 @@ public class AppCenter.Views.AppListUpdateView : Adw.NavigationPage {
2321 var update_manager = AppCenterCore . UpdateManager . get_default ();
2422 unowned var flatpak_backend = AppCenterCore . FlatpakBackend . get_default ();
2523
26- header_label = new Granite .HeaderLabel (" " ) {
24+ updated_label = new Gtk .Label (" " );
25+ updated_label. add_css_class (Granite . CssClass . DIM );
26+
27+ var updated_box = new Gtk .Box (HORIZONTAL , 6 );
28+ updated_box. append (new Gtk .Image .from_icon_name (" process-completed-symbolic" ));
29+ updated_box. append (updated_label);
30+
31+ updated_revealer = new Gtk .Revealer () {
32+ child = updated_box
33+ };
34+ updated_revealer. add_css_class (" header" );
35+ flatpak_backend. bind_property (
36+ " up-to-date" , updated_revealer, " reveal-child" , SYNC_CREATE
37+ );
38+
39+ var updatable_header_label = new Granite .HeaderLabel (_(" Available Updates" )) {
2740 hexpand = true ,
2841 valign = CENTER
2942 };
3043 flatpak_backend. bind_property (
31- " n-updatable-packages" , header_label , " label" , SYNC_CREATE ,
44+ " n-updatable-packages" , updatable_header_label , " label" , SYNC_CREATE ,
3245 (binding, from_value, ref to_value) = > {
3346 var n_updatable_packages = from_value. get_uint ();
3447
3548 to_value. set_string (ngettext (
36- " %u Update Available" ,
37- " %u Updates Available" ,
49+ " %u Available Update " ,
50+ " %u Available Updates " ,
3851 n_updatable_packages
3952 ). printf (n_updatable_packages));
4053
@@ -48,44 +61,19 @@ public class AppCenter.Views.AppListUpdateView : Adw.NavigationPage {
4861 };
4962 flatpak_backend. bind_property (" updates-size" , size_label, " size" , SYNC_CREATE );
5063
51- updated_label = new Gtk .Label (" " );
52- updated_label. add_css_class (Granite . CssClass . DIM );
53-
54- var updated_box = new Gtk .Box (HORIZONTAL , 6 );
55- updated_box. append (new Gtk .Image .from_icon_name (" process-completed-symbolic" ));
56- updated_box. append (updated_label);
57-
58- updated_revealer = new Gtk .Revealer () {
59- child = updated_box
60- };
61- updated_revealer. add_css_class (" header" );
62- flatpak_backend. bind_property (
63- " up-to-date" , updated_revealer, " reveal-child" , SYNC_CREATE
64- );
65-
6664 var update_all_button = new Gtk .Button .with_label (_(" Update All" )) {
6765 valign = Gtk . Align . CENTER ,
6866 action_name = " app.update-all"
6967 };
7068 update_all_button. add_css_class (Granite . CssClass . SUGGESTED );
7169
72- var header = new Gtk .Box (HORIZONTAL , 16 );
73- header. append (header_label);
74- header. append (size_label);
75- header. append (update_all_button);
76-
77- header_revealer = new Gtk .Revealer () {
78- child = header
79- };
80- header_revealer. add_css_class (" header" );
81- flatpak_backend. bind_property (
82- " has-updatable-packages" , header_revealer, " reveal-child" , SYNC_CREATE
83- );
84-
85- var updatable_header = new Granite .HeaderLabel (_(" Available Updates" )) {
70+ var updatable_header = new Gtk .Box (HORIZONTAL , 16 ) {
8671 margin_end = 12 ,
8772 margin_start = 12
8873 };
74+ updatable_header. append (updatable_header_label);
75+ updatable_header. append (size_label);
76+ updatable_header. append (update_all_button);
8977
9078 list_box = new Gtk .ListBox () {
9179 activate_on_single_click = true ,
@@ -192,7 +180,6 @@ public class AppCenter.Views.AppListUpdateView : Adw.NavigationPage {
192180 };
193181 toolbarview.add_top_bar (headerbar );
194182 toolbarview.add_top_bar (updated_revealer );
195- toolbarview.add_top_bar (header_revealer );
196183 toolbarview.add_css_class (Granite .STYLE_CLASS_VIEW );
197184
198185 child = toolbarview;
0 commit comments