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
);
80 private void MainResized (object obj
, Gtk
.SizeAllocatedArgs args
)
82 // If the details pane pops up and covers the selected tile,
85 Gtk
.Container mainChild
= main
.Child
as Gtk
.Container
;
86 if (mainChild
!= null) {
87 Gtk
.Widget focusChild
= mainChild
.FocusChild
;
88 mainChild
.FocusChild
= null;
89 mainChild
.FocusChild
= focusChild
;
93 public class WhiteBox
: Gtk
.EventBox
95 public WhiteBox () : base ()
100 protected override bool OnExposeEvent (Gdk
.EventExpose evt
)
105 if (evt
.Window
== GdkWindow
) {
106 GdkWindow
.DrawRectangle (Style
.BaseGC (State
), true,
107 evt
.Area
.X
, evt
.Area
.Y
,
108 evt
.Area
.Width
, evt
.Area
.Height
);
112 PropagateExpose (Child
, evt
);