4 using System
.Collections
;
8 public class Panes
: Gtk
.VPaned
{
10 Gtk
.ScrolledWindow mainSW
, detailsSW
;
11 WhiteBox main
, details
;
17 mainSW
= new Gtk
.ScrolledWindow ();
18 mainSW
.SetPolicy (Gtk
.PolicyType
.Never
, Gtk
.PolicyType
.Always
);
19 mainSW
.ShadowType
= Gtk
.ShadowType
.In
;
20 mainSW
.SizeAllocated
+= MainResized
;
21 Pack1 (mainSW
, true, false);
23 vp
= new Gtk
.Viewport (null, null);
24 vp
.ResizeMode
= Gtk
.ResizeMode
.Parent
;
25 vp
.ShadowType
= ShadowType
.None
;
29 main
= new WhiteBox ();
33 detailsSW
= new Gtk
.ScrolledWindow ();
34 detailsSW
.SetPolicy (Gtk
.PolicyType
.Never
, Gtk
.PolicyType
.Never
);
35 detailsSW
.WidthRequest
= 0;
36 detailsSW
.NoShowAll
= true;
37 detailsSW
.ShadowType
= Gtk
.ShadowType
.In
;
38 Pack2 (detailsSW
, false, false);
40 vp
= new Gtk
.Viewport (null, null);
41 vp
.ShadowType
= ShadowType
.None
;
45 details
= new WhiteBox ();
50 public Gtk
.Widget MainContents
{
55 if (main
.Child
!= null)
56 main
.Remove (main
.Child
);
59 if (value is Container
)
60 ((Container
)value).FocusVadjustment
= mainSW
.Vadjustment
;
65 public Gtk
.Widget Details
{
70 if (details
.Child
!= null)
71 details
.Remove (details
.Child
);
77 public void ToggleDetails (bool visible
)
85 private void MainResized (object obj
, Gtk
.SizeAllocatedArgs args
)
87 // If the details pane pops up and covers the selected tile,
90 Gtk
.Container mainChild
= main
.Child
as Gtk
.Container
;
91 if (mainChild
!= null) {
92 Gtk
.Widget focusChild
= mainChild
.FocusChild
;
93 mainChild
.FocusChild
= null;
94 mainChild
.FocusChild
= focusChild
;
98 public class WhiteBox
: Gtk
.EventBox
100 public WhiteBox () : base ()
105 protected override bool OnExposeEvent (Gdk
.EventExpose evt
)
110 if (evt
.Window
== GdkWindow
) {
111 GdkWindow
.DrawRectangle (Style
.BaseGC (State
), true,
112 evt
.Area
.X
, evt
.Area
.Y
,
113 evt
.Area
.Width
, evt
.Area
.Height
);
117 PropagateExpose (Child
, evt
);