public PadTitleWindow(DockFrame frame, DockItem draggedItem) : base(Gtk.WindowType.Popup) { SkipTaskbarHint = true; Decorated = false; TransientFor = (Gtk.Window)frame.Toplevel; TypeHint = WindowTypeHint.Utility; VBox mainBox = new VBox(); HBox box = new HBox(false, 3); if (draggedItem.Icon != null) { Gtk.Image img = new Gtk.Image(draggedItem.Icon); box.PackStart(img, false, false, 0); } Gtk.Label la = new Label(); la.Markup = draggedItem.Title; box.PackStart(la, false, false, 0); mainBox.PackStart(box, false, false, 0); CustomFrame f = new CustomFrame(); f.SetPadding(12, 12, 12, 12); f.SetMargins(2, 2, 2, 2); f.Add(mainBox); Add(f); ShowAll(); }
public PadTitleWindow(DockFrame frame, DockItem draggedItem) : base(Gtk.WindowType.Popup) { SkipTaskbarHint = true; Decorated = false; TransientFor = (Gtk.Window)frame.Toplevel; TypeHint = WindowTypeHint.Utility; VBox mainBox = new VBox(); HBox box = new HBox(false, 3); if (draggedItem.Icon != null) { Gtk.Image img = new Gtk.Image(draggedItem.Icon); box.PackStart(img, false, false, 0); } Gtk.Label la = new Label(); la.Markup = draggedItem.Title; box.PackStart(la, false, false, 0); mainBox.PackStart(box, false, false, 0); /* if (draggedItem.Widget.IsRealized) { * var win = draggedItem.Widget.GdkWindow; * var alloc = draggedItem.Widget.Allocation; * Gdk.Pixbuf img = Gdk.Pixbuf.FromDrawable (win, win.Colormap, alloc.X, alloc.Y, 0, 0, alloc.Width, alloc.Height); * * double mw = 140, mh = 140; * if (img.Width > img.Height) * mw *= 2; * else * mh *= 2; * * double r = Math.Min (mw / img.Width, mh / img.Height); * img = img.ScaleSimple ((int)(img.Width * r), (int)(img.Height * r), Gdk.InterpType.Hyper); * mainBox.PackStart (new Gtk.Image (img), false, false, 0); * }*/ CustomFrame f = new CustomFrame(); f.SetPadding(12, 12, 12, 12); f.SetMargins(1, 1, 1, 1); f.Add(mainBox); Add(f); ShowAll(); }
internal DockItemToolbar(DockItem parentItem, PositionType position) { this.parentItem = parentItem; topFrame = new CustomFrame(); topFrame.SetPadding(3, 3, 3, 3); /* switch (position) { * case PositionType.Top: * frame.SetMargins (0, 0, 1, 1); * frame.SetPadding (0, 2, 2, 0); * break; * case PositionType.Bottom: * frame.SetMargins (0, 1, 1, 1); * frame.SetPadding (2, 2, 2, 0); * break; * case PositionType.Left: * frame.SetMargins (0, 1, 1, 0); * frame.SetPadding (0, 0, 2, 2); * break; * case PositionType.Right: * frame.SetMargins (0, 1, 0, 1); * frame.SetPadding (0, 0, 2, 2); * break; * }*/ this.position = position; if (position == PositionType.Top || position == PositionType.Bottom) { box = new HBox(false, 3); } else { box = new VBox(false, 3); } box.Show(); // frame = box; frame = topFrame; topFrame.Add(box); // topFrame.GradientBackround = true; }
internal DockItemToolbar(DockItem parentItem, PositionType position) { this.parentItem = parentItem; topFrame = new CustomFrame (); topFrame.SetPadding (3,3,3,3); /* switch (position) { case PositionType.Top: frame.SetMargins (0, 0, 1, 1); frame.SetPadding (0, 2, 2, 0); break; case PositionType.Bottom: frame.SetMargins (0, 1, 1, 1); frame.SetPadding (2, 2, 2, 0); break; case PositionType.Left: frame.SetMargins (0, 1, 1, 0); frame.SetPadding (0, 0, 2, 2); break; case PositionType.Right: frame.SetMargins (0, 1, 0, 1); frame.SetPadding (0, 0, 2, 2); break; }*/ this.position = position; if (position == PositionType.Top || position == PositionType.Bottom) box = new HBox (false, 3); else box = new VBox (false, 3); box.Show (); // frame = box; frame = topFrame; topFrame.Add (box); // topFrame.GradientBackround = true; }
public PadTitleWindow(DockFrame frame, DockItem draggedItem) : base(Gtk.WindowType.Popup) { SkipTaskbarHint = true; Decorated = false; TransientFor = (Gtk.Window) frame.Toplevel; TypeHint = WindowTypeHint.Utility; VBox mainBox = new VBox (); HBox box = new HBox (false, 3); if (draggedItem.Icon != null) { Gtk.Image img = new Gtk.Image (draggedItem.Icon); box.PackStart (img, false, false, 0); } Gtk.Label la = new Label (); la.Markup = draggedItem.Title; box.PackStart (la, false, false, 0); mainBox.PackStart (box, false, false, 0); /* if (draggedItem.Widget.IsRealized) { var win = draggedItem.Widget.GdkWindow; var alloc = draggedItem.Widget.Allocation; Gdk.Pixbuf img = Gdk.Pixbuf.FromDrawable (win, win.Colormap, alloc.X, alloc.Y, 0, 0, alloc.Width, alloc.Height); double mw = 140, mh = 140; if (img.Width > img.Height) mw *= 2; else mh *= 2; double r = Math.Min (mw / img.Width, mh / img.Height); img = img.ScaleSimple ((int)(img.Width * r), (int)(img.Height * r), Gdk.InterpType.Hyper); mainBox.PackStart (new Gtk.Image (img), false, false, 0); }*/ CustomFrame f = new CustomFrame (); f.SetPadding (12, 12, 12, 12); f.SetMargins (1, 1, 1, 1); f.Add (mainBox); Add (f); ShowAll (); }