public SparkleInfobar(string icon_name, string title, string text) { Window window = new Window (WindowType.Popup) { Name = "gtk-tooltip" }; window.EnsureStyle (); Style = window.Style; Label label = new Label () { Markup = "<b>" + title + "</b>\n" + text }; HBox hbox = new HBox (false, 12) { BorderWidth = 12 }; hbox.PackStart (new Image (SparkleUIHelpers.GetIcon (icon_name, 24)), false, false, 0); hbox.PackStart (label, false, false, 0); Add (hbox); }
static NotificationMessage () { Gtk.Window temp_win = new Gtk.Window (WindowType.Popup); temp_win.Name = "gtk-tooltips"; temp_win.EnsureStyle (); style = temp_win.Style.Copy (); }
static NotificationMessage() { Gtk.Window temp_win = new Gtk.Window(WindowType.Popup); temp_win.Name = "gtk-tooltips"; temp_win.EnsureStyle(); style = temp_win.Style.Copy(); }
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; }
void OnStyleSet(object o, StyleSetArgs args) { if (d_changingStyle) { return; } Gtk.Window wnd = new Gtk.Window(WindowType.Popup); wnd.Name = "gtk-tooltip"; wnd.EnsureStyle(); Gtk.Widget thisone = (Gtk.Widget)o; Style style = wnd.Style; d_changingStyle = true; thisone.Style = style; d_changingStyle = false; QueueDraw(); }