elementaryart team mailing list archive
-
elementaryart team
-
Mailing list archive
-
Message #02188
[Merge] lp:~xapantu/granite/fix-1020355 into lp:granite
xapantu has proposed merging lp:~xapantu/granite/fix-1020355 into lp:granite.
Requested reviews:
elementary Pantheon team (elementary-pantheon)
Related bugs:
Bug #1020355 in Granite: "Gtk Spinner doesn't spin"
https://bugs.launchpad.net/granite/+bug/1020355
For more details, see:
https://code.launchpad.net/~xapantu/granite/fix-1020355/+merge/113829
--
https://code.launchpad.net/~xapantu/granite/fix-1020355/+merge/113829
Your team elementaryart (old) is subscribed to branch lp:granite.
=== modified file 'demo/main.vala'
--- demo/main.vala 2012-07-07 16:46:21 +0000
+++ demo/main.vala 2012-07-07 17:59:18 +0000
@@ -212,7 +212,9 @@
/* DynamicNotebook */
var dynamic_notebook = new DynamicNotebook ();
notebook.append_page (dynamic_notebook, new Gtk.Label ("Dynamic Notebook"));
- dynamic_notebook.insert_tab (new Tab ("Page 1", new ThemedIcon ("empty"), new Gtk.Label ("Page 1")), -1);
+ var tab = new Tab ("Page 1", new ThemedIcon ("empty"), new Gtk.Label ("Page 1"));
+ dynamic_notebook.insert_tab (tab, -1);
+ tab.working = true;
dynamic_notebook.insert_tab (new Tab ("Page 2", new ThemedIcon ("empty"), new Gtk.Label ("Page 2")), -1);
dynamic_notebook.tab_added.connect ( (t) => {
t.page = new Gtk.Label ("new!");
=== modified file 'lib/Widgets/DynamicNotebook.vala'
--- lib/Widgets/DynamicNotebook.vala 2012-07-07 16:46:21 +0000
+++ lib/Widgets/DynamicNotebook.vala 2012-07-07 17:59:18 +0000
@@ -39,7 +39,10 @@
bool __working;
public bool working {
get { return __working; }
- set { __working = _working.visible = value; _icon.visible = !value; }
+ set { __working = _working.visible = value; _icon.visible = !value;
+ if (__working) _working.show_all();
+ else _working.hide();
+ }
}
public Pango.EllipsizeMode ellipsize_mode {
@@ -70,9 +73,9 @@
else
this._icon = new Gtk.Image.from_stock (Gtk.Stock.MISSING_IMAGE, Gtk.IconSize.MENU);
this._working = new Gtk.Spinner ();
+ _working.start();
this.close = new Gtk.Button ();
- working = false;
close.add (new Gtk.Image.from_stock (Gtk.Stock.CLOSE, Gtk.IconSize.MENU));
close.relief = Gtk.ReliefStyle.NONE;
@@ -88,13 +91,8 @@
this.pack_start (this._icon, false);
this.pack_start (this._working, false);
- this._working.show.connect (() => {
- if (!working)
- _working.hide ();
- });
-
page_container = new Gtk.EventBox ();
- page_container.add ((page == null)?new Gtk.Label (""):page);
+ page_container.add (page ?? new Gtk.Label (""));
page_container.show_all ();
this.show_all ();
@@ -108,6 +106,7 @@
});
close.clicked.connect ( () => this.closed () );
+ working = false;
}
}
Follow ups