~ddieter/appcenter/appcenter-version-info

« back to all changes in this revision

Viewing changes to src/Widgets/PackageRow.vala

  • Committer: Dieter Debast
  • Date: 2016-10-01 20:21:54 UTC
  • Revision ID: dieter_debast@hotmail.com-20161001202154-r5licgne3hif8red
Show version of update when an update is available

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
            public AbstractPackageRowGrid (AppCenterCore.Package package, Gtk.SizeGroup? size_group, bool show_uninstall = true) {
96
96
                this.package = package;
97
97
                this.show_uninstall = show_uninstall;
98
 
                //set_up_package ();
99
98
 
100
99
                if (size_group != null) {
101
100
                    size_group.add_widget (action_button);
118
117
                app_version.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);
119
118
                app_version.hexpand = true;
120
119
                app_version.valign = Gtk.Align.START;
121
 
                app_version.ellipsize = Pango.EllipsizeMode.END;
122
120
                ((Gtk.Misc) app_version).xalign = 0;
123
121
 
124
122
                attach (app_version, 1, 1, 1, 1);
130
128
            }
131
129
            
132
130
            protected override void set_up_package (uint icon_size = 48) {
133
 
                new Thread<void*> (null, () => {
134
 
                    app_version.label = package.get_version ();
135
 
                    return null;
136
 
                });
 
131
                app_version.label = package.get_version ();
 
132
                app_version.ellipsize = Pango.EllipsizeMode.END;
137
133
                base.set_up_package (icon_size);
138
134
            }
 
135
            
 
136
            protected override void update_state () {
 
137
                app_version.label = package.get_version ();
 
138
                app_version.ellipsize = Pango.EllipsizeMode.END;
 
139
                update_action (show_uninstall);
 
140
                changed ();
 
141
            }
139
142
        }
140
143
 
141
144
        private class ListPackageRowGrid : AbstractPackageRowGrid {