diff options
author | Carlos Alberto Cortez <calberto.cortez@gmail.com> | 2011-10-13 18:19:18 +0400 |
---|---|---|
committer | Carlos Alberto Cortez <calberto.cortez@gmail.com> | 2011-10-13 18:20:22 +0400 |
commit | 4b5763863c73de4a3793a1be8479dde4ed1d26ef (patch) | |
tree | b6d7f1abc486c1af5dfe9ec3628e77f7bc735df5 /main/src/addins/WindowsPlatform | |
parent | f60a4a683a3a91e67d0f50f3944a0a3a17aaf3d9 (diff) |
[WindowsPlatform] Use the MD icon for our native dialogs.
Diffstat (limited to 'main/src/addins/WindowsPlatform')
3 files changed, 15 insertions, 0 deletions
diff --git a/main/src/addins/WindowsPlatform/Dialogs/EncodingSelectionForm.cs b/main/src/addins/WindowsPlatform/Dialogs/EncodingSelectionForm.cs index e85924dc12..484171ce49 100644 --- a/main/src/addins/WindowsPlatform/Dialogs/EncodingSelectionForm.cs +++ b/main/src/addins/WindowsPlatform/Dialogs/EncodingSelectionForm.cs @@ -88,6 +88,8 @@ namespace MonoDevelop.Platform SetStockImage (removeButton, Gtk.Stock.GoBack);
SetStockImage (upButton, Gtk.Stock.GoUp);
SetStockImage (downButton, Gtk.Stock.GoDown);
+
+ Icon = WinFormsRoot.MonoDevelopIcon;
}
void SetStockImage (Button b, string stockId)
diff --git a/main/src/addins/WindowsPlatform/Dialogs/OpenFileDialogEx.cs b/main/src/addins/WindowsPlatform/Dialogs/OpenFileDialogEx.cs index a1600f3c08..a120d6a470 100644 --- a/main/src/addins/WindowsPlatform/Dialogs/OpenFileDialogEx.cs +++ b/main/src/addins/WindowsPlatform/Dialogs/OpenFileDialogEx.cs @@ -153,6 +153,9 @@ namespace CustomControls.Controls public DialogResult ShowDialog(IWin32Window owner)
{
form = new DummyForm(this);
+ if (owner is Form)
+ form.Icon = ((Form)owner).Icon; // Inherit the app/window icon
+
form.Show(owner);
Win32.SetWindowPos(form.Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
form.WatchForActivate = true;
diff --git a/main/src/addins/WindowsPlatform/Dialogs/WinFormsRoot.cs b/main/src/addins/WindowsPlatform/Dialogs/WinFormsRoot.cs index d8033e3760..8c86662b29 100644 --- a/main/src/addins/WindowsPlatform/Dialogs/WinFormsRoot.cs +++ b/main/src/addins/WindowsPlatform/Dialogs/WinFormsRoot.cs @@ -27,10 +27,20 @@ namespace MonoDevelop.Platform this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(-32000, -32000);
this.ShowInTaskbar = false;
+ this.Icon = MonoDevelopIcon; // Icon is inherited to FileDialog objects
Show();
Win32.SetWindowPos(Handle, IntPtr.Zero, 0, 0, 0, 0, UFLAGSHIDE);
watchForActivate = true;
}
+
+ public static readonly Icon MonoDevelopIcon = LoadMonoDevelopIcon ();
+
+ static Icon LoadMonoDevelopIcon ()
+ {
+ // IconSize.Dnd seems to be the best match for Form.Icon
+ var pixbuf = MonoDevelop.Ide.ImageService.GetPixbuf ("md-monodevelop", Gtk.IconSize.Dnd);
+ return new Icon (new System.IO.MemoryStream (pixbuf.SaveToBuffer ("ico")));
+ }
protected override void OnClosing (CancelEventArgs args)
{
|