[Xfce4-commits] <postler:master> Move the status label/ progressbar into the toolbar
Christian Dywan
noreply at xfce.org
Sun Jul 3 14:02:04 CEST 2011
Updating branch refs/heads/master
to d3919a10800431953476d93cc52e5b5a7d498a0a (commit)
from cbcc2c9127f3737526284f95cf7c3475ab3c00db (commit)
commit d3919a10800431953476d93cc52e5b5a7d498a0a
Author: Christian Dywan <christian at twotoasts.de>
Date: Sun Jul 3 02:13:29 2011 +0200
Move the status label/ progressbar into the toolbar
postler/postler-bureau.vala | 71 +++++++++++++++++++++++--------------------
1 files changed, 38 insertions(+), 33 deletions(-)
diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index aac9de7..1553699 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -23,6 +23,7 @@ public class Postler.Bureau : Gtk.Window {
Elementary.SearchEntry search;
Gtk.Toolbar search_options;
public Postler.Folders folders;
+ Gtk.ToolItem statusitem;
Gtk.ProgressBar progressbar;
Gtk.Label statuslabel;
Gtk.VBox messages_box;
@@ -601,6 +602,43 @@ public class Postler.Bureau : Gtk.Window {
}
toolbar.show_arrow = false;
actions.get_action ("MessageNew").is_important = true;
+
+ statusitem = new Gtk.ToolItem ();
+ toolbar.insert (statusitem, -1);
+ var align = new Gtk.Alignment (0.0f, 0.5f, 1.0f, 0.1f);
+ statusitem.add (align);
+ var statusbox = new Gtk.VBox (false, 4);
+ align.add (statusbox);
+ statuslabel = new Gtk.Label ("");
+ statuslabel.justify = Gtk.Justification.CENTER;
+ statuslabel.ellipsize = Pango.EllipsizeMode.END;
+ statusbox.pack_end (statuslabel, false, false, 0);
+ progressbar = new Gtk.ProgressBar ();
+ statusbox.pack_end (progressbar, false, false, 0);
+ statusitem.show_all ();
+ align.set_no_show_all (true);
+ align.hide ();
+ client.progress.connect ((account, text, fraction) => {
+ if (text != null) {
+ statuslabel.label = text;
+ progressbar.fraction = fraction;
+ if (!statusitem.child.visible) {
+ statusitem.child.show ();
+ actions.get_action ("MailReceive").sensitive = false;
+ }
+ } else {
+ if (statusitem.child.visible) {
+ statusitem.child.hide ();
+ actions.get_action ("MailReceive").sensitive = true;
+ }
+ }
+ });
+
+ var separator = new Gtk.SeparatorToolItem ();
+ toolbar.insert (separator, -1);
+ separator.set_expand (true);
+ separator.draw = false;
+
var toolitem = new Gtk.ToolItem ();
toolbar.insert (toolitem, -1);
search = new Elementary.SearchEntry (_("Type To Search..."));
@@ -661,34 +699,6 @@ public class Postler.Bureau : Gtk.Window {
trash_action_infobar.hide ();
});
- progressbar = new Gtk.ProgressBar ();
- statuslabel = new Gtk.Label ("");
- statuslabel.justify = Gtk.Justification.CENTER;
- statuslabel.ellipsize = Pango.EllipsizeMode.END;
- var panebox = new Gtk.VBox (false, 0);
- panebox.set_no_show_all (true);
- panebox.pack_start (new Gtk.TreeView (), true, true, 0);
- hpaned.pack1 (panebox, false, false); /* don't expand, don't shrink */
- progressbar.set_no_show_all (true);
- statuslabel.set_no_show_all (true);
- client.progress.connect ((account, text, fraction) => {
- if (text != null) {
- statuslabel.label = text;
- progressbar.fraction = fraction;
- if (!statuslabel.visible) {
- statuslabel.show ();
- progressbar.show ();
- actions.get_action ("MailReceive").sensitive = false;
- }
- } else {
- if (statuslabel.visible) {
- statuslabel.hide ();
- progressbar.hide ();
- actions.get_action ("MailReceive").sensitive = true;
- }
- }
- });
-
shelf.pack_start (hpaned, true, true, 0);
var vpaned = new Gtk.HPaned ();
hpaned.pack2 (vpaned, true, false); /* do expand, don't shrink */
@@ -709,8 +719,6 @@ public class Postler.Bureau : Gtk.Window {
}
}
messages_box.pack_start (search_options, false, false, 0);
- messages_box.pack_end (progressbar, false, false, 0);
- messages_box.pack_end (statuslabel, false, false, 0);
client.received.connect (client_received);
@@ -758,7 +766,6 @@ public class Postler.Bureau : Gtk.Window {
messages_box.pack_start (welcome_box, true, false, 0);
messages_box.show ();
welcome.address.grab_focus ();
- panebox.set_no_show_all (true);
messages.parent.set_no_show_all (true);
var continue_box = new Gtk.HButtonBox ();
continue_box.set_border_width (16);
@@ -778,8 +785,6 @@ public class Postler.Bureau : Gtk.Window {
return;
welcome_box.hide ();
continue_box.hide ();
- panebox.set_no_show_all (false);
- panebox.show_all ();
messages.parent.set_no_show_all (false);
messages.parent.show_all ();
accounts.add_info (info);
More information about the Xfce4-commits
mailing list