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
.ShadowType
= ShadowType
.None
;
28 main
= new WhiteBox ();
32 detailsSW
= new Gtk
.ScrolledWindow ();
33 detailsSW
.SetPolicy (Gtk
.PolicyType
.Never
, Gtk
.PolicyType
.Never
);
34 detailsSW
.WidthRequest
= 0;
35 detailsSW
.NoShowAll
= true;
36 detailsSW
.ShadowType
= Gtk
.ShadowType
.In
;
37 Pack2 (detailsSW
, false, false);
39 vp
= new Gtk
.Viewport (null, null);
40 vp
.ShadowType
= ShadowType
.None
;
44 details
= new WhiteBox ();
49 public Gtk
.Widget MainContents
{
54 if (main
.Child
!= null)
55 main
.Remove (main
.Child
);
58 if (value is Container
)
59 ((Container
)value).FocusVadjustment
= mainSW
.Vadjustment
;
64 public Gtk
.Widget Details
{
69 if (details
.Child
!= null)
70 details
.Remove (details
.Child
);
79 private void MainResized (object obj
, Gtk
.SizeAllocatedArgs args
)
81 // If the details pane pops up and covers the selected tile,
84 Gtk
.Container mainChild
= main
.Child
as Gtk
.Container
;
85 if (mainChild
!= null) {
86 Gtk
.Widget focusChild
= mainChild
.FocusChild
;
87 mainChild
.FocusChild
= null;
88 mainChild
.FocusChild
= focusChild
;
92 public class WhiteBox
: Gtk
.EventBox
94 public WhiteBox () : base ()
99 protected override bool OnExposeEvent (Gdk
.EventExpose evt
)
104 if (evt
.Window
== GdkWindow
) {
105 GdkWindow
.DrawRectangle (Style
.BaseGC (State
), true,
106 evt
.Area
.X
, evt
.Area
.Y
,
107 evt
.Area
.Width
, evt
.Area
.Height
);
111 PropagateExpose (Child
, evt
);