public DockBarItem(DockBar bar, DockItem it, int size) { Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask; this.size = size; this.bar = bar; this.it = it; VisibleWindow = false; UpdateTab(); lastFrameSize = bar.Frame.Allocation.Size; bar.Frame.SizeAllocated += HandleBarFrameSizeAllocated; tracker = new MouseTracker(this); tracker.TrackMotion = false; tracker.HoveredChanged += (sender, e) => { if (crossfade == null) { return; } AnimateHover(tracker.Hovered); if (tracker.Hovered) { crossfade.ShowSecondary(); } else { crossfade.ShowPrimary(); } }; Styles.Changed += UpdateStyle; }
public DockBar ExtractDockBar(PositionType pos) { DockBar db = new DockBar(this, pos); switch (pos) { case PositionType.Left: db.OriginalBar = dockBarLeft; dockBarLeft = db; break; case PositionType.Top: db.OriginalBar = dockBarTop; dockBarTop = db; break; case PositionType.Right: db.OriginalBar = dockBarRight; dockBarRight = db; break; case PositionType.Bottom: db.OriginalBar = dockBarBottom; dockBarBottom = db; break; } return(db); }
public DockFrame() { Mono.TextEditor.GtkWorkarounds.FixContainerLeak(this); shadedContainer = new ShadedContainer(); dockBarTop = new DockBar(this, Gtk.PositionType.Top); dockBarBottom = new DockBar(this, Gtk.PositionType.Bottom); dockBarLeft = new DockBar(this, Gtk.PositionType.Left); dockBarRight = new DockBar(this, Gtk.PositionType.Right); container = new DockContainer(this); HBox hbox = new HBox(); hbox.PackStart(dockBarLeft, false, false, 0); hbox.PackStart(container, true, true, 0); hbox.PackStart(dockBarRight, false, false, 0); mainBox = new VBox(); mainBox.PackStart(dockBarTop, false, false, 0); mainBox.PackStart(hbox, true, true, 0); mainBox.PackStart(dockBarBottom, false, false, 0); Add(mainBox); mainBox.ShowAll(); mainBox.NoShowAll = true; CompactGuiLevel = 2; dockBarTop.UpdateVisibility(); dockBarBottom.UpdateVisibility(); dockBarLeft.UpdateVisibility(); dockBarRight.UpdateVisibility(); }
public DockFrame() { shadedContainer = new ShadedContainer (); dockBarTop = new DockBar (this, Gtk.PositionType.Top); dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom); dockBarLeft = new DockBar (this, Gtk.PositionType.Left); dockBarRight = new DockBar (this, Gtk.PositionType.Right); container = new DockContainer (this); HBox hbox = new HBox (); hbox.PackStart (dockBarLeft, false, false, 0); hbox.PackStart (container, true, true, 0); hbox.PackStart (dockBarRight, false, false, 0); mainBox = new VBox (); mainBox.PackStart (dockBarTop, false, false, 0); mainBox.PackStart (hbox, true, true, 0); mainBox.PackStart (dockBarBottom, false, false, 0); Add (mainBox); mainBox.ShowAll (); mainBox.NoShowAll = true; CompactGuiLevel = 2; dockBarTop.UpdateVisibility (); dockBarBottom.UpdateVisibility (); dockBarLeft.UpdateVisibility (); dockBarRight.UpdateVisibility (); }
public DockFrame () { GtkWorkarounds.FixContainerLeak (this); dockBarTop = new DockBar (this, Gtk.PositionType.Top); dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom); dockBarLeft = new DockBar (this, Gtk.PositionType.Left); dockBarRight = new DockBar (this, Gtk.PositionType.Right); container = new DockContainer (this); HBox hbox = new HBox (); hbox.PackStart (dockBarLeft, false, false, 0); hbox.PackStart (container, true, true, 0); hbox.PackStart (dockBarRight, false, false, 0); mainBox = new VBox (); mainBox.PackStart (dockBarTop, false, false, 0); mainBox.PackStart (hbox, true, true, 0); mainBox.PackStart (dockBarBottom, false, false, 0); Add (mainBox); mainBox.ShowAll (); mainBox.NoShowAll = true; CompactGuiLevel = 2; UpdateDockbarsVisibility (); DefaultVisualStyle = new DockVisualStyle (); }
public DockFrame() { GtkWorkarounds.FixContainerLeak(this); dockBarTop = new DockBar(this, Gtk.PositionType.Top); dockBarBottom = new DockBar(this, Gtk.PositionType.Bottom); dockBarLeft = new DockBar(this, Gtk.PositionType.Left); dockBarRight = new DockBar(this, Gtk.PositionType.Right); container = new DockContainer(this); HBox hbox = new HBox(); hbox.PackStart(dockBarLeft, false, false, 0); hbox.PackStart(container, true, true, 0); hbox.PackStart(dockBarRight, false, false, 0); mainBox = new VBox(); mainBox.PackStart(dockBarTop, false, false, 0); mainBox.PackStart(hbox, true, true, 0); mainBox.PackStart(dockBarBottom, false, false, 0); Add(mainBox); mainBox.ShowAll(); mainBox.NoShowAll = true; CompactGuiLevel = 2; UpdateDockbarsVisibility(); DefaultVisualStyle = new DockVisualStyle(); }
public DockBarItem (DockBar bar, DockItem it, int size) { Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask; this.size = size; this.bar = bar; this.it = it; VisibleWindow = false; UpdateTab (); }
public DockBarItem (DockBar bar, DockItem it, int size) { Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask; this.size = size; this.bar = bar; this.it = it; VisibleWindow = false; UpdateTab (); lastFrameSize = bar.Frame.Allocation.Size; bar.Frame.SizeAllocated += HandleBarFrameSizeAllocated; }
public DockBarItem(DockBar bar, DockItem it, int size) { Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask; this.size = size; this.bar = bar; this.it = it; VisibleWindow = false; UpdateTab(); lastFrameSize = bar.Frame.Allocation.Size; bar.Frame.SizeAllocated += HandleBarFrameSizeAllocated; }
Gdk.Size GetBarFrameSize(DockBar bar) { if (bar.OriginalBar != null) { bar = bar.OriginalBar; } if (!bar.Visible) { return(new Gdk.Size(0, 0)); } Gtk.Requisition req = bar.SizeRequest(); return(new Gdk.Size(req.Width, req.Height)); }
internal AutoHideBox AutoShow(DockItem item, DockBar bar, int size) { AutoHideBox aframe = new AutoHideBox(this, item, bar.Position, size); Gdk.Size sTop = GetBarFrameSize(dockBarTop); Gdk.Size sBot = GetBarFrameSize(dockBarBottom); Gdk.Size sLeft = GetBarFrameSize(dockBarLeft); Gdk.Size sRgt = GetBarFrameSize(dockBarRight); int x, y, w, h; if (bar == dockBarLeft || bar == dockBarRight) { h = Allocation.Height - sTop.Height - sBot.Height; w = size; y = sTop.Height; if (bar == dockBarLeft) { x = sLeft.Width; } else { x = Allocation.Width - size - sRgt.Width; } } else { w = Allocation.Width - sLeft.Width - sRgt.Width; h = size; x = sLeft.Width; if (bar == dockBarTop) { y = sTop.Height; } else { y = Allocation.Height - size - sBot.Height; } } AddTopLevel(aframe, x, y, w, h); aframe.AnimateShow(); return(aframe); }
public DockBarItem(DockBar bar, DockItem it, int size) { var actionHandler = new ActionDelegate(this); actionHandler.PerformPress += OnPerformPress; Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask; this.size = size; this.bar = bar; this.it = it; CanFocus = true; VisibleWindow = false; UpdateTab(); lastFrameSize = bar.Frame.Allocation.Size; bar.Frame.SizeAllocated += HandleBarFrameSizeAllocated; tracker = new MouseTracker(this); tracker.TrackMotion = false; tracker.HoveredChanged += (sender, e) => { if (crossfade == null) { return; } AnimateHover(tracker.Hovered); if (tracker.Hovered) { crossfade.ShowSecondary(); } else { crossfade.ShowPrimary(); } }; Styles.Changed += UpdateStyle; Accessible.Name = "DockbarItem"; Accessible.Role = Atk.Role.PushButton; }
internal void UpdateSize(DockBar bar, AutoHideBox aframe) { Gdk.Size sTop = GetBarFrameSize(dockBarTop); Gdk.Size sBot = GetBarFrameSize(dockBarBottom); Gdk.Size sLeft = GetBarFrameSize(dockBarLeft); Gdk.Size sRgt = GetBarFrameSize(dockBarRight); if (bar == dockBarLeft || bar == dockBarRight) { aframe.HeightRequest = Allocation.Height - sTop.Height - sBot.Height; if (bar == dockBarRight) { aframe.X = Allocation.Width - aframe.Allocation.Width - sRgt.Width; } } else { aframe.WidthRequest = Allocation.Width - sLeft.Width - sRgt.Width; if (bar == dockBarBottom) { aframe.Y = Allocation.Height - aframe.Allocation.Height - sBot.Height; } } }
internal void UpdateSize (DockBar bar, AutoHideBox aframe) { Gdk.Size sTop = GetBarFrameSize (dockBarTop); Gdk.Size sBot = GetBarFrameSize (dockBarBottom); Gdk.Size sLeft = GetBarFrameSize (dockBarLeft); Gdk.Size sRgt = GetBarFrameSize (dockBarRight); if (bar == dockBarLeft || bar == dockBarRight) { aframe.HeightRequest = Allocation.Height - sTop.Height - sBot.Height; if (bar == dockBarRight) aframe.X = Allocation.Width - aframe.Allocation.Width - sRgt.Width; } else { aframe.WidthRequest = Allocation.Width - sLeft.Width - sRgt.Width; if (bar == dockBarBottom) aframe.Y = Allocation.Height - aframe.Allocation.Height - sBot.Height; } }
internal AutoHideBox AutoShow (DockItem item, DockBar bar, int size) { AutoHideBox aframe = new AutoHideBox (this, item, bar.Position, size); Gdk.Size sTop = GetBarFrameSize (dockBarTop); Gdk.Size sBot = GetBarFrameSize (dockBarBottom); Gdk.Size sLeft = GetBarFrameSize (dockBarLeft); Gdk.Size sRgt = GetBarFrameSize (dockBarRight); int x,y,w,h; if (bar == dockBarLeft || bar == dockBarRight) { h = Allocation.Height - sTop.Height - sBot.Height; w = size; y = sTop.Height; if (bar == dockBarLeft) x = sLeft.Width; else x = Allocation.Width - size - sRgt.Width; } else { w = Allocation.Width - sLeft.Width - sRgt.Width; h = size; x = sLeft.Width; if (bar == dockBarTop) y = sTop.Height; else y = Allocation.Height - size - sBot.Height; } AddTopLevel (aframe, x, y, w, h); aframe.AnimateShow (); return aframe; }
public DockBar ExtractDockBar (PositionType pos) { DockBar db = new DockBar (this, pos); switch (pos) { case PositionType.Left: db.OriginalBar = dockBarLeft; dockBarLeft = db; break; case PositionType.Top: db.OriginalBar = dockBarTop; dockBarTop = db; break; case PositionType.Right: db.OriginalBar = dockBarRight; dockBarRight = db; break; case PositionType.Bottom: db.OriginalBar = dockBarBottom; dockBarBottom = db; break; } return db; }
Gdk.Size GetBarFrameSize (DockBar bar) { if (bar.OriginalBar != null) bar = bar.OriginalBar; if (!bar.Visible) return new Gdk.Size (0,0); Gtk.Requisition req = bar.SizeRequest (); return new Gdk.Size (req.Width, req.Height); }
public DockBarItem (DockBar bar, DockItem it, int size) { Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask; this.size = size; this.bar = bar; this.it = it; VisibleWindow = false; UpdateTab (); lastFrameSize = bar.Frame.Allocation.Size; bar.Frame.SizeAllocated += HandleBarFrameSizeAllocated; tracker = new MouseTracker (this); tracker.TrackMotion = false; tracker.HoveredChanged += (sender, e) => { if (crossfade == null) return; AnimateHover (tracker.Hovered); if (tracker.Hovered) crossfade.ShowSecondary (); else crossfade.ShowPrimary (); }; Styles.Changed += UpdateStyle; }