Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@xamarin.com>2013-07-10 18:30:30 +0400
committerLluis Sanchez <lluis@xamarin.com>2013-07-25 01:43:15 +0400
commit50c6044665d43f2359b6945d3a4fafde529f3a1b (patch)
tree333b1b19f240b89357a6b3f3160f9c7b69790f28 /main
parent16c94292d492bf5e2f97b997fc85a46e35071a79 (diff)
More changes to support retina icons
Diffstat (limited to 'main')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs22
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs7
2 files changed, 24 insertions, 5 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs
index 684b22e7f6..25a5374bff 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs
@@ -50,6 +50,24 @@ namespace MonoDevelop.Components
}
}
+ float xalign = 0.5f;
+ public float Xalign {
+ get { return xalign; }
+ set {
+ xalign = value;
+ QueueDraw ();
+ }
+ }
+
+ float yalign = 0.5f;
+ public float Yalign {
+ get { return yalign; }
+ set {
+ yalign = value;
+ QueueDraw ();
+ }
+ }
+
protected override void OnSizeRequested (ref Gtk.Requisition requisition)
{
requisition.Width = (int)image.Width;
@@ -60,8 +78,8 @@ namespace MonoDevelop.Components
{
if (image != null) {
using (var ctx = CairoHelper.Create (evnt.Window)) {
- var x = Allocation.X + (Allocation.Width - image.Width) / 2;
- var y = Allocation.Y + (Allocation.Height - image.Height) / 2;
+ var x = Allocation.X + (Allocation.Width - image.Width) * xalign;
+ var y = Allocation.Y + (Allocation.Height - image.Height) * yalign;
ctx.DrawImage (this, image, x, y);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs
index 675a012a3d..e9e80f8a37 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs
@@ -31,6 +31,7 @@ using System.Text;
using Gtk;
using MonoDevelop.Core;
using System.Linq;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Dialogs
{
@@ -43,7 +44,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
AlertButton[] buttons;
Gtk.HBox hbox = new HBox ();
- Gtk.Image image;
+ ImageView image;
Gtk.Label label = new Label ();
VBox labelsBox = new VBox (false, 6);
@@ -99,9 +100,9 @@ namespace MonoDevelop.Ide.Gui.Dialogs
}
if (!string.IsNullOrEmpty (message.Icon)) {
- image = new Image ();
+ image = new ImageView ();
image.Yalign = 0.00f;
- image.Pixbuf = ImageService.GetPixbuf (message.Icon, IconSize.Dialog);
+ image.Image = ImageService.GetIcon (message.Icon, IconSize.Dialog);
hbox.PackStart (image, false, false, 0);
hbox.ReorderChild (image, 0);
}