public MessageBar() : base(0.0f, 0.5f, 1.0f, 0.0f) { win = new Window(WindowType.Popup) { Name = "gtk-tooltips" }; win.EnsureStyle(); win.StyleSet += delegate { Style = win.Style; }; var shell_box = new HBox { Spacing = 10 }; box = new HBox { Spacing = 10 }; image = new AnimatedImage(); try { image.Pixbuf = Gtk.IconTheme.Default.LoadIcon("process-working", 22, IconLookupFlags.NoSvg); image.FrameHeight = 22; image.FrameWidth = 22; Spinning = false; image.Load(); } catch { } label = new WrapLabel(); label.Show(); box.PackStart(image, false, false, 0); box.PackStart(label, true, true, 0); box.Show(); button_box = new HBox { Spacing = 3 }; close_button = new Button(new Image(Stock.Close, IconSize.Menu)) { Relief = ReliefStyle.None }; close_button.Clicked += delegate { Hide(); }; close_button.ShowAll(); close_button.Hide(); shell_box.PackStart(box, true, true, 0); shell_box.PackStart(button_box, false, false, 0); shell_box.PackStart(close_button, false, false, 0); shell_box.Show(); Add(shell_box); EnsureStyle(); BorderWidth = 3; }
public IndexingStatusWindow() : base("IndexingStatusWindow") { indexingSpinner = new Hyena.Widgets.AnimatedImage(); indexingSpinner.SetSizeRequest(16, 16); indexingSpinner.Pixbuf = Gui.LoadIcon(22, "process-working"); indexingSpinner.FrameHeight = 22; indexingSpinner.FrameWidth = 22; indexingSpinner.Load(); indexingSpinnerAlignment.Add(indexingSpinner); hashingSpinner = new Hyena.Widgets.AnimatedImage(); hashingSpinner.SetSizeRequest(16, 16); hashingSpinner.Pixbuf = Gui.LoadIcon(22, "process-working"); hashingSpinner.FrameHeight = 22; hashingSpinner.FrameWidth = 22; hashingSpinner.Load(); hashingSpinnerAlignment.Add(hashingSpinner); Core.ShareBuilder.StartedIndexing += delegate { Application.Invoke(delegate { indexingFileLabel.Text = "(Starting...)"; indexingSpinner.Show(); }); }; Core.ShareBuilder.IndexingFile += delegate (ShareBuilder builder, string filePath) { Application.Invoke(delegate { indexingFileLabel.Text = filePath; indexingSpinner.Show(); }); }; Core.ShareBuilder.FinishedIndexing += delegate { Application.Invoke(delegate { indexingFileLabel.Text = "(Idle)"; indexingSpinner.Hide(); }); }; Core.ShareBuilder.StoppedIndexing += delegate { Application.Invoke(delegate { indexingFileLabel.Text = "(Idle - last run aborted)"; indexingSpinner.Hide(); }); }; Core.ShareHasher.StartedHashingFile += delegate { UpdateShareHasherStatus(); }; Core.ShareHasher.FinishedHashingFile += delegate { UpdateShareHasherStatus(); }; Core.ShareHasher.QueueChanged += delegate { UpdateShareHasherStatus(); }; }
public MessageBar () : base (0.0f, 0.5f, 1.0f, 0.0f) { win = new Window (WindowType.Popup); win.Name = "gtk-tooltips"; win.EnsureStyle (); win.StyleSet += delegate { Style = win.Style; }; HBox shell_box = new HBox (); shell_box.Spacing = 10; box = new HBox (); box.Spacing = 10; image = new AnimatedImage (); try { image.Pixbuf = Gtk.IconTheme.Default.LoadIcon ("process-working", 22, IconLookupFlags.NoSvg); image.FrameHeight = 22; image.FrameWidth = 22; Spinning = false; image.Load (); } catch { } label = new WrapLabel (); label.Show (); box.PackStart (image, false, false, 0); box.PackStart (label, true, true, 0); box.Show (); button_box = new HBox (); button_box.Spacing = 3; close_button = new Button (new Image (Stock.Close, IconSize.Menu)); close_button.Relief = ReliefStyle.None; close_button.Clicked += delegate { Hide (); }; close_button.ShowAll (); close_button.Hide (); shell_box.PackStart (box, true, true, 0); shell_box.PackStart (button_box, false, false, 0); shell_box.PackStart (close_button, false, false, 0); shell_box.Show (); Add (shell_box); EnsureStyle (); BorderWidth = 3; }
private void CreateStatusbar() { statusBar = new Toolbar(); statusBar.ShowArrow = false; statusBar.ToolbarStyle = ToolbarStyle.BothHoriz; statusBar.ExposeEvent += StatusBarExposeEvent; statusLabel = new Label(); statusLabel.Xalign = 0; statusLabel.Xpad = 6; ToolItem statusLabelItem = new ToolItem(); Alignment statusAlign = new Alignment(0.5f, 0.5f, 1.0f, 1.0f); statusLabelItem.Add(statusLabel); statusLabelItem.Expand = true; statusBar.Insert(statusLabelItem, -1); statusLabelItem.ShowAll(); taskStatusIcon = new Hyena.Widgets.AnimatedImage(); taskStatusIcon.Pixbuf = Gui.LoadIcon(22, "process-working"); taskStatusIcon.FrameHeight = 22; taskStatusIcon.FrameWidth = 22; taskStatusIcon.Load(); EventBox taskStatusIconBox = new EventBox(); taskStatusIconBox.MotionNotifyEvent += delegate { UpdateTaskStatusIcon(); }; taskStatusIconBox.ButtonReleaseEvent += delegate { IndexingStatusWindow.Instance.Show(); }; taskStatusIconBox.SizeAllocated += delegate (object o, SizeAllocatedArgs args) { statusAlign.LeftPadding = (uint)args.Allocation.Width; }; taskStatusIconBox.SetSizeRequest(22, 22); taskStatusIconBox.Add(taskStatusIcon); taskStatusIconBox.Show(); ToolItem taskStatusIconItem = new ToolItem(); taskStatusIconItem.Add(taskStatusIconBox); statusBar.Insert(taskStatusIconItem, -1); taskStatusIconItem.Show(); mainVBox.PackStart(statusBar, false, false, 0); UpdateTaskStatusIcon(); UpdateStatusText(); }