|
36 | 36 | using MonoDevelop.Components;
|
37 | 37 | using MonoDevelop.Components.Commands;
|
38 | 38 | using System.IO;
|
| 39 | +using System.Runtime.InteropServices; |
39 | 40 |
|
40 | 41 | namespace MonoDevelop.Ide.Projects
|
41 | 42 | {
|
@@ -157,16 +158,21 @@ TreeIter AddPackageReference (ProjectReference refInfo)
|
157 | 158 | }
|
158 | 159 | return refTreeStore.AppendValues (txt, secondaryTxt, GetTypeText (refInfo), refInfo.Reference, refInfo, ImageService.GetIcon ("md-package", IconSize.Dnd));
|
159 | 160 | }
|
160 |
| - |
| 161 | + |
| 162 | + [DllImport ("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] |
| 163 | + private static extern void gtk_notebook_set_action_widget (IntPtr notebook, IntPtr widget, int packType); |
| 164 | + |
161 | 165 | public SelectReferenceDialog ()
|
162 | 166 | {
|
163 | 167 | Build ();
|
164 | 168 |
|
165 | 169 | combinedBox = new CombinedBox ();
|
166 | 170 | combinedBox.Show ();
|
167 | 171 | mainBook = new Notebook ();
|
168 |
| - combinedBox.Add (mainBook); |
169 |
| - alignment1.Add (combinedBox); |
| 172 | + |
| 173 | + gtk_notebook_set_action_widget (mainBook.Handle, combinedBox.Handle, (int)PackType.End); |
| 174 | + |
| 175 | + alignment1.Add (mainBook); |
170 | 176 | mainBook.ShowAll ();
|
171 | 177 |
|
172 | 178 | filterEntry = combinedBox.FilterEntry;
|
@@ -538,22 +544,24 @@ protected override void OnRemoved (Widget widget)
|
538 | 544 |
|
539 | 545 | protected override void OnSizeAllocated (Gdk.Rectangle allocation)
|
540 | 546 | {
|
| 547 | + allocation.Y -= 2; |
541 | 548 | base.OnSizeAllocated (allocation);
|
542 | 549 | RepositionFilter ();
|
543 | 550 | }
|
544 | 551 |
|
545 | 552 | protected override void OnSizeRequested (ref Requisition requisition)
|
546 | 553 | {
|
547 |
| - if (Child != null) |
548 |
| - requisition = Child.SizeRequest (); |
549 |
| - requisition.Width += filterEntry.SizeRequest ().Width; |
| 554 | + requisition = Child?.SizeRequest () ?? Requisition.Zero; |
| 555 | + var entryRequest = filterEntry.SizeRequest (); |
| 556 | + requisition.Width += entryRequest.Width; |
| 557 | + requisition.Height = Math.Max (requisition.Height, entryRequest.Height); |
550 | 558 | }
|
551 | 559 |
|
552 | 560 | void RepositionFilter ()
|
553 | 561 | {
|
554 |
| - int w = filterEntry.SizeRequest ().Width; |
555 |
| - int h = filterEntry.SizeRequest ().Height; |
556 |
| - filterEntry.SizeAllocate (new Gdk.Rectangle (Allocation.Width - w - 1, 0, w, h)); |
| 562 | + var req = filterEntry.SizeRequest (); |
| 563 | + int h = Math.Min (Allocation.Height, req.Height); |
| 564 | + filterEntry.SizeAllocate (new Gdk.Rectangle (Allocation.Width - req.Width - 1, 0, req.Width, h)); |
557 | 565 | }
|
558 | 566 | }
|
559 | 567 |
|
|
0 commit comments