~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
                        redgc = new Gdk.GC (GdkWindow);
64
64
                        redgc.RgbFgColor = frame.Style.Background (StateType.Selected);
65
65
                }
 
66
 
 
67
                protected override void OnRealized ()
 
68
                {
 
69
                        base.OnRealized ();
 
70
                        GdkWindow.Opacity = 0.6;
 
71
                }
66
72
                
67
73
                void CreateShape (int width, int height)
68
74
                {
104
110
                
105
111
                public void Relocate (int x, int y, int w, int h, bool animate)
106
112
                {
 
113
                        Gdk.Rectangle geometry = Mono.TextEditor.GtkWorkarounds.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
 
114
                        if (x < geometry.X)
 
115
                                x = geometry.X;
 
116
                        if (x + w > geometry.Right)
 
117
                                x = geometry.Right - w;
 
118
                        if (y < geometry.Y)
 
119
                                y = geometry.Y;
 
120
                        if (y > geometry.Bottom - h)
 
121
                                y = geometry.Bottom - h;
 
122
 
107
123
                        if (x != rx || y != ry || w != rw || h != rh) {
 
124
                                Resize (w, h);
108
125
                                Move (x, y);
109
 
                                Resize (w, h);
110
 
                                
 
126
 
111
127
                                rx = x; ry = y; rw = w; rh = h;
112
128
                                
113
129
                                if (anim != 0) {
139
155
                        anim = 0;
140
156
                        return false;
141
157
                }
 
158
 
 
159
                public DockDelegate DockDelegate { get; private set; }
 
160
                public Gdk.Rectangle DockRect { get; private set; }
 
161
 
 
162
                public void SetDockInfo (DockDelegate dockDelegate, Gdk.Rectangle rect)
 
163
                {
 
164
                        DockDelegate = dockDelegate;
 
165
                        DockRect = rect;
 
166
                }
 
167
        }
 
168
 
 
169
        class PadTitleWindow: Gtk.Window
 
170
        {
 
171
                public PadTitleWindow (DockFrame frame, DockItem draggedItem): base (Gtk.WindowType.Popup)
 
172
                {
 
173
                        SkipTaskbarHint = true;
 
174
                        Decorated = false;
 
175
                        TransientFor = (Gtk.Window) frame.Toplevel;
 
176
                        TypeHint = WindowTypeHint.Utility;
 
177
 
 
178
                        VBox mainBox = new VBox ();
 
179
 
 
180
                        HBox box = new HBox (false, 3);
 
181
                        if (draggedItem.Icon != null) {
 
182
                                Gtk.Image img = new Gtk.Image (draggedItem.Icon);
 
183
                                box.PackStart (img, false, false, 0);
 
184
                        }
 
185
                        Gtk.Label la = new Label ();
 
186
                        la.Markup = draggedItem.Label;
 
187
                        box.PackStart (la, false, false, 0);
 
188
 
 
189
                        mainBox.PackStart (box, false, false, 0);
 
190
 
 
191
/*                      if (draggedItem.Widget.IsRealized) {
 
192
                                var win = draggedItem.Widget.GdkWindow;
 
193
                                var alloc = draggedItem.Widget.Allocation;
 
194
                                Gdk.Pixbuf img = Gdk.Pixbuf.FromDrawable (win, win.Colormap, alloc.X, alloc.Y, 0, 0, alloc.Width, alloc.Height);
 
195
 
 
196
                                double mw = 140, mh = 140;
 
197
                                if (img.Width > img.Height)
 
198
                                        mw *= 2;
 
199
                                else
 
200
                                        mh *= 2;
 
201
 
 
202
                                double r = Math.Min (mw / img.Width, mh / img.Height);
 
203
                                img = img.ScaleSimple ((int)(img.Width * r), (int)(img.Height * r), Gdk.InterpType.Hyper);
 
204
                                mainBox.PackStart (new Gtk.Image (img), false, false, 0);
 
205
                        }*/
 
206
 
 
207
                        CustomFrame f = new CustomFrame ();
 
208
                        f.SetPadding (12, 12, 12, 12);
 
209
                        f.SetMargins (1, 1, 1, 1);
 
210
                        f.Add (mainBox);
 
211
 
 
212
                        Add (f);
 
213
                        ShowAll ();
 
214
                }
142
215
        }
143
216
}